08.11.2013, 11:56
What can I do for not spawn Vehicle npc ![Sad](images/smilies/sad.gif)
![](http://www.uploadax.com/images/25522424166004825952.png)
[/PHP]
![Sad](images/smilies/sad.gif)
![](http://www.uploadax.com/images/25522424166004825952.png)
PHP код:
[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;
}