30.11.2012, 19:34
pawn Код:
if(IsPlayerNPC(playerid))
{
new npcname[MAX_PLAYER_NAME];
GetPlayerName(playerid, npcname, sizeof(npcname));
if(!strcmp(npcname, "Bus_Driver", true))
{
printf("npc spawned");
PutPlayerInVehicle(playerid, BusDriverVehicle, 0);
}
if(!strcmp(npcname, "Bus_Driver2", true))
{
printf("npc spawned");
PutPlayerInVehicle(playerid, BusDriverVehicle2, 0);
return 1;
}
return 1;
}
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
if(IsPlayerNPC(playerid))
{
new npcname[MAX_PLAYER_NAME];
GetPlayerName(playerid, npcname, sizeof(npcname));
if(!strcmp(npcname, "Bus_Driver", true))
{
printf("npc crashed");
}
if(!strcmp(npcname, "Bus_Driver2", true))
{
printf("npc crashed");
}
return 1;
}
}