Nie jestem pewny ale znalazłem takie coś:
[Remove Weapons]
Purpose: Remove the weapon listed in game_player_equip entity, (since this will be the most dropped).
Comment: Thanks to BAILOPAN on this safe weapon removal method.
====================================================================================================*/
public Event_DeathMsg()
{
if(g_bIsSurf) {
new player = read_data(2)
if(player) {
new wps[32], num, i, Drop[1]
get_user_weapons(player, wps, num) //catch every dropped weapon!
for (i=0; i<num; i++) {
Drop[0] = wps[i]
set_task(0.2,"remove_weapon", 0, Drop, 1)
}
}
}
}
public remove_weapon(data[])
{
new wp = data[0]
new weapbox, model[64], left[32], right[32]
while((weapbox = find_ent_by_class(weapbox,"weaponbox")) != 0)
{
entity_get_string(weapbox,EV_SZ_model,model,63)
for(new x = 0; x < g_TotalWeap ; x++)
{
strtok(g_StartWeap[x], left, 31, right, 32, '_')
if( containi(model, right) != -1 )
remove_weapon_final(wp, weapbox)
}
}
}
remove_weapon_final(wp, weapbox) {
new wEnt, wfEnt, name[24]
new woEnt
remove_entity(weapbox)
get_weaponname(wp, name, 24)
wEnt = find_ent_by_class(-1, name)
while (wEnt > 0) {
wfEnt = find_ent_by_class(wEnt, name)
woEnt = entity_get_edict(wEnt, EV_ENT_owner)
if (woEnt > 32 && woEnt == weapbox)
remove_entity(wEnt)
wEnt = wfEnt
}
}
Może to jest odpowiedzialne za upuszczanie broni?