24.11.2018, 02:05
you only placed the repair vehicle code on when player press '2' and when player press tab, you set the code to show the msg only.
you can try this
you can try this
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if(PRESSED(KEY_SUBMISSION)) { new vehicleid = GetPlayerVehicleID(playerid); if(IsPlayerInVehicle(playerid, vehicleid)) { SetVehicleHealth(vehicleid,1000.0); RepairVehicle(GetPlayerVehicleID(playerid)); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,-1,"Car fixed!"); } } if(PRESSED(KEY_ACTION)) { new vehicleid = GetPlayerVehicleID(playerid); if(IsPlayerInVehicle(playerid, vehicleid)) { SetVehicleHealth(vehicleid,1000.0); RepairVehicle(GetPlayerVehicleID(playerid)); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,-1,"Car fixed!"); } } }