Re: 2 FMprethink
the problem is, i wont to strip users on spawn. this works but the main plugin dont work... :)) haha
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx> #include <fakemeta> #include <hamsandwich>
#define PLUGIN "New Plug-In" #define VERSION "1.0" #define AUTHOR "author"
new g_iFhKeyValue public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) unregister_forward(FM_KeyValue, g_iFhKeyValue) set_cvar_float("sv_restart", 1.0)
pause("ad") }
public plugin_precache() { new iEnt
iEnt = engfunc( EngFunc_CreateNamedEntity, engfunc( EngFunc_AllocString , "player_weaponstrip" ) ) SetKeyValue(iEnt, "origin", "9999 9999 9999", "player_weaponstrip") SetKeyValue(iEnt, "targetname", "stripper", "player_weaponstrip") dllfunc(DLLFunc_Spawn, iEnt)
iEnt = engfunc( EngFunc_CreateNamedEntity, engfunc( EngFunc_AllocString , "game_player_equip" ) ) SetKeyValue(iEnt, "weapon_knife", "1", "game_player_equip") SetKeyValue(iEnt, "weapon_deagle", "1", "game_player_equip") SetKeyValue(iEnt, "ammo_50ae", "5", "game_player_equip") SetKeyValue(iEnt, "weapon_m3", "1", "game_player_equip") SetKeyValue(iEnt, "ammo_buckshot", "4", "game_player_equip") SetKeyValue(iEnt, "targetname", "equipment", "game_player_equip") dllfunc(DLLFunc_Spawn, iEnt)
iEnt = engfunc( EngFunc_CreateNamedEntity, engfunc( EngFunc_AllocString , "multi_manager" ) ) SetKeyValue(iEnt, "stripper", "0", "multi_manager") SetKeyValue(iEnt, "equipment", "1", "multi_manager") SetKeyValue(iEnt, "targetname", "game_playerspawn", "multi_manager") SetKeyValue(iEnt, "spawnflags", "1", "multi_manager") dllfunc(DLLFunc_Spawn, iEnt)
iEnt = engfunc( EngFunc_CreateNamedEntity, engfunc( EngFunc_AllocString , "info_map_parameters" ) ) SetKeyValue(iEnt, "buying", "3", "info_map_parameters") dllfunc(DLLFunc_Spawn, iEnt)
g_iFhKeyValue = register_forward(FM_KeyValue, "KeyValue") }
SetKeyValue(iEnt, const szKey[], const szValue[], const szClassName[]) { set_kvd(0, KV_ClassName, szClassName) set_kvd(0, KV_KeyName, szKey) set_kvd(0, KV_Value, szValue) set_kvd(0, KV_fHandled, 0) dllfunc(DLLFunc_KeyValue, iEnt, 0) }
public KeyValue(iEnt, kvd_handle) { if( pev_valid(iEnt) ) { static szClassName[20] get_kvd(kvd_handle, KV_ClassName, szClassName, charsmax(szClassName)) if( equal(szClassName, "game_player_equip") || equal(szClassName, "info_map_parameters") || equal(szClassName, "player_weaponstrip") ) { engfunc( EngFunc_RemoveEntity, iEnt ) return FMRES_SUPERCEDE } } return FMRES_IGNORED }
|