SA-MP Forums Archive
[REQ] Slower Bike Code - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [REQ] Slower Bike Code (/showthread.php?tid=128961)



[REQ] Slower Bike Code - addinol - 20.02.2010

Is it possible to make bike slower? because it's so fast ;/


Re: [REQ] Slower Bike Code - bajskorv123 - 20.02.2010

Use this:

SetVehicleVelocity(vehicleid, Float, Float:y, Float:z);
vehicleid - The ID of the vehicle to set the velocity of.
Float - The amount of velocity in the X direction.
Float:y - The amount of velocity in the Y direction .
Float:z - The amount of velocity in the Z direction.


Re: [REQ] Slower Bike Code - addinol - 20.02.2010

Where could i get the default float numbers? because i don't know what is their defaults.


Re: [REQ] Slower Bike Code - bajskorv123 - 20.02.2010

new Float:X, Float:Y, Float:Z;
GetVehicleVelocity(vehicleid, X, Y, Z);
SetVehicleVelocity(vehicleid, X, Y, Z);//Here you can add defaults like X+5 and Z+2 or something...


Re: [REQ] Slower Bike Code - addinol - 20.02.2010

how could add more than 1 vehicleid ?
GetVehicleVelocity(509 || 510 || 481, X, Y, Z); ??


Re: [REQ] Slower Bike Code - Fedee! - 20.02.2010

Quote:
Originally Posted by addinol
how could add more than 1 vehicleid ?
GetVehicleVelocity(509 || 510 || 481, X, Y, Z); ??
Your mistake.. Vehicle ID is NOT Model ID...

I guess you are putting models id..


Re: [REQ] Slower Bike Code - addinol - 20.02.2010

so what's VehicleID ? :[


Re: [REQ] Slower Bike Code - ShortyDmG - 20.02.2010

Quote:
Originally Posted by addinol
so what's VehicleID ? :[
vehicle id is the designed id for a certain car.For example Vehicle ID: 400 stands for Landstalker.


Re: [REQ] Slower Bike Code - Daren_Jacobson - 20.02.2010

Quote:
Originally Posted by ShortyDmG
Quote:
Originally Posted by addinol
so what's VehicleID ? :[
vehicle id is the designed id for a certain car.For example Vehicle ID: 400 stands for Landstalker.
NO that is ModelID. VehicleID is the handle ID given when a car is created (GetPlayerVehicleID(playerid)). And also do NOT use + or - in Velocities, because that just means north or south, not forward or backwards

pawn Код:
public OnPlayerUpdate(playerid)
{
if (IsPlayerInAnyVehicle(playerid)) // This goes for EVERY vehicle.
{
new id, Float:vX, Float:vY, Float:vZ;
id = GetPlayerVehicleID(playerid);
GetVehicleVelocity(id, vX, vY, vZ);
SetVehicleVelocity(id, vX * 0.9, vY * 0.9, vZ * 0.9);
}
return 1;
}



Re: [REQ] Slower Bike Code - addinol - 20.02.2010

Sorry, i need only for bike. ;[