Vehicle Freeze - 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: Vehicle Freeze (
/showthread.php?tid=654937)
Vehicle Freeze -
Mo123 - 09.06.2018
Is there a quicker way to stop a vehicle?
This is what I've got atm:
Код:
public OnPlayerEnterCheckpoint(playerid)
{
if(pcheckpointTrucker[playerid] == 1)
{
new i;
DisablePlayerCheckpoint(playerid);
GetVehicleParamsEx(GetPlayerVehicleID(i), engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(GetPlayerVehicleID(i), 0, lights, alarm, doors, bonnet, boot, objective);
SendClientMessage(playerid, COLOR_LIGHTGREEN, "Unload the crate and store it inside the garage.");
}
}
Re: Vehicle Freeze -
Lokii - 09.06.2018
Get vehicle's pos and set it
PHP код:
new Float:x, Float:y, Float:z;
GetVehiclePos(vehicleid, x, y, z);
SetVehiclePos(vehicleid, x, y, z);
also why did you do this: ?
PHP код:
new i; //sets to 0 (you'r not looping it) and theres no need for loop
GetVehicleParamsEx(GetPlayerVehicleID(i), engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(GetPlayerVehicleID(i), 0, lights, alarm, doors, bonnet, boot, objective);
that will allways set player id 0 vehicle params
you should do this:
PHP код:
GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(GetPlayerVehicleID(playerid), 0, lights, alarm, doors, bonnet, boot, objective);
Re: Vehicle Freeze -
Dayrion - 09.06.2018
The best to do is set the vehicle's velocity to zero frequently.
Re: Vehicle Freeze -
CodeStyle175 - 09.06.2018
shutting down players vehicle isnt doesnt even stop vehicle.
just use setvehiclepos because it zeros players vehicle speed