18.07.2018, 23:02
Hi buddy! Try this code!
Make this defines top of your script..
Then change your old code to this new code.
Make this defines top of your script..
Код:
#if defined _ALS_OnPlayerSpawn #undef OnPlayerSpawn #else #define _ALS_OnPlayerSpawn #endif #define OnPlayerSpawn RNPC_OnPlayerSpawn forward RNPC_OnPlayerSpawn(playerid);
PHP код:
public OnPlayerSpawn(playerid)
{
if (IsPlayerNPC(playerid)) {
// Find the array index of the npc
new slot = -1;
for (new i = 0; i < MAX_RNPC_POLICE; i++) {
if (rpol[i][RPOL_NPCID] == playerid) {
slot = i;
break;
}
}
// If playerid is a policeman
if (slot > -1) {
SetPlayerSkin(playerid, rpol[slot][RPOL_SKIN]);
}
}
CallLocalFunction("RNPC_OnPlayerSpawn", "i", playerid);
return 1;
}