Making exceptions for autorepair
#1

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);
	}
	}
  }
}
The vehicles I don't want the autorepair to fix are the Hydra, Hunter, Seasparrow and RC plane. But it still repairs them and I don't know why
Reply


Messages In This Thread
Making exceptions for autorepair - by dice7 - 12.05.2009, 12:02
Re: Making exceptions for autorepair - by Weirdosport - 12.05.2009, 12:11
Re: Making exceptions for autorepair - by Nero_3D - 12.05.2009, 12:17
Re: Making exceptions for autorepair - by Weirdosport - 12.05.2009, 12:20
Re: Making exceptions for autorepair - by Nero_3D - 12.05.2009, 12:23

Forum Jump:


Users browsing this thread: 1 Guest(s)