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 }
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 } |
deliveryplane = CreateVehicle(512,-13.0069,-122.7030,2.0356,85.8541,0,0,0);
ConnectNPC("deliveryguy", "delivery");
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
if(IsPlayerNPC(playerid))
{
new npcname[MAX_PLAYER_NAME];
GetPlayerName(playerid, npcname, sizeof(npcname));
if(!strcmp(npcname, "deliveryguy", true))
{
PutPlayerInVehicle(playerid, deliveryplane, 0);
}
return 1;
}
ConnectNPC("deliveryguy", "delivery");
if (IsPlayerNPC(playerid)) {
new playername[64];
GetPlayerName(playerid,playername,64);
if (!strcmp(playername, "deliveryguy", true)) {
SetSpawnInfo(playerid, NO_CLASS, 1, -13.0069, -122.7030, 2.0356, 0.0, -1, -1, -1, -1, -1, -1);
}
return 1;
}
if (IsPlayerNPC(playerid)) {
new playername[64];
GetPlayerName(playerid,playername,64);
if(!strcmp(playername, "deliveryguy", true)) {
PutPlayerInVehicle(playerid, 1, 0);
SetPlayerColor(playerid, 0xFFFFFFFF);
}
}