[PHP]if(IsPlayerNPC(playerid)) //Checks if the player that just spawned is an NPC.
{
new MyFirstNPCVehicle;
MyFirstNPCVehicle = CreateVehicle(560, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000);
GetPlayerName(playerid, npcname, sizeof(npcname)); //Getting the NPC's name.
if(!strcmp(npcname, "Taxi", true)) //Checking if the NPC's name is MyFirstNPC
{
SetPlayerSkin(playerid, 193);
SetPlayerColor(playerid,COLOR_SEXYGREEN);
label[playerid] = Create3DTextLabel("TAXI",COLOR_SAFID,30.0,40.0,50.0,40.0,0);
Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.4);
PutPlayerInVehicle(playerid, MyFirstNPCVehicle, 0); //Putting the NPC into the vehicle we created for it.
}
MyFirstNPCVehicle = CreateVehicle(487, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000);
GetPlayerName(playerid, npcname, sizeof(npcname)); //Getting the NPC's name.
if(!strcmp(npcname, "Helikopter", true)) //Checking if the NPC's name is MyFirstNPC
{
SetPlayerSkin(playerid, 246);
SetPlayerColor(playerid,COLOR_SEXYGREEN);
label[playerid] = Create3DTextLabel("khalaban",COLOR_SAFID,30.0,40.0,50.0,40.0,0);
Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.1);
PutPlayerInVehicle(playerid, MyFirstNPCVehicle, 0); //Putting the NPC into the vehicle we created for it.
}
return 1;
}
If the NPCs you want to use are recorded with type 'on vehicle', then as long as all of them connect correctly and they enter the vehicles you created, the playback will start playing so those vehicles won't exist there. |