08.01.2015, 20:52
In the GameMode. Not in the NPCs.
GAMEMODE:
GAMEMODE:
Code:
public OnPlayerRequestClass(playerid, classid) { if(IsPlayerNPC(playerid)) return 1; SetupPlayerForClassSelection(playerid, classid); return 1; } OnPlayerConnect: if(IsPlayerNPC(playerid)) return 1; public OnPlayerSpawn(playerid) { if(IsPlayerNPC(playerid)) //Checks if the player that just spawned is an NPC. { new npcname[MAX_PLAYER_NAME]; GetPlayerName(playerid, npcname, sizeof(npcname)); //Getting the NPC's name. if(!strcmp(npcname, "PoliceAndChatBotByte", true)) //Checking if the NPC's name is MyFirstNPC { SetPlayerColor(playerid,YELLOW); PutPlayerInVehicle(playerid, PoliceAndChatBotByteVehicle, 0); //Putting the NPC into the vehicle we created for it. return 1; } if(!strcmp(npcname, "WorldBus", true)) { SetPlayerColor(playerid,YELLOW); PutPlayerInVehicle(playerid, WorldBusVehicle, 0); return 1; } return 1; } ..... OnGameModeInit: ConnectNPC("PoliceAndChatBotByte","sfpdpolice"); PoliceAndChatBotByteVehicle = CreateVehicle(597, 0.0, 0.0, 5.0, 0.0, 0, 1, 5000); ConnectNPC("WorldBus","busdriver"); WorldBusVehicle = CreateVehicle(431, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000);