if(IsPlayerNPC(playerid)) { new npcname[MAX_PLAYER_NAME]; GetPlayerName(playerid, npcname, sizeof(npcname)); if(!strcmp(npcname, "Bus_Driver", true)) { PutPlayerInVehicle(playerid, MyFirstNPCVehicle, 431); } return 1; } if(IsPlayerNPC(playerid)) { new npcname[MAX_PLAYER_NAME]; GetPlayerName(playerid, npcname, sizeof(npcname)); if(!strcmp(npcname, "Crazy_Train_Driver", true)) { PutPlayerInVehicle(playerid, MyFirstNPCVehicle, 538); } return 1; } if(IsPlayerNPC(playerid)) { new npcname[MAX_PLAYER_NAME]; GetPlayerName(playerid, npcname, sizeof(npcname)); if(!strcmp(npcname, "Busdriver", true)) { PutPlayerInVehicle(playerid, NPCBus, 0); SetPlayerSkin(playerid, 255); ResetPlayerWeapons(playerid); } return 1; } if(IsPlayerNPC(playerid)) { new npcname[MAX_PLAYER_NAME]; GetPlayerName(playerid, npcname, sizeof(npcname)); if(!strcmp(npcname, "Helicopter", true)) { PutPlayerInVehicle(playerid, MyFirstNPCVehicle, 425); } return 1; }
If your server has a login, put if(IsPlayerNPC(playerid)) return 1; before it makes the NPC login, Also put that in OnPlayerConnect OnPlayerRequestSpawn and OnPlayerRequestClass to be safe and then it should work.
|