21.12.2010, 18:39
i made a carfix command and i wanna know how to make it only work if vehicle is stopped but how? i cant find it
new Float:Velocity[3]; GetVehicleVelocity(GetPlayerVehicleID(playerid), Velocity[0], Velocity[1], Velocity[2]); if(Velocity[0] != 0 || Velocity[1] != 0 || Velocity[2] != 0) return SendClientMessage(playerid,0xffffffaa,"Your car needs to be stationary in order to use this command");
if(!strcmp(cmdtext,"/repair",true,7)) { if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0xffffffaa,"You need to be in a vehicle"); new Float:Velocity[3]; GetVehicleVelocity(GetPlayerVehicleID(playerid), Velocity[0], Velocity[1], Velocity[2]); if(Velocity[0] != 0 || Velocity[1] != 0 || Velocity[2] != 0) return SendClientMessage(playerid,0xffffffaa,"Your car needs to be stationary in order to use this command"); RepairVehicle(GetPlayerVehicleID(playerid)); SendClientMessage(playerid,0xffffffaa,"Vehicle Repaired"); return 1; }