12.05.2009, 12:02
Code:
new warplane[MAX_PLAYERS]; forward AutoRepair(playerid);
Code:
public OnPlayerConnect(playerid) SetTimerEx("AutoRepair",100,true,"d",playerid); warplane[playerid] = 0;
Code:
public OnPlayerEnterVehicle(playerid) { new vehid; vehid = GetPlayerVehicleID(playerid); switch(vehid) { case 425: {warplane[playerid] = 1;} case 520: {warplane[playerid] = 1;} case 447: {warplane[playerid] = 1;} case 476: {warplane[playerid] = 1;} default:{warplane[playerid] = 0;} } return 0; } //-------------------------------------------------------- public AutoRepair(playerid) { if (IsPlayerInAnyVehicle(playerid)) { if(warplane[playerid] == 0) { new Float:health; new vehicleid = GetPlayerVehicleID(playerid); GetVehicleHealth(vehicleid, health); if (health <= 300) { SetVehicleHealth(vehicleid,1000); GameTextForPlayer(playerid,"~g~Car Auto-Repaired!",5000,5); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); } } } }