PDA

View Full Version : No errors but it doesn't work


Dragonic
11/07/2017, 06:34 PM
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.

Meller
11/07/2017, 06:44 PM
new vehicleid = GetPlayerVehicleId(playerid);
if(vehicleid != 0)
SetVehicleToRespawn(vehicleid);


/THIS IS NOT A FIX, this is a recommendation only/

coool
11/07/2017, 06:46 PM
Try removing the player from vehicle before setting to respawn.