25.01.2019, 20:33
Quote:
Yeah I see what you mean I guess I overlooked this line.
Код:
if(e_cops[k][copid] != npcid) continue; All you need to do is create a reference array. Код:
g_CopReferences[MAX_PLAYERS] = { -1, ... }; Код:
e_cops[i][copid] = FCNPC_Create(name); g_CopReferences[e_cops[i][copid]] = i; Old way Код:
for(new i = 0; i < MAX_COPS; i++) { if(!IsCopValid(i) || e_cops[i][copid] != npcid) continue; CallLocalFunction("OnCopDeath", "iii", i, killerid, reason); } New way Код:
// Yes this is a cop! if(g_CopReferences[npcid] != -1) CallLocalFunction("OnCopDeath", "iii", g_CopReferences[npcid], killerid, reason); |