How can I make that LSPD cruiser will be faster? - 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: How can I make that LSPD cruiser will be faster? (
/showthread.php?tid=518968)
How can I make that LSPD cruiser will be faster? -
dimitri8 - 12.06.2014
How can I make that LSPD cruiser will be faster? by one key clicking like "shift" or something, I want it a bit more faster like Infernus or Turismo... I am sorry but I dont know how to start or if there is anyfilterscript on the forums has it cause I dont know the name of it.
Re: How can I make that LSPD cruiser will be faster? -
Cutt3r - 12.06.2014
You should use SetVehicleVelocity.
See
https://sampwiki.blast.hk/wiki/SetVehicleVelocity for more information and how to use it.
Re: How can I make that LSPD cruiser will be faster? -
iZN - 12.06.2014
pawn Код:
// after includes ?
new Float:vSPEED = 2.0;
// OnPlayerKeyStateChange
new vID = GetPlayerVehicleID(playerid),
vModel = GetVehicleModel(vID);
if(newkeys & KEY_JUMP && !(oldkeys & KEY_JUMP) && vModel == MODEL_ID_HERE) // add vehicle model ID here
{
static Float:POS_X, Float:POS_Y, Float:POS_Z;
GetVehicleVelocity(vID, POS_X, POS_Y, POS_Z);
if(POS_X < 2.0 && POS_Y < 2.0 && POS_Z < 1.3)
{
SetVehicleVelocity(vID, floatmul(POS_X, vSPEED), floatmul(POS_Y, vSPEED), floatmul(POS_Z, vSPEED));
}
}
Re: How can I make that LSPD cruiser will be faster? -
dimitri8 - 12.06.2014
Quote:
Originally Posted by iZN
pawn Код:
// after includes ? new Float:vSPEED = 2.0;
// OnPlayerKeyStateChange new vID = GetPlayerVehicleID(playerid), vModel = GetVehicleModel(vID);
if(newkeys & KEY_JUMP && !(oldkeys & KEY_JUMP) && vModel == MODEL_ID_HERE) // add vehicle model ID here { static Float:POS_X, Float:POS_Y, Float:POS_Z;
GetVehicleVelocity(vID, POS_X, POS_Y, POS_Z); if(POS_X < 2.0 && POS_Y < 2.0 && POS_Z < 1.3) { SetVehicleVelocity(vID, floatmul(POS_X, vSPEED), floatmul(POS_Y, vSPEED), floatmul(POS_Z, vSPEED)); } }
|
Wow thank you very much, two questions:
Where should I place it into the script and how do you define the speed? I mean, how do you define the new Cruiser Speed will be exactly like Infernus?
Re : How can I make that LSPD cruiser will be faster? -
mirou123 - 12.06.2014
Place that under OnPlayerKeyStateChange and try changing that vSPEED till you reach the desired speed.