31.01.2013, 14:47
Hey guys, i'm trying to make a command to decrease the speed of vehicle. Like set a Max Speed for a vehicle.
I'm trying to do it whit: GetVehicleVelocity and SetVehicleVelocity, but doesnt works good. The car blows up for the air when i use it xD.
This is my example:
I'm trying to do it whit: GetVehicleVelocity and SetVehicleVelocity, but doesnt works good. The car blows up for the air when i use it xD.
This is my example:
pawn Код:
if(!sscanf(params,"s[30]U(-1)D(-1)D(-1)",opc,jid,slot,precio))
{
if(!strcmp(opc,"velocidad",true))
{
new idcoche = GetPlayerVehicleID(playerid);
if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new Float:Velocity[3];
GetVehicleVelocity(idcoche, Velocity[0], Velocity[1], Velocity[2]);
SetVehicleVelocity(idcoche, Velocity[0]-0.1, Velocity[1]-0.1, Velocity[2]-0.1);
}
else Mensaje(playerid,color_msgsv,"Error: {FFFFFF}Tienes que ser el conductor para ajustar la velocidad.");
}