03.07.2011, 19:30
I want to detect if a player rightclicks and then they get a boost/turbo. i do not know how to check if they rightclick i have tried to look through wiki but did not really understand it.
my code:
Thank you
my code:
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (newkeys == 128)
{
new vehid = GetPlayerVehicleID(playerid);
if(IsPlayerInAnyVehicle(playerid))
{
if (turbo == 1)
{
new Float:Velocity[3];
GetVehicleVelocity(vehid, Velocity[0], Velocity[1], Velocity[2]);
if(Velocity[0] < maxspeed && Velocity[1] < maxspeed && Velocity[0] > -maxspeed && Velocity[1] > -maxspeed)
{
SetVehicleVelocity(vehid, Velocity[0]*speed, Velocity[1]*speed, 0.0);
}
}
}
}
return 1;
}