No errors but it doesn't work - 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: No errors but it doesn't work (
/showthread.php?tid=637264)
No errors but it doesn't work -
Dragonic - 11.07.2017
Код:
CMD:inf(playerid)
{
new vehicleid = GetPlayerVehicleID(playerid);
new Float:X,Float:Y,Float:Z,Float:ROT;
if(!IsPlayerInAnyVehicle(playerid)) GetPlayerFacingAngle(playerid,ROT);
if(IsPlayerInAnyVehicle(playerid)) GetVehicleZAngle(vehicleid, ROT);
SetVehicleToRespawn(vehicleid);
GetPlayerPos(playerid,X,Y,Z);
Veh[playerid] = CreateVehicle(411,X,Y,Z,ROT,-1,-1,60);
PutPlayerInVehicle(playerid,Veh[playerid],0);
GameTextForPlayer(playerid,"~y~Infernus",5000,1);
PlayerPlaySound(playerid, 1057, 0, 0, 1);
return 1;
}
The idea is to before creating the vehicle, respawning the one the players already in so you don't create a vehicle under another one. I get no errors but
Код:
new vehicleid = GetPlayerVehicleID(playerid);
SetVehicleToRespawn(vehicleid);
doesn't do anything.
Re: No errors but it doesn't work -
Meller - 11.07.2017
new vehicleid = GetPlayerVehicleId(playerid);
if(vehicleid != 0)
SetVehicleToRespawn(vehicleid);
/THIS IS NOT A FIX, this is a recommendation only/
Re: No errors but it doesn't work -
coool - 11.07.2017
Try removing the player from vehicle before setting to respawn.