20.10.2009, 17:33
Код:
new ConnectNPC; public OnFilterScriptInit() { print("scriptfiles"); ConnectNPC("Taxi","TAXI"); return 1; } new MyFirstNPCVehicle; //Global variable! publicOnFilterScriptInit() { print("BlaBla"); ConnectNPC("Taxi","TAXI"); MyFirstNPCVehicle = CreateVehicle(420,1536.6427,-841.7883,64.4755,266.3878,6,1, 5000); 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, "TAXI", true)) //Checking if the NPC's name is MyFirstNPC { PutPlayerInVehicle(playerid, MyFirstNPCVehicle, 0); //Putting the NPC into the vehicle we created for it. } return 1; } //Other stuff for normal players goes here! return 1; }