PHP код:
public OnPlayerConnect(playerid)
{
if (IsPlayerNPC(playerid)) {
playertarget[playerid] = Create3DTextLabel(" ", 0xFFFFFFFF, 30.0, 40.0, 50.0, 100.0, 0, 1);
Attach3DTextLabelToPlayer(playertarget[playerid], playerid, 0.0, 0.0, 0.2);}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
if (IsPlayerNPC(playerid))
{
new npcname[MAX_PLAYER_NAME];
GetPlayerName(playerid, npcname, sizeof(npcname));
if(!strcmp(npcname, "Officerino", true))// Your npc name here
{
CreateRNPCPolice ("Officerino", rpid[random(2)]);
new rp2 = ConnectRNPC("Officerino");
AddRPOLWaypoint (rp2, 2029.42, 1354.34, 10.5);
AddRPOLWaypoint (rp2, 2033.55, 1286.21, 10.5);
AddRPOLWaypoint (rp2, 2029.42, 1354.34, 10.5);
AddRPOLWaypoint (rp2, 2033.55, 1286.21, 10.5);
SetTimerEx ("Route2", 500, 0, "i", playerid);
}
else if(!strcmp(npcname, "NPC", true))// Your npc name here
{
CreateRNPCPolice ("NPC", rpid[random(2)]);
new pol2 = ConnectRNPC("NPC");
AddRPOLWaypoint (pol2, 2029.42, 1354.34, 10.5);
AddRPOLWaypoint (pol2, 2033.55, 1286.21, 10.5);
AddRPOLWaypoint (pol2, 2029.42, 1354.34, 10.5);
AddRPOLWaypoint (pol2, 2033.55, 1286.21, 10.5);
SetTimerEx ("Route3", 500, 0, "i", playerid);
}
}
return 1;
}