[REZOLVAT]Modificare plugin Furien knife

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

User avatar
luciansefu9
Membru, skill +1
Membru, skill +1
Posts: 107
Joined: 05 Nov 2013, 19:05
Detinator Steam: Da
CS Status: Invat scripting!
Detinator server CS: da da nu hostat
SteamID: luciansefu9
Has thanked: 9 times
Been thanked: 3 times
Contact:

11 Feb 2014, 17:49

Deci am un plugin cu superknife
| Afiseaza codul
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>

#include "furien.inc"
#include "furien_shop.inc"

#define VERSION "0.2.0"

#define FIRST_PLAYER_ID	1

new g_iMaxPlayers
#define IsPlayer(%1)	( FIRST_PLAYER_ID <= %1 <= g_iMaxPlayers )

#define XO_WEAPON 4
#define m_pPlayer 41

#define XO_PLAYER		5
#define m_pActiveItem	373

new g_bHasSuperKnife
#define SetUserSuperKnife(%1)		g_bHasSuperKnife |= 1<<(%1&31)
#define RemoveUserSuperKnife(%1)	g_bHasSuperKnife &= ~(1<<(%1&31))
#define HasUserSuperKnife(%1)		g_bHasSuperKnife & 1<<(%1&31)

new g_iszSuperKnifeModel
new Float:g_flSuperKnifeDamageFactor

new g_iCost[2]

public plugin_precache()
{
	register_plugin("Furien SuperKnife", VERSION, "ConnorMcLeod")

	new szConfigFile[128]
	get_localinfo("amxx_configsdir", szConfigFile, charsmax(szConfigFile))
	format(szConfigFile, charsmax(szConfigFile), "%s/furien/items/superknife1.ini", szConfigFile);

	new fp = fopen(szConfigFile, "rt")
	if( !fp )
	{
		return
	}

	new szFurienName[32], szAntiName[32]

	new szDatas[80], szKey[16], szValue[64]
	while( !feof(fp) )
	{
		fgets(fp, szDatas, charsmax(szDatas))
		trim(szDatas)
		if(!szDatas[0] || szDatas[0] == ';' || szDatas[0] == '#' || (szDatas[0] == '/' && szDatas[1] == '/'))
		{
			continue
		}

		parse(szDatas, szKey, charsmax(szKey), szValue, charsmax(szValue))

		switch( szKey[0] )
		{
			case 'A':
			{
				switch( szKey[7] )
				{
					case 'M':
					{
						if( equal(szKey, "ANTI_NAME" ) )
						{
							copy(szAntiName, charsmax(szAntiName), szValue)
						}
					}
					case 'S':
					{
						if( equal(szKey, "ANTI_COST" ) )
						{
							g_iCost[AntiFurien] = str_to_num(szValue)
						}
					}
				}
			}
			case 'F':
			{
				switch( szKey[9] )
				{
					case 'M':
					{
						if( equal(szKey, "FURIEN_NAME" ) )
						{
							copy(szFurienName, charsmax(szAntiName), szValue)
						}
					}
					case 'S':
					{
						if( equal(szKey, "FURIEN_COST" ) )
						{
							g_iCost[Furien] = str_to_num(szValue)
						}
					}
				}
			}
			case 'K':
			{
				switch( szKey[6] )
				{
					case 'M':
					{
						if( equal(szKey, "KNIFE_MODEL" ) )
						{
							precache_model(szValue)
							g_iszSuperKnifeModel = engfunc(EngFunc_AllocString, szValue)
						}
					}
					case 'D':
					{
						if( equal(szKey, "KNIFE_DAMAGE" ) )
						{
							g_flSuperKnifeDamageFactor = str_to_float(szValue)
						}
					}
				}
			}
		}
	}
	fclose( fp )

	if( g_iCost[Furien] || g_iCost[AntiFurien] )
	{
		furien_register_item(szFurienName, g_iCost[Furien], szAntiName, g_iCost[AntiFurien], "furien_buy_superknife")	

		RegisterHam(Ham_Killed, "player", "Ham_CBasePlayer_Killed_Post", true)
		RegisterHam(Ham_TakeDamage, "player", "CBasePlayer_TakeDamage", false)
		RegisterHam(Ham_Item_Deploy, "weapon_knife", "CKnife_Deploy", true)

		g_iMaxPlayers = get_maxplayers()
	}
}

public client_putinserver(id)
{
	RemoveUserSuperKnife(id)
}

public furien_buy_superknife( id )
{
	new iTeam = furien_get_user_team(id)
	if( iTeam == -1 )
	{
		return ShopCloseMenu
	}

	new iItemCost = g_iCost[iTeam]
	if( iItemCost <= 0 )
	{
		return ShopTeamNotAvail
	}

	if( ~HasUserSuperKnife(id) )
	{
		if( furien_try_buy(id, iItemCost) )
		{
			SetUserSuperKnife(id)
			if( get_user_weapon(id) == CSW_KNIFE )
			{
				ExecuteHamB(Ham_Item_Deploy, get_pdata_cbase(id, m_pActiveItem, XO_PLAYER))
			}
			return ShopBought
		}
		else
		{
			return ShopNotEnoughMoney
		}
	}
	return ShopAlreadyHaveOne
}

public CKnife_Deploy( iKnife )
{
	new id = get_pdata_cbase(iKnife, m_pPlayer, XO_WEAPON)

	if( HasUserSuperKnife(id) )
	{
		set_pev(id, pev_viewmodel, g_iszSuperKnifeModel)
	}
}

public CBasePlayer_TakeDamage(id, iInflictor, iAttacker, Float:flDamage, bitsDamageType)
{
	if( IsPlayer(iInflictor) && HasUserSuperKnife(iAttacker) && get_user_weapon(iAttacker) == CSW_KNIFE )
	{
		SetHamParamFloat( 4, flDamage * g_flSuperKnifeDamageFactor )
	}
}

public Ham_CBasePlayer_Killed_Post(id)
{
	RemoveUserSuperKnife(id)
}

public furien_team_change( /*iFurien */ )
{
	if( !g_iCost[Furien] || !g_iCost[AntiFurien] )
	{
		new iPlayers[32], iNum, id
		get_players(iPlayers, iNum, "a")
		for(new i; i<iNum; i++)
		{
			id = iPlayers
			if( HasUserSuperKnife(id) )
			{
				RemoveUserSuperKnife(id)
				if( get_user_weapon(id) == CSW_KNIFE )
				{
					ExecuteHamB(Ham_Item_Deploy, get_pdata_cbase(id, m_pActiveItem, XO_PLAYER))
				}
			}
		}
		g_bHasSuperKnife = 0
	}
}

public furien_round_restart()
{
	g_bHasSuperKnife = 0
}

E cel clasic ma rog... Am si un .ini
| Afiseaza codul
FURIEN_NAME "Mini Axe  "
FURIEN_COST "6000"

ANTI_NAME "Gheara de Tigru"
ANTI_COST "0"

KNIFE_MODEL "models/v_miniaxe.mdl"
KNIFE_DAMAGE "12.0"

In sa eu am facut mai multe dinastea si am tot creat .ini ca sa bag 12 cutite diferite le-am bagat intrebarea este
cum sa fac pe credite asta sa-l setez pe credite nu pe money adica bani dinaia obijnuiti!
| Afiseaza codul
FURIEN_NAME "Mini Axe  "
FURIEN_COST "6000"

ANTI_NAME "Gheara de Tigru"
ANTI_COST "0"

KNIFE_MODEL "models/v_miniaxe.mdl"
KNIFE_DAMAGE "12.0"


Astept si va rog sa ma ajutati ! 8-> :-ss #:-s 8-|
Last edited by luciansefu9 on 28 Feb 2014, 18:12, edited 2 times in total.
RoyalServer
User avatar
GhosT ***
Membru, skill +2
Membru, skill +2
Posts: 604
Joined: 04 Dec 2013, 21:52
Detinator Steam: Da
CS Status: Morphin . [ Retras ]
SteamID: Mutulica1428
Reputatie: Fost Moderator ajutator
Location: Dumesti.
Has thanked: 40 times
Been thanked: 99 times
Contact:

11 Feb 2014, 17:51

luciansefu9 wrote:Deci am un plugin cu superknife
| Afiseaza codul
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>

#include "furien.inc"
#include "furien_shop.inc"

#define VERSION "0.2.0"

#define FIRST_PLAYER_ID	1

new g_iMaxPlayers
#define IsPlayer(%1)	( FIRST_PLAYER_ID <= %1 <= g_iMaxPlayers )

#define XO_WEAPON 4
#define m_pPlayer 41

#define XO_PLAYER		5
#define m_pActiveItem	373

new g_bHasSuperKnife
#define SetUserSuperKnife(%1)		g_bHasSuperKnife |= 1<<(%1&31)
#define RemoveUserSuperKnife(%1)	g_bHasSuperKnife &= ~(1<<(%1&31))
#define HasUserSuperKnife(%1)		g_bHasSuperKnife & 1<<(%1&31)

new g_iszSuperKnifeModel
new Float:g_flSuperKnifeDamageFactor

new g_iCost[2]

public plugin_precache()
{
	register_plugin("Furien SuperKnife", VERSION, "ConnorMcLeod")

	new szConfigFile[128]
	get_localinfo("amxx_configsdir", szConfigFile, charsmax(szConfigFile))
	format(szConfigFile, charsmax(szConfigFile), "%s/furien/items/superknife1.ini", szConfigFile);

	new fp = fopen(szConfigFile, "rt")
	if( !fp )
	{
		return
	}

	new szFurienName[32], szAntiName[32]

	new szDatas[80], szKey[16], szValue[64]
	while( !feof(fp) )
	{
		fgets(fp, szDatas, charsmax(szDatas))
		trim(szDatas)
		if(!szDatas[0] || szDatas[0] == ';' || szDatas[0] == '#' || (szDatas[0] == '/' && szDatas[1] == '/'))
		{
			continue
		}

		parse(szDatas, szKey, charsmax(szKey), szValue, charsmax(szValue))

		switch( szKey[0] )
		{
			case 'A':
			{
				switch( szKey[7] )
				{
					case 'M':
					{
						if( equal(szKey, "ANTI_NAME" ) )
						{
							copy(szAntiName, charsmax(szAntiName), szValue)
						}
					}
					case 'S':
					{
						if( equal(szKey, "ANTI_COST" ) )
						{
							g_iCost[AntiFurien] = str_to_num(szValue)
						}
					}
				}
			}
			case 'F':
			{
				switch( szKey[9] )
				{
					case 'M':
					{
						if( equal(szKey, "FURIEN_NAME" ) )
						{
							copy(szFurienName, charsmax(szAntiName), szValue)
						}
					}
					case 'S':
					{
						if( equal(szKey, "FURIEN_COST" ) )
						{
							g_iCost[Furien] = str_to_num(szValue)
						}
					}
				}
			}
			case 'K':
			{
				switch( szKey[6] )
				{
					case 'M':
					{
						if( equal(szKey, "KNIFE_MODEL" ) )
						{
							precache_model(szValue)
							g_iszSuperKnifeModel = engfunc(EngFunc_AllocString, szValue)
						}
					}
					case 'D':
					{
						if( equal(szKey, "KNIFE_DAMAGE" ) )
						{
							g_flSuperKnifeDamageFactor = str_to_float(szValue)
						}
					}
				}
			}
		}
	}
	fclose( fp )

	if( g_iCost[Furien] || g_iCost[AntiFurien] )
	{
		furien_register_item(szFurienName, g_iCost[Furien], szAntiName, g_iCost[AntiFurien], "furien_buy_superknife")	

		RegisterHam(Ham_Killed, "player", "Ham_CBasePlayer_Killed_Post", true)
		RegisterHam(Ham_TakeDamage, "player", "CBasePlayer_TakeDamage", false)
		RegisterHam(Ham_Item_Deploy, "weapon_knife", "CKnife_Deploy", true)

		g_iMaxPlayers = get_maxplayers()
	}
}

public client_putinserver(id)
{
	RemoveUserSuperKnife(id)
}

public furien_buy_superknife( id )
{
	new iTeam = furien_get_user_team(id)
	if( iTeam == -1 )
	{
		return ShopCloseMenu
	}

	new iItemCost = g_iCost[iTeam]
	if( iItemCost <= 0 )
	{
		return ShopTeamNotAvail
	}

	if( ~HasUserSuperKnife(id) )
	{
		if( furien_try_buy(id, iItemCost) )
		{
			SetUserSuperKnife(id)
			if( get_user_weapon(id) == CSW_KNIFE )
			{
				ExecuteHamB(Ham_Item_Deploy, get_pdata_cbase(id, m_pActiveItem, XO_PLAYER))
			}
			return ShopBought
		}
		else
		{
			return ShopNotEnoughMoney
		}
	}
	return ShopAlreadyHaveOne
}

public CKnife_Deploy( iKnife )
{
	new id = get_pdata_cbase(iKnife, m_pPlayer, XO_WEAPON)

	if( HasUserSuperKnife(id) )
	{
		set_pev(id, pev_viewmodel, g_iszSuperKnifeModel)
	}
}

public CBasePlayer_TakeDamage(id, iInflictor, iAttacker, Float:flDamage, bitsDamageType)
{
	if( IsPlayer(iInflictor) && HasUserSuperKnife(iAttacker) && get_user_weapon(iAttacker) == CSW_KNIFE )
	{
		SetHamParamFloat( 4, flDamage * g_flSuperKnifeDamageFactor )
	}
}

public Ham_CBasePlayer_Killed_Post(id)
{
	RemoveUserSuperKnife(id)
}

public furien_team_change( /*iFurien */ )
{
	if( !g_iCost[Furien] || !g_iCost[AntiFurien] )
	{
		new iPlayers[32], iNum, id
		get_players(iPlayers, iNum, "a")
		for(new i; i<iNum; i++)
		{
			id = iPlayers
			if( HasUserSuperKnife(id) )
			{
				RemoveUserSuperKnife(id)
				if( get_user_weapon(id) == CSW_KNIFE )
				{
					ExecuteHamB(Ham_Item_Deploy, get_pdata_cbase(id, m_pActiveItem, XO_PLAYER))
				}
			}
		}
		g_bHasSuperKnife = 0
	}
}

public furien_round_restart()
{
	g_bHasSuperKnife = 0
}

E cel clasic ma rog... Am si un .ini
| Afiseaza codul
FURIEN_NAME "Mini Axe  "
FURIEN_COST "6000"

ANTI_NAME "Gheara de Tigru"
ANTI_COST "0"

KNIFE_MODEL "models/v_miniaxe.mdl"
KNIFE_DAMAGE "12.0"

In sa eu am facut mai multe dinastea si am tot creat .ini ca sa bag 12 cutite diferite le-am bagat intrebarea este
cum sa fac pe credite asta sa-l setez pe credite nu pe money adica bani dinaia obijnuiti!
| Afiseaza codul
FURIEN_NAME "Mini Axe  "
FURIEN_COST "6000"

ANTI_NAME "Gheara de Tigru"
ANTI_COST "0"

KNIFE_MODEL "models/v_miniaxe.mdl"
KNIFE_DAMAGE "12.0"


Astept si va rog sa ma ajutati ! 8-> :-ss #:-s 8-|


Pune .sma de la "mini axe knife"
User avatar
luciansefu9
Membru, skill +1
Membru, skill +1
Posts: 107
Joined: 05 Nov 2013, 19:05
Detinator Steam: Da
CS Status: Invat scripting!
Detinator server CS: da da nu hostat
SteamID: luciansefu9
Has thanked: 9 times
Been thanked: 3 times
Contact:

11 Feb 2014, 17:51

npcaaa
Last edited by luciansefu9 on 11 Feb 2014, 18:00, edited 1 time in total.
User avatar
GhosT ***
Membru, skill +2
Membru, skill +2
Posts: 604
Joined: 04 Dec 2013, 21:52
Detinator Steam: Da
CS Status: Morphin . [ Retras ]
SteamID: Mutulica1428
Reputatie: Fost Moderator ajutator
Location: Dumesti.
Has thanked: 40 times
Been thanked: 99 times
Contact:

11 Feb 2014, 17:53

luciansefu9 wrote:smaul este cel mai de sus are un fel de ini si se pune in furien
Ce sistem de credite folosesti ? [Askhanar sau Aragon]
User avatar
luciansefu9
Membru, skill +1
Membru, skill +1
Posts: 107
Joined: 05 Nov 2013, 19:05
Detinator Steam: Da
CS Status: Invat scripting!
Detinator server CS: da da nu hostat
SteamID: luciansefu9
Has thanked: 9 times
Been thanked: 3 times
Contact:

11 Feb 2014, 17:54

deci asta
| Afiseaza codul
FURIEN_NAME "Mini Axe  "
FURIEN_COST "6000"

ANTI_NAME "Gheara de Tigru"
ANTI_COST "0"

KNIFE_MODEL "models/v_miniaxe.mdl"
KNIFE_DAMAGE "12.0"
apartine de asta
| Afiseaza codul
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>

#include "furien.inc"
#include "furien_shop.inc"

#define VERSION "0.2.0"

#define FIRST_PLAYER_ID	1

new g_iMaxPlayers
#define IsPlayer(%1)	( FIRST_PLAYER_ID <= %1 <= g_iMaxPlayers )

#define XO_WEAPON 4
#define m_pPlayer 41

#define XO_PLAYER		5
#define m_pActiveItem	373

new g_bHasSuperKnife
#define SetUserSuperKnife(%1)		g_bHasSuperKnife |= 1<<(%1&31)
#define RemoveUserSuperKnife(%1)	g_bHasSuperKnife &= ~(1<<(%1&31))
#define HasUserSuperKnife(%1)		g_bHasSuperKnife & 1<<(%1&31)

new g_iszSuperKnifeModel
new Float:g_flSuperKnifeDamageFactor

new g_iCost[2]

public plugin_precache()
{
	register_plugin("Furien SuperKnife", VERSION, "ConnorMcLeod")

	new szConfigFile[128]
	get_localinfo("amxx_configsdir", szConfigFile, charsmax(szConfigFile))
	format(szConfigFile, charsmax(szConfigFile), "%s/furien/items/sa.ini", szConfigFile);

	new fp = fopen(szConfigFile, "rt")
	if( !fp )
	{
		return
	}

	new szFurienName[32], szAntiName[32]

	new szDatas[80], szKey[16], szValue[64]
	while( !feof(fp) )
	{
		fgets(fp, szDatas, charsmax(szDatas))
		trim(szDatas)
		if(!szDatas[0] || szDatas[0] == ';' || szDatas[0] == '#' || (szDatas[0] == '/' && szDatas[1] == '/'))
		{
			continue
		}

		parse(szDatas, szKey, charsmax(szKey), szValue, charsmax(szValue))

		switch( szKey[0] )
		{
			case 'A':
			{
				switch( szKey[7] )
				{
					case 'M':
					{
						if( equal(szKey, "ANTI_NAME" ) )
						{
							copy(szAntiName, charsmax(szAntiName), szValue)
						}
					}
					case 'S':
					{
						if( equal(szKey, "ANTI_COST" ) )
						{
							g_iCost[AntiFurien] = str_to_num(szValue)
						}
					}
				}
			}
			case 'F':
			{
				switch( szKey[9] )
				{
					case 'M':
					{
						if( equal(szKey, "FURIEN_NAME" ) )
						{
							copy(szFurienName, charsmax(szAntiName), szValue)
						}
					}
					case 'S':
					{
						if( equal(szKey, "FURIEN_COST" ) )
						{
							g_iCost[Furien] = str_to_num(szValue)
						}
					}
				}
			}
			case 'K':
			{
				switch( szKey[6] )
				{
					case 'M':
					{
						if( equal(szKey, "KNIFE_MODEL" ) )
						{
							precache_model(szValue)
							g_iszSuperKnifeModel = engfunc(EngFunc_AllocString, szValue)
						}
					}
					case 'D':
					{
						if( equal(szKey, "KNIFE_DAMAGE" ) )
						{
							g_flSuperKnifeDamageFactor = str_to_float(szValue)
						}
					}
				}
			}
		}
	}
	fclose( fp )

	if( g_iCost[Furien] || g_iCost[AntiFurien] )
	{
		furien_register_item(szFurienName, g_iCost[Furien], szAntiName, g_iCost[AntiFurien], "furien_buy_superknife")	

		RegisterHam(Ham_Killed, "player", "Ham_CBasePlayer_Killed_Post", true)
		RegisterHam(Ham_TakeDamage, "player", "CBasePlayer_TakeDamage", false)
		RegisterHam(Ham_Item_Deploy, "weapon_knife", "CKnife_Deploy", true)

		g_iMaxPlayers = get_maxplayers()
	}
}

public client_putinserver(id)
{
	RemoveUserSuperKnife(id)
}

public furien_buy_superknife( id )
{
	new iTeam = furien_get_user_team(id)
	if( iTeam == -1 )
	{
		return ShopCloseMenu
	}

	new iItemCost = g_iCost[iTeam]
	if( iItemCost <= 0 )
	{
		return ShopTeamNotAvail
	}

	if( ~HasUserSuperKnife(id) )
	{
		if( furien_try_buy(id, iItemCost) )
		{
			SetUserSuperKnife(id)
			if( get_user_weapon(id) == CSW_KNIFE )
			{
				ExecuteHamB(Ham_Item_Deploy, get_pdata_cbase(id, m_pActiveItem, XO_PLAYER))
			}
			return ShopBought
		}
		else
		{
			return ShopNotEnoughMoney
		}
	}
	return ShopAlreadyHaveOne
}

public CKnife_Deploy( iKnife )
{
	new id = get_pdata_cbase(iKnife, m_pPlayer, XO_WEAPON)

	if( HasUserSuperKnife(id) )
	{
		set_pev(id, pev_viewmodel, g_iszSuperKnifeModel)
	}
}

public CBasePlayer_TakeDamage(id, iInflictor, iAttacker, Float:flDamage, bitsDamageType)
{
	if( IsPlayer(iInflictor) && HasUserSuperKnife(iAttacker) && get_user_weapon(iAttacker) == CSW_KNIFE )
	{
		SetHamParamFloat( 4, flDamage * g_flSuperKnifeDamageFactor )
	}
}

public Ham_CBasePlayer_Killed_Post(id)
{
	RemoveUserSuperKnife(id)
}

public furien_team_change( /*iFurien */ )
{
	if( !g_iCost[Furien] || !g_iCost[AntiFurien] )
	{
		new iPlayers[32], iNum, id
		get_players(iPlayers, iNum, "a")
		for(new i; i<iNum; i++)
		{
			id = iPlayers
			if( HasUserSuperKnife(id) )
			{
				RemoveUserSuperKnife(id)
				if( get_user_weapon(id) == CSW_KNIFE )
				{
					ExecuteHamB(Ham_Item_Deploy, get_pdata_cbase(id, m_pActiveItem, XO_PLAYER))
				}
			}
		}
		g_bHasSuperKnife = 0
	}
}

public furien_round_restart()
{
	g_bHasSuperKnife = 0
}


Si eu am facut mai multe ca sa am mai multe cutite nu stiu daca ma intelegeti...
User avatar
GhosT ***
Membru, skill +2
Membru, skill +2
Posts: 604
Joined: 04 Dec 2013, 21:52
Detinator Steam: Da
CS Status: Morphin . [ Retras ]
SteamID: Mutulica1428
Reputatie: Fost Moderator ajutator
Location: Dumesti.
Has thanked: 40 times
Been thanked: 99 times
Contact:

11 Feb 2014, 18:00

luciansefu9 wrote:askhancar
edit: is nou si nu pre stiu.. deci cine ma ajuta?
Daca vrei iti fac alt plugin de super knife ca la asta nu ma pricep :-??
User avatar
luciansefu9
Membru, skill +1
Membru, skill +1
Posts: 107
Joined: 05 Nov 2013, 19:05
Detinator Steam: Da
CS Status: Invat scripting!
Detinator server CS: da da nu hostat
SteamID: luciansefu9
Has thanked: 9 times
Been thanked: 3 times
Contact:

11 Feb 2014, 18:01

GhosT *** wrote:
luciansefu9 wrote:askhancar
edit: is nou si nu pre stiu.. deci cine ma ajuta?
Daca vrei iti fac alt plugin de super knife ca la asta nu ma pricep :-??
Pai daca ai putea unu pe credite cu 7 cutite cu modele si 2 cutite vip total 9 cutite...


\m/ >:D<
Last edited by luciansefu9 on 11 Feb 2014, 18:03, edited 1 time in total.
User avatar
GhosT ***
Membru, skill +2
Membru, skill +2
Posts: 604
Joined: 04 Dec 2013, 21:52
Detinator Steam: Da
CS Status: Morphin . [ Retras ]
SteamID: Mutulica1428
Reputatie: Fost Moderator ajutator
Location: Dumesti.
Has thanked: 40 times
Been thanked: 99 times
Contact:

11 Feb 2014, 18:03

luciansefu9 wrote:
GhosT *** wrote:
luciansefu9 wrote:askhancar
edit: is nou si nu pre stiu.. deci cine ma ajuta?
Daca vrei iti fac alt plugin de super knife ca la asta nu ma pricep :-??
Pai daca ai putea unu pe credite cu 7 cutite cu modele si 2 cutite vip total 9 cutite...
Nu sa iti fac un plugin de shop .. Un plugin de super knife nou .
Last edited by GhosT *** on 11 Feb 2014, 18:20, edited 2 times in total.
User avatar
luciansefu9
Membru, skill +1
Membru, skill +1
Posts: 107
Joined: 05 Nov 2013, 19:05
Detinator Steam: Da
CS Status: Invat scripting!
Detinator server CS: da da nu hostat
SteamID: luciansefu9
Has thanked: 9 times
Been thanked: 3 times
Contact:

11 Feb 2014, 18:04

GhosT *** wrote:
luciansefu9 wrote:
GhosT *** wrote:
Daca vrei iti fac alt plugin de super knife ca la asta nu ma pricep :-??
Pai daca ai putea unu pe credite cu 7 cutite cu modele si 2 cutite vip total 9 cutite...
Nu sa iti fac un plugin de shop .. Un plugin de super knife nou .
pai eu am superknife si cand scriu shop apare numai unul eu vreau mai multe... deasta am postat sal modific e bun dar sa fie pe credite...
User avatar
GhosT ***
Membru, skill +2
Membru, skill +2
Posts: 604
Joined: 04 Dec 2013, 21:52
Detinator Steam: Da
CS Status: Morphin . [ Retras ]
SteamID: Mutulica1428
Reputatie: Fost Moderator ajutator
Location: Dumesti.
Has thanked: 40 times
Been thanked: 99 times
Contact:

11 Feb 2014, 18:21

luciansefu9 wrote:Am incercat sa caut pe forum dar n-am gasit...

Uite :

Acolo unde tebuia sa pui costu vei pune "costu" in credite :) (ma refer in fisieru .ini)
| Afiseaza codul
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>

#include "furien.inc"
#include "furien_shop.inc"

#define VERSION "0.2.0"

#define FIRST_PLAYER_ID	1

new g_iMaxPlayers
#define IsPlayer(%1)	( FIRST_PLAYER_ID <= %1 <= g_iMaxPlayers )

#define XO_WEAPON 4
#define m_pPlayer 41

#define XO_PLAYER		5
#define m_pActiveItem	373

new g_bHasSuperKnife
#define SetUserSuperKnife(%1)		g_bHasSuperKnife |= 1<<(%1&31)
#define RemoveUserSuperKnife(%1)	g_bHasSuperKnife &= ~(1<<(%1&31))
#define HasUserSuperKnife(%1)		g_bHasSuperKnife & 1<<(%1&31)

new g_iszSuperKnifeModel
new Float:g_flSuperKnifeDamageFactor

new g_iCost[2]

public plugin_precache()
{
	register_plugin("Furien SuperKnife", VERSION, "ConnorMcLeod")

	new szConfigFile[128]
	get_localinfo("amxx_configsdir", szConfigFile, charsmax(szConfigFile))
	format(szConfigFile, charsmax(szConfigFile), "%s/furien/items/sa.ini", szConfigFile);

	new fp = fopen(szConfigFile, "rt")
	if( !fp )
	{
		return
	}

	new szFurienName[32], szAntiName[32]

	new szDatas[80], szKey[16], szValue[64]
	while( !feof(fp) )
	{
		fgets(fp, szDatas, charsmax(szDatas))
		trim(szDatas)
		if(!szDatas[0] || szDatas[0] == ';' || szDatas[0] == '#' || (szDatas[0] == '/' && szDatas[1] == '/'))
		{
			continue
		}

		parse(szDatas, szKey, charsmax(szKey), szValue, charsmax(szValue))

		switch( szKey[0] )
		{
			case 'A':
			{
				switch( szKey[7] )
				{
					case 'M':
					{
						if( equal(szKey, "ANTI_NAME" ) )
						{
							copy(szAntiName, charsmax(szAntiName), szValue)
						}
					}
					case 'S':
					{
						if( equal(szKey, "ANTI_COST" ) )
						{
							g_iCost[AntiFurien] = str_to_num(szValue)
						}
					}
				}
			}
			case 'F':
			{
				switch( szKey[9] )
				{
					case 'M':
					{
						if( equal(szKey, "FURIEN_NAME" ) )
						{
							copy(szFurienName, charsmax(szAntiName), szValue)
						}
					}
					case 'S':
					{
						if( equal(szKey, "FURIEN_COST" ) )
						{
							g_iCost[Furien] = str_to_num(szValue)
						}
					}
				}
			}
			case 'K':
			{
				switch( szKey[6] )
				{
					case 'M':
					{
						if( equal(szKey, "KNIFE_MODEL" ) )
						{
							precache_model(szValue)
							g_iszSuperKnifeModel = engfunc(EngFunc_AllocString, szValue)
						}
					}
					case 'D':
					{
						if( equal(szKey, "KNIFE_DAMAGE" ) )
						{
							g_flSuperKnifeDamageFactor = str_to_float(szValue)
						}
					}
				}
			}
		}
	}
	fclose( fp )

	if( g_iCost[Furien] || g_iCost[AntiFurien] )
	{
		furien_register_item(szFurienName, g_iCost[Furien], szAntiName, g_iCost[AntiFurien], "furien_buy_superknife")	

		RegisterHam(Ham_Killed, "player", "Ham_CBasePlayer_Killed_Post", true)
		RegisterHam(Ham_TakeDamage, "player", "CBasePlayer_TakeDamage", false)
		RegisterHam(Ham_Item_Deploy, "weapon_knife", "CKnife_Deploy", true)

		g_iMaxPlayers = get_maxplayers()
	}
}

public client_putinserver(id)
{
	RemoveUserSuperKnife(id)
}

public furien_buy_superknife( id )
{
	new iTeam = furien_get_user_team(id)
	if( iTeam == -1 )
	{
		return ShopCloseMenu
	}

	new iItemCost = g_iCost[iTeam]
	if( iItemCost <= 0 )
	{
		return ShopTeamNotAvail
	}

	if( ~HasUserSuperKnife(id) )
	{
		if( furien_try_buy_with_credits(id, iCost) )
		{
			SetUserSuperKnife(id)
			if( get_user_weapon(id) == CSW_KNIFE )
			{
				ExecuteHamB(Ham_Item_Deploy, get_pdata_cbase(id, m_pActiveItem, XO_PLAYER))
			}
			return ShopBought
		}
		else
		{
			return ShopNotEnoughMoney
		}
	}
	return ShopAlreadyHaveOne
}

public CKnife_Deploy( iKnife )
{
	new id = get_pdata_cbase(iKnife, m_pPlayer, XO_WEAPON)

	if( HasUserSuperKnife(id) )
	{
		set_pev(id, pev_viewmodel, g_iszSuperKnifeModel)
	}
}

public CBasePlayer_TakeDamage(id, iInflictor, iAttacker, Float:flDamage, bitsDamageType)
{
	if( IsPlayer(iInflictor) && HasUserSuperKnife(iAttacker) && get_user_weapon(iAttacker) == CSW_KNIFE )
	{
		SetHamParamFloat( 4, flDamage * g_flSuperKnifeDamageFactor )
	}
}

public Ham_CBasePlayer_Killed_Post(id)
{
	RemoveUserSuperKnife(id)
}

public furien_team_change( /*iFurien */ )
{
	if( !g_iCost[Furien] || !g_iCost[AntiFurien] )
	{
		new iPlayers[32], iNum, id
		get_players(iPlayers, iNum, "a")
		for(new i; i<iNum; i++)
		{
			id = iPlayers
			if( HasUserSuperKnife(id) )
			{
				RemoveUserSuperKnife(id)
				if( get_user_weapon(id) == CSW_KNIFE )
				{
					ExecuteHamB(Ham_Item_Deploy, get_pdata_cbase(id, m_pActiveItem, XO_PLAYER))
				}
			}
		}
		g_bHasSuperKnife = 0
	}
}

public furien_round_restart()
{
	g_bHasSuperKnife = 0
}


Si furien_shop.inc

| Afiseaza codul
#if defined _furien_shop
	#endinput
#endif
#define _furien_shop

#pragma reqlib furien_shop

#include <cstrike>

native fcs_set_user_credits(index, iNewCredits)
native fcs_get_user_credits(index)

enum _:ShopReturns {
	ShopBought,
	ShopTeamNotAvail,
	ShopAlreadyHaveOne,
	ShopCantCarryAnymore,
	ShopNotEnoughMoney,
	ShopCannotBuyThis,
	ShopShowMenuAgain,
	ShopCloseMenu
}

native furien_register_item(szFurienName[32], iFurienCost=0, szAntiName[32], iAntiCost=0, szCallBack[32] = "furien_buy_item", iExtra = 0);

stock furien_try_buy(id, iCost)
{
	new iNewMoney = cs_get_user_money(id) - iCost;

	if( iNewMoney < 0 )
	{
		return 0;
	}

	cs_set_user_money(id, iNewMoney, 1);
	
	return 1;
}
stock furien_try_buy_with_credits(id, iCost)
{
	new iNewCredits = fcs_get_user_credits(id) - iCost;

	if( iNewCredits < 0 )
	{
		return 0;
	}

	fcs_set_user_credits(id, iNewCredits);
	
	return 1;
}


P.S : Furien_shop.inc a fost modificat de mine :)) de aia trb sa il iei iar .
P.S2 : Mai lasa double post ca poate iei Ban :))
User avatar
luciansefu9
Membru, skill +1
Membru, skill +1
Posts: 107
Joined: 05 Nov 2013, 19:05
Detinator Steam: Da
CS Status: Invat scripting!
Detinator server CS: da da nu hostat
SteamID: luciansefu9
Has thanked: 9 times
Been thanked: 3 times
Contact:

11 Feb 2014, 18:23

GhosT *** wrote:
luciansefu9 wrote:Am incercat sa caut pe forum dar n-am gasit...

Uite :

Acolo unde tebuia sa pui costu vei pune "costu" in credite :) (ma refer in fisieru .ini)
| Afiseaza codul
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>

#include "furien.inc"
#include "furien_shop.inc"

#define VERSION "0.2.0"

#define FIRST_PLAYER_ID	1

new g_iMaxPlayers
#define IsPlayer(%1)	( FIRST_PLAYER_ID <= %1 <= g_iMaxPlayers )

#define XO_WEAPON 4
#define m_pPlayer 41

#define XO_PLAYER		5
#define m_pActiveItem	373

new g_bHasSuperKnife
#define SetUserSuperKnife(%1)		g_bHasSuperKnife |= 1<<(%1&31)
#define RemoveUserSuperKnife(%1)	g_bHasSuperKnife &= ~(1<<(%1&31))
#define HasUserSuperKnife(%1)		g_bHasSuperKnife & 1<<(%1&31)

new g_iszSuperKnifeModel
new Float:g_flSuperKnifeDamageFactor

new g_iCost[2]

public plugin_precache()
{
	register_plugin("Furien SuperKnife", VERSION, "ConnorMcLeod")

	new szConfigFile[128]
	get_localinfo("amxx_configsdir", szConfigFile, charsmax(szConfigFile))
	format(szConfigFile, charsmax(szConfigFile), "%s/furien/items/sa.ini", szConfigFile);

	new fp = fopen(szConfigFile, "rt")
	if( !fp )
	{
		return
	}

	new szFurienName[32], szAntiName[32]

	new szDatas[80], szKey[16], szValue[64]
	while( !feof(fp) )
	{
		fgets(fp, szDatas, charsmax(szDatas))
		trim(szDatas)
		if(!szDatas[0] || szDatas[0] == ';' || szDatas[0] == '#' || (szDatas[0] == '/' && szDatas[1] == '/'))
		{
			continue
		}

		parse(szDatas, szKey, charsmax(szKey), szValue, charsmax(szValue))

		switch( szKey[0] )
		{
			case 'A':
			{
				switch( szKey[7] )
				{
					case 'M':
					{
						if( equal(szKey, "ANTI_NAME" ) )
						{
							copy(szAntiName, charsmax(szAntiName), szValue)
						}
					}
					case 'S':
					{
						if( equal(szKey, "ANTI_COST" ) )
						{
							g_iCost[AntiFurien] = str_to_num(szValue)
						}
					}
				}
			}
			case 'F':
			{
				switch( szKey[9] )
				{
					case 'M':
					{
						if( equal(szKey, "FURIEN_NAME" ) )
						{
							copy(szFurienName, charsmax(szAntiName), szValue)
						}
					}
					case 'S':
					{
						if( equal(szKey, "FURIEN_COST" ) )
						{
							g_iCost[Furien] = str_to_num(szValue)
						}
					}
				}
			}
			case 'K':
			{
				switch( szKey[6] )
				{
					case 'M':
					{
						if( equal(szKey, "KNIFE_MODEL" ) )
						{
							precache_model(szValue)
							g_iszSuperKnifeModel = engfunc(EngFunc_AllocString, szValue)
						}
					}
					case 'D':
					{
						if( equal(szKey, "KNIFE_DAMAGE" ) )
						{
							g_flSuperKnifeDamageFactor = str_to_float(szValue)
						}
					}
				}
			}
		}
	}
	fclose( fp )

	if( g_iCost[Furien] || g_iCost[AntiFurien] )
	{
		furien_register_item(szFurienName, g_iCost[Furien], szAntiName, g_iCost[AntiFurien], "furien_buy_superknife")	

		RegisterHam(Ham_Killed, "player", "Ham_CBasePlayer_Killed_Post", true)
		RegisterHam(Ham_TakeDamage, "player", "CBasePlayer_TakeDamage", false)
		RegisterHam(Ham_Item_Deploy, "weapon_knife", "CKnife_Deploy", true)

		g_iMaxPlayers = get_maxplayers()
	}
}

public client_putinserver(id)
{
	RemoveUserSuperKnife(id)
}

public furien_buy_superknife( id )
{
	new iTeam = furien_get_user_team(id)
	if( iTeam == -1 )
	{
		return ShopCloseMenu
	}

	new iItemCost = g_iCost[iTeam]
	if( iItemCost <= 0 )
	{
		return ShopTeamNotAvail
	}

	if( ~HasUserSuperKnife(id) )
	{
		if( furien_try_buy_with_credits(id, iCost) )
		{
			SetUserSuperKnife(id)
			if( get_user_weapon(id) == CSW_KNIFE )
			{
				ExecuteHamB(Ham_Item_Deploy, get_pdata_cbase(id, m_pActiveItem, XO_PLAYER))
			}
			return ShopBought
		}
		else
		{
			return ShopNotEnoughMoney
		}
	}
	return ShopAlreadyHaveOne
}

public CKnife_Deploy( iKnife )
{
	new id = get_pdata_cbase(iKnife, m_pPlayer, XO_WEAPON)

	if( HasUserSuperKnife(id) )
	{
		set_pev(id, pev_viewmodel, g_iszSuperKnifeModel)
	}
}

public CBasePlayer_TakeDamage(id, iInflictor, iAttacker, Float:flDamage, bitsDamageType)
{
	if( IsPlayer(iInflictor) && HasUserSuperKnife(iAttacker) && get_user_weapon(iAttacker) == CSW_KNIFE )
	{
		SetHamParamFloat( 4, flDamage * g_flSuperKnifeDamageFactor )
	}
}

public Ham_CBasePlayer_Killed_Post(id)
{
	RemoveUserSuperKnife(id)
}

public furien_team_change( /*iFurien */ )
{
	if( !g_iCost[Furien] || !g_iCost[AntiFurien] )
	{
		new iPlayers[32], iNum, id
		get_players(iPlayers, iNum, "a")
		for(new i; i<iNum; i++)
		{
			id = iPlayers
			if( HasUserSuperKnife(id) )
			{
				RemoveUserSuperKnife(id)
				if( get_user_weapon(id) == CSW_KNIFE )
				{
					ExecuteHamB(Ham_Item_Deploy, get_pdata_cbase(id, m_pActiveItem, XO_PLAYER))
				}
			}
		}
		g_bHasSuperKnife = 0
	}
}

public furien_round_restart()
{
	g_bHasSuperKnife = 0
}


Si furien_shop.inc

| Afiseaza codul
#if defined _furien_shop
	#endinput
#endif
#define _furien_shop

#pragma reqlib furien_shop

#include <cstrike>

native fcs_set_user_credits(index, iNewCredits)
native fcs_get_user_credits(index)

enum _:ShopReturns {
	ShopBought,
	ShopTeamNotAvail,
	ShopAlreadyHaveOne,
	ShopCantCarryAnymore,
	ShopNotEnoughMoney,
	ShopCannotBuyThis,
	ShopShowMenuAgain,
	ShopCloseMenu
}

native furien_register_item(szFurienName[32], iFurienCost=0, szAntiName[32], iAntiCost=0, szCallBack[32] = "furien_buy_item", iExtra = 0);

stock furien_try_buy(id, iCost)
{
	new iNewMoney = cs_get_user_money(id) - iCost;

	if( iNewMoney < 0 )
	{
		return 0;
	}

	cs_set_user_money(id, iNewMoney, 1);
	
	return 1;
}
stock furien_try_buy_with_credits(id, iCost)
{
	new iNewCredits = fcs_get_user_credits(id) - iCost;

	if( iNewCredits < 0 )
	{
		return 0;
	}

	fcs_set_user_credits(id, iNewCredits);
	
	return 1;
}


P.S : Furien_shop.inc a fost modificat de mine :)) de aia trb sa il iei iar .
P.S2 : Mai lasa double post ca poate iei Ban :))




costu cum pun scriu 1 crefite?
User avatar
GhosT ***
Membru, skill +2
Membru, skill +2
Posts: 604
Joined: 04 Dec 2013, 21:52
Detinator Steam: Da
CS Status: Morphin . [ Retras ]
SteamID: Mutulica1428
Reputatie: Fost Moderator ajutator
Location: Dumesti.
Has thanked: 40 times
Been thanked: 99 times
Contact:

11 Feb 2014, 18:27

luciansefu9 wrote:
GhosT *** wrote:
luciansefu9 wrote:Am incercat sa caut pe forum dar n-am gasit...

Uite :

Acolo unde tebuia sa pui costu vei pune "costu" in credite :) (ma refer in fisieru .ini)
| Afiseaza codul
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>

#include "furien.inc"
#include "furien_shop.inc"

#define VERSION "0.2.0"

#define FIRST_PLAYER_ID	1

new g_iMaxPlayers
#define IsPlayer(%1)	( FIRST_PLAYER_ID <= %1 <= g_iMaxPlayers )

#define XO_WEAPON 4
#define m_pPlayer 41

#define XO_PLAYER		5
#define m_pActiveItem	373

new g_bHasSuperKnife
#define SetUserSuperKnife(%1)		g_bHasSuperKnife |= 1<<(%1&31)
#define RemoveUserSuperKnife(%1)	g_bHasSuperKnife &= ~(1<<(%1&31))
#define HasUserSuperKnife(%1)		g_bHasSuperKnife & 1<<(%1&31)

new g_iszSuperKnifeModel
new Float:g_flSuperKnifeDamageFactor

new g_iCost[2]

public plugin_precache()
{
	register_plugin("Furien SuperKnife", VERSION, "ConnorMcLeod")

	new szConfigFile[128]
	get_localinfo("amxx_configsdir", szConfigFile, charsmax(szConfigFile))
	format(szConfigFile, charsmax(szConfigFile), "%s/furien/items/sa.ini", szConfigFile);

	new fp = fopen(szConfigFile, "rt")
	if( !fp )
	{
		return
	}

	new szFurienName[32], szAntiName[32]

	new szDatas[80], szKey[16], szValue[64]
	while( !feof(fp) )
	{
		fgets(fp, szDatas, charsmax(szDatas))
		trim(szDatas)
		if(!szDatas[0] || szDatas[0] == ';' || szDatas[0] == '#' || (szDatas[0] == '/' && szDatas[1] == '/'))
		{
			continue
		}

		parse(szDatas, szKey, charsmax(szKey), szValue, charsmax(szValue))

		switch( szKey[0] )
		{
			case 'A':
			{
				switch( szKey[7] )
				{
					case 'M':
					{
						if( equal(szKey, "ANTI_NAME" ) )
						{
							copy(szAntiName, charsmax(szAntiName), szValue)
						}
					}
					case 'S':
					{
						if( equal(szKey, "ANTI_COST" ) )
						{
							g_iCost[AntiFurien] = str_to_num(szValue)
						}
					}
				}
			}
			case 'F':
			{
				switch( szKey[9] )
				{
					case 'M':
					{
						if( equal(szKey, "FURIEN_NAME" ) )
						{
							copy(szFurienName, charsmax(szAntiName), szValue)
						}
					}
					case 'S':
					{
						if( equal(szKey, "FURIEN_COST" ) )
						{
							g_iCost[Furien] = str_to_num(szValue)
						}
					}
				}
			}
			case 'K':
			{
				switch( szKey[6] )
				{
					case 'M':
					{
						if( equal(szKey, "KNIFE_MODEL" ) )
						{
							precache_model(szValue)
							g_iszSuperKnifeModel = engfunc(EngFunc_AllocString, szValue)
						}
					}
					case 'D':
					{
						if( equal(szKey, "KNIFE_DAMAGE" ) )
						{
							g_flSuperKnifeDamageFactor = str_to_float(szValue)
						}
					}
				}
			}
		}
	}
	fclose( fp )

	if( g_iCost[Furien] || g_iCost[AntiFurien] )
	{
		furien_register_item(szFurienName, g_iCost[Furien], szAntiName, g_iCost[AntiFurien], "furien_buy_superknife")	

		RegisterHam(Ham_Killed, "player", "Ham_CBasePlayer_Killed_Post", true)
		RegisterHam(Ham_TakeDamage, "player", "CBasePlayer_TakeDamage", false)
		RegisterHam(Ham_Item_Deploy, "weapon_knife", "CKnife_Deploy", true)

		g_iMaxPlayers = get_maxplayers()
	}
}

public client_putinserver(id)
{
	RemoveUserSuperKnife(id)
}

public furien_buy_superknife( id )
{
	new iTeam = furien_get_user_team(id)
	if( iTeam == -1 )
	{
		return ShopCloseMenu
	}

	new iItemCost = g_iCost[iTeam]
	if( iItemCost <= 0 )
	{
		return ShopTeamNotAvail
	}

	if( ~HasUserSuperKnife(id) )
	{
		if( furien_try_buy_with_credits(id, iCost) )
		{
			SetUserSuperKnife(id)
			if( get_user_weapon(id) == CSW_KNIFE )
			{
				ExecuteHamB(Ham_Item_Deploy, get_pdata_cbase(id, m_pActiveItem, XO_PLAYER))
			}
			return ShopBought
		}
		else
		{
			return ShopNotEnoughMoney
		}
	}
	return ShopAlreadyHaveOne
}

public CKnife_Deploy( iKnife )
{
	new id = get_pdata_cbase(iKnife, m_pPlayer, XO_WEAPON)

	if( HasUserSuperKnife(id) )
	{
		set_pev(id, pev_viewmodel, g_iszSuperKnifeModel)
	}
}

public CBasePlayer_TakeDamage(id, iInflictor, iAttacker, Float:flDamage, bitsDamageType)
{
	if( IsPlayer(iInflictor) && HasUserSuperKnife(iAttacker) && get_user_weapon(iAttacker) == CSW_KNIFE )
	{
		SetHamParamFloat( 4, flDamage * g_flSuperKnifeDamageFactor )
	}
}

public Ham_CBasePlayer_Killed_Post(id)
{
	RemoveUserSuperKnife(id)
}

public furien_team_change( /*iFurien */ )
{
	if( !g_iCost[Furien] || !g_iCost[AntiFurien] )
	{
		new iPlayers[32], iNum, id
		get_players(iPlayers, iNum, "a")
		for(new i; i<iNum; i++)
		{
			id = iPlayers
			if( HasUserSuperKnife(id) )
			{
				RemoveUserSuperKnife(id)
				if( get_user_weapon(id) == CSW_KNIFE )
				{
					ExecuteHamB(Ham_Item_Deploy, get_pdata_cbase(id, m_pActiveItem, XO_PLAYER))
				}
			}
		}
		g_bHasSuperKnife = 0
	}
}

public furien_round_restart()
{
	g_bHasSuperKnife = 0
}


Si furien_shop.inc

| Afiseaza codul
#if defined _furien_shop
	#endinput
#endif
#define _furien_shop

#pragma reqlib furien_shop

#include <cstrike>

native fcs_set_user_credits(index, iNewCredits)
native fcs_get_user_credits(index)

enum _:ShopReturns {
	ShopBought,
	ShopTeamNotAvail,
	ShopAlreadyHaveOne,
	ShopCantCarryAnymore,
	ShopNotEnoughMoney,
	ShopCannotBuyThis,
	ShopShowMenuAgain,
	ShopCloseMenu
}

native furien_register_item(szFurienName[32], iFurienCost=0, szAntiName[32], iAntiCost=0, szCallBack[32] = "furien_buy_item", iExtra = 0);

stock furien_try_buy(id, iCost)
{
	new iNewMoney = cs_get_user_money(id) - iCost;

	if( iNewMoney < 0 )
	{
		return 0;
	}

	cs_set_user_money(id, iNewMoney, 1);
	
	return 1;
}
stock furien_try_buy_with_credits(id, iCost)
{
	new iNewCredits = fcs_get_user_credits(id) - iCost;

	if( iNewCredits < 0 )
	{
		return 0;
	}

	fcs_set_user_credits(id, iNewCredits);
	
	return 1;
}


P.S : Furien_shop.inc a fost modificat de mine :)) de aia trb sa il iei iar .
P.S2 : Mai lasa double post ca poate iei Ban :))




costu cum pun scriu 1 crefite?


Daca vrei 10 credite (exemplu) scrii acolo la Cost (in sa.ini) 10 [FURIEN_COST "10"] - si va costa 10 credite :)
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 6 guests