i know how to do... Iam just busy making one server now x)
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fun>
#include <fakemeta>
#include <hamsandwich>
#include "furien.inc"
#include "furien_shop.inc"
#define VERSION "Jhob94"
#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_bHasGoldDeagle
#define SetUserGoldDeagle(%1) g_bHasGoldDeagle |= 1<<(%1&31)
#define RemoveUserGoldDeagle(%1) g_bHasGoldDeagle &= ~(1<<(%1&31))
#define HasUserGoldDeagle(%1) g_bHasGoldDeagle & 1<<(%1&31)
new g_iszGoldDeagleModel
new Float:g_flGoldDeagleDamageFactor
new g_iCost[2]
public plugin_precache()
{
register_plugin("Furien Gold Deagle", VERSION, "ConnorMcLeod")
new szConfigFile[128]
get_localinfo("amxx_configsdir", szConfigFile, charsmax(szConfigFile))
format(szConfigFile, charsmax(szConfigFile), "%s/furien/items/gold_deagle.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, "GDEAGLE_MODEL" ) )
{
precache_model(szValue)
g_iszGoldDeagleModel = engfunc(EngFunc_AllocString, szValue)
}
}
case 'D':
{
if( equal(szKey, "GDEAGLE_DAMAGE" ) )
{
g_flGoldDeagleDamageFactor = 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_gold_deagle")
RegisterHam(Ham_Killed, "player", "Ham_CBasePlayer_Killed_Post", true)
RegisterHam(Ham_TakeDamage, "player", "CBasePlayer_TakeDamage", false)
RegisterHam(Ham_Item_Deploy, "weapon_deagle", "GDeagle_Deploy", true)
g_iMaxPlayers = get_maxplayers()
}
}
public client_putinserver(id)
{
RemoveUserGoldDeagle(id)
}
public furien_buy_gold_deagle( id )
{
new iTeam = furien_get_user_team(id)
if( iTeam == -1 )
{
return ShopCloseMenu
}
new iItemCost = g_iCost[iTeam]
if( iItemCost <= 0 )
{
return ShopTeamNotAvail
}
if( ~HasUserGoldDeagle(id) )
{
if( furien_try_buy(id, iItemCost) )
{
SetUserGoldDeagle(id)
give_item(id, "weapon_deagle")
cs_set_user_bpammo(id, CSW_DEAGLE, 35)
if(get_user_weapon(id) == CSW_DEAGLE)
{
set_pev(id, pev_viewmodel2, g_iszGoldDeagleModel)
}
return ShopBought
}
else
{
return ShopNotEnoughMoney
}
}
return ShopAlreadyHaveOne
}
public GDeagle_Deploy( iKnife )
{
new id = get_pdata_cbase(iKnife, m_pPlayer, XO_WEAPON)
if( HasUserGoldDeagle(id) )
{
set_pev(id, pev_viewmodel, g_iszGoldDeagleModel)
}
}
public CBasePlayer_TakeDamage(id, iInflictor, iAttacker, Float:flDamage, bitsDamageType)
{
if( IsPlayer(iInflictor) && HasUserGoldDeagle(iAttacker) && get_user_weapon(iAttacker) == CSW_KNIFE )
{
SetHamParamFloat( 4, flDamage * g_flGoldDeagleDamageFactor )
}
}
public Ham_CBasePlayer_Killed_Post(id)
{
RemoveUserGoldDeagle(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[i]
if( HasUserGoldDeagle(id) )
{
RemoveUserGoldDeagle(id)
if( get_user_weapon(id) == CSW_DEAGLE )
{
ExecuteHamB(Ham_Item_Deploy, get_pdata_cbase(id, m_pActiveItem, XO_PLAYER))
}
}
}
g_bHasGoldDeagle = 0
}
}
public furien_round_restart()
{
g_bHasGoldDeagle = 0
}