[22:48:50] [debug] Run time error 4: "Array index out of bounds" [22:48:50] [debug] Attempted to read/write array element at index 65535 in array of size 1000 [22:48:50] [debug] AMX backtrace: [22:48:50] [debug] #0 0000a98c in public OnPlayerDeath (0, 65535, 255) from apoc-rp.amx
forward OnPlayerDeath(playerid, killerid, reason); public OnPlayerDeath(playerid, killerid, reason) { if(IsPlayerConnected(playerid)) { ZombieTeam(playerid); if(killerid != INVALID_PLAYER_ID) { pInfo[playerid][Kills]++; } } if(pInfo[killerid][Human] == 1) { if(pInfo[playerid][Human] == 1) { new str[100]; format(str, sizeof(str),"[LOG]: %s has been killed by %s",GetName(playerid), GetName(killerid)); ResetPlayerWeapons(playerid); SendAdminsMessage(1, -1, str); ZombieTeam(playerid); printf("[LOG]: %s has been killed by %s",GetName(playerid), GetName(killerid)); } else if(pInfo[playerid][Zombie] == 1) { pInfo[killerid][Tokens] += 250; } } return 1; }
if(pInfo[killerid][Human] == 1)
Check if the killer ID isn't an INVALID_PLAYER_ID at this part:
Код:
if(pInfo[killerid][Human] == 1) |
public OnPlayerDeath(playerid, killerid, reason) { if(IsPlayerConnected(killerid) && killerid != INVALID_PLAYER_ID) { ZombieTeam(playerid); pInfo[killerid][Kills]++; if(pInfo[killerid][Human] == 1) { if(pInfo[playerid][Human] == 1) { new str[100]; format(str, sizeof(str),"[LOG]: %s has been killed by %s",GetName(playerid), GetName(killerid)); ResetPlayerWeapons(playerid); SendAdminsMessage(1, -1, str); ZombieTeam(playerid); printf("[LOG]: %s has been killed by %s",GetName(playerid), GetName(killerid)); } else if(pInfo[playerid][Zombie] == 1) { pInfo[killerid][Tokens] += 250; } } } return 1; }