[FUN] Invalid player 1
[AMXX] Displaying debug trace (plugin "tourmaps.amxx", version "0.5")
[AMXX] Run time error 10: native error (native "strip_user_weapons")
[0] tourmaps.sma::strip (line 456)
PHP Code:
public strip (p[1])
{
strip_user_weapons (p[0]) //line 456
new team = get_user_team (p[0]) - 1
if (team >= 0 && team <2) {
for (new wpi = 0; wpi < g_MapWeaponCount[g_MapsOrder[g_CurrentMapId]][team]; wpi ++) {
new weapon[32]
if(g_MapWeapon[g_CurrentMapId][team][wpi] == CSW_SHIELD)
format(weapon, 31, "weapon_shield")
else
get_weaponname(g_MapWeapon[g_MapsOrder[g_CurrentMapId]][team][wpi],weapon,31)
#if DEBUG == 1
server_print ("weapon %s - %d",weapon,g_MapWeapon[g_MapsOrder[g_CurrentMapId]][team][wpi])
#endif
give_item (p[0],weapon)
give_item (p[0],"item_kevlar")
if (g_MapWeapon[g_MapsOrder[g_CurrentMapId]][team][wpi] != CSW_KNIFE)
cs_set_user_bpammo (p[0],g_MapWeapon[g_MapsOrder[g_CurrentMapId]][team][wpi],g_MapWeaponAmount[g_MapsOrder[g_CurrentMapId]][team][wpi])
}
}
}
Any ideas as how to solve it? I thought about checking if the user is alive but I don't know where to put it best.