Does the NPC spawn properly? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Does the NPC spawn properly? (
/showthread.php?tid=324468)
Does the NPC spawn properly? -
Padarom - 09.03.2012
Hello everyone,
I wanna play back a record of a taxi ride after the registration, on which the player is put on the passenger seat of the bot's taxi. The NPC's name is [BOT]playerid, in which the playerid is stored in another variable (pID). Everything ongoing (which has to do with the player) is solved with this pID.
My problem is now, that I can register properly, the NPC spawns and I sit in the taxi, that's also driving properly. But as soon as another player registers (and another NPC connects) I get put in his taxi and switch between both of these taxis every few seconds (which is pretty annoying as you may imagine).
pawn Код:
public OnPlayerSpawn(playerid)
{
new pName[24];
GetPlayerName(playerid, pName, 24);
if(IsPlayerNPC(playerid))
{
new pID[3];
strmid(pID, pName, 5, sizeof(pName)+1);
print(pID);
SetPlayerSkin(playerid, 5);
PutPlayerInVehicle(playerid, spawnCarTaxi[strval(pID)], 0);
SetPlayerTime(strval(pID), 02, 10);
SetPlayerWeather(strval(pID), 18);
PutPlayerInVehicle(strval(pID), spawnCarTaxi[strval(pID)], 3);
SetTimerEx("RegTimer", 5000, false, "iii", strval(pID), 1, 1);
}
if(pInfo[playerid][FirstLogin])
{
new bName[24];
format(bName, 24, "[BOT]%i", playerid);
GivePlayerMoney(playerid, 40000);
spawnCarTaxi[playerid] = SetVehicleNumberPlate(CreateVehicle(420,1,1,1,1,6,6,100), "SA/SF-1337");
ConnectNPC(bName, "dynamicREGISTER");
}
return 1;
}
A friend looked over it, but he didn't see any errors in reasoning (nor do I).
So I ask here, if somebody's able to help me.
Regards
Padarom
AW: Does the NPC spawn properly? -
Padarom - 11.03.2012
Can nobody help?