28.04.2016, 16:30
Quote:
Make sure you don't try to show the login/register dialogs to it, and even if it spawned it probably spawned at coodinates 0, 0, 0.
Add something like this: Код:
public OnPlayerConnect(playerid) { if(IsPlayerNPC(playerid)) { SetPlayerPos(playerid, x, y, z); // Replace with the coordinates he should spawn at return 1; } // The rest of your code } |
OnGamemodeInit:
PHP код:
deliveryplane = CreateVehicle(512,-13.0069,-122.7030,2.0356,85.8541,0,0,0);
ConnectNPC("deliveryguy", "delivery");
PHP код:
if(IsPlayerNPC(playerid))
{
SetPlayerPos(playerid, -13.0069,-122.7030,2.0356); // Replace with the coordinates he should spawn at
return 1;
}
// the rest of the login script is here
PHP код:
if(IsPlayerNPC(playerid))
{
new npcname[MAX_PLAYER_NAME];
GetPlayerName(playerid, npcname, sizeof(npcname));
if(!strcmp(npcname, "deliveryguy", true))
{
PutPlayerInVehicle(playerid, deliveryplane, 0);
}
return 1;
}