26.02.2011, 11:10
hey at the moment in my gamemode i have a /fix cmd that fixes your car but i want something that when i press 2 on my keyboard it fixes my car

forward AutoFix();
SetTimer("AutoFix", 1000, 1);
public AutoFix() {
for(new playerid=0; playerid<MAX_PLAYERS; playerid++) {
if(IsPlayerConnected(playerid)) {
new Float:health, cid;
if (IsPlayerInAnyVehicle(playerid)) {
cid = GetPlayerVehicleID(playerid);
GetVehicleHealth(cid, health);
if (health < 950) {
RepairVehicle(GetPlayerVehicleID(playerid));
}
}
}
}
return 1;
}