PHP Code:
register_logevent("RSZ",2,"1=Round_Start")
public remove_bomb()
{
new g_MaxClients = get_maxplayers ();
for ( new i = 1; i <= g_MaxClients; ++i )
{
engclient_cmd(i, "drop", "weapon_c4")
}
new weapbox, bomb = fm_find_ent_by_class(-1, "weapon_c4")
if (bomb && (weapbox = pev(bomb, pev_owner)) > get_maxplayers()) {
(187) dllfunc(DLLFunc_Think, weapbox) // will remove weaponbox + weapon_c4 entity pair
// remove blinking red bomb mark on the radar
message_begin(MSG_ALL, get_user_msgid("BombPickup"))
message_end()
}
}
public RSZ()
{
if (get_cvar_num("respawn") == 1)
{
(197) remove_bomb()
new players[32], pnum
get_players(players, pnum);
for( new i; i<pnum; i++ )
{
give_item(players[i],"weapon_m4a1")
give_item(players[i],"weapon_awp")
give_item(players[i],"weapon_m4a1")
give_item(players[i],"weapon_ak47")
give_item(players[i],"weapon_deagle")
give_item(players[i],"weapon_flashbang")
give_item(players[i],"weapon_flashbang")
give_item(players[i],"weapon_flashbang")
give_item(players[i],"weapon_flashbang")
give_item(players[i],"weapon_hegrenade")
give_item(players[i],"weapon_smokegrenade")
give_item(players[i],"item_kevlar")
give_item(players[i],"ammo_338magnum")
give_item(players[i],"ammo_556nato")
give_item(players[i],"ammo_762nato")
give_item(players[i],"ammo_50ae")
give_item(players[i],"ammo_338magnum")
give_item(players[i],"ammo_556nato")
give_item(players[i],"ammo_762nato")
give_item(players[i],"ammo_50ae")
give_item(players[i],"ammo_338magnum")
give_item(players[i],"ammo_556nato")
give_item(players[i],"ammo_762nato")
give_item(players[i],"ammo_50ae")
give_item(players[i],"ammo_45acp")
give_item(players[i],"ammo_45acp")
give_item(players[i],"ammo_45acp")
give_item(players[i],"ammo_45acp")
give_item(players[i],"ammo_9mm")
give_item(players[i],"ammo_9mm")
give_item(players[i],"ammo_9mm")
give_item(players[i],"ammo_9mm")
set_user_health (players[i],500)
AmmoMaster[players[i]]=true
}
}
return PLUGIN_CONTINUE
}
I Have this code, but it has a problem, Sometimes is working and sometimes is not:
Code:
L 12/25/2009 - 02:20:11: [FAKEMETA] Invalid entity
L 12/25/2009 - 02:20:11: [AMXX] Displaying debug trace (plugin "gather.amxx")
L 12/25/2009 - 02:20:11: [AMXX] Run time error 10: native error (native "dllfunc")
L 12/25/2009 - 02:20:11: [AMXX] [0] Gather.sma::remove_bomb (line 187)
L 12/25/2009 - 02:20:11: [AMXX] [1] Gather.sma::RSZ (line 197)
__________________
function rb return $regsubex($$1-,/(.)/g,$+($chr(2) $+ $chr(3),$r(2,15),$chr(2),\1))