PutPlayerInVehicle does nothing - 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: PutPlayerInVehicle does nothing (
/showthread.php?tid=592660)
PutPlayerInVehicle does nothing -
Msk. - 28.10.2015
Код:
if(IsValidVehicle(Player[playerid][rCar])) { DestroyVehicle(Player[playerid][rCar]); }
Pozycja = Misja[PozycjaPoStarcie];
Player[playerid][rCar] = CreateVehicle(Misja[Vehicle], Misja[Startx][Pozycja], Misja[Starty][Pozycja], Misja[Startz][Pozycja], playerid, playerid, 0,-1, 1);
printf("Car: %d. X: %f Y: %f Z: %f",Player[playerid][rCar],Misja[Startx][Pozycja], Misja[Starty][Pozycja], Misja[Startz][Pozycja]);
SetPlayerPos(playerid,Misja[Startx][Pozycja], Misja[Starty][Pozycja], Misja[Startz][Pozycja]);
new test = PutPlayerInVehicle(playerid,Player[playerid][rCar],0);
printf("test: %d",test);
This code is under OnPlayerSpawn.
The first time i spawn it's working perfectly it's creating the car and putting me in.
But after that when i kill myself and spawn again the car is being created but it's not putting me in it
// i solved this with a timer