not the right hp
#1

hey guys i have this cmd and i can /towcar only if the health of that car is under 900 but is not working i can't tow still if the car has under 900 hp , the car i want to tow have 500 hp and still i get the message like "this car do not have 10% or less to tow it"

Код HTML:
CMD:towcar(playerid, params[])
{
	if(gLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Tu nu esti logat si nu poti sa folosesti aceasta comanda!");
	if(PlayerInfo[playerid][pMember] + PlayerInfo[playerid][pLeader] != 6) return SendClientMessage(playerid, COLOR_ERROR, "Nu faci parte din Tow Truck Company.");
	{
		new vid = GetPlayerVehicleID(playerid);
		if(GetPlayerState(playerid) != 2 && !IsATCCCar(vid)) return SendClientMessage(playerid, COLOR_ERROR, "You are not driver of a Tow Truck.");
		if(GetVehicleModel(vid) != 525) return SendClientMessage(playerid, COLOR_ERROR, "You are not driver of a Tow Truck.");

		if(IsTowing[playerid] == 1) return SendClientMessage(playerid, COLOR_ERROR, "You already towing a vehicle.");
	 	if(PlayerInfo[playerid][pTowPoints] == 0) return SendClientMessage(playerid, COLOR_ERROR, "You cannot tow any car till PayDay.");
		if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
		{
			new Float:health;
			new towedcar = GetVehicleTrailer(GetPlayerVehicleID(playerid));
			GetVehicleHealth( towedcar, health );
			if(health > 900.0)
			{
				format(gString, sizeof(gString), "Acel vehicul prezinta mai putin de 10%s daune, nu il poti tracta!", "%%");
			    SendClientMessage(playerid, COLOR_ERROR, gString );
			    return 1;
			}
		    PlayerInfo[playerid][pTowPoints] --;
			Update(playerid, pTowPointsx);
			CP[playerid] = 90;
			UseFind[playerid] = 0;
			IsTowing[playerid] = 1;
			SetPlayerCheckpoint(playerid, 2409.8416,-1425.7860,23.9826, 5.0);
			SendClientMessage(playerid, COLOR_SYN2, "Go to the checkpoint and destroy the car.");
			CP_Timer[playerid] = gettime();
		}
		else SendClientMessage(playerid, COLOR_ERROR, "You dont have a vehicle attached.");
	}
	return 1;
}
why?
Reply


Messages In This Thread
not the right hp - by StR_MaRy - 16.10.2016, 00:50
Re: not the right hp - by qUneT - 16.10.2016, 01:40
Re: not the right hp - by SickAttack - 16.10.2016, 01:56
Re: not the right hp - by StR_MaRy - 16.10.2016, 02:05
Re: not the right hp - by Bondz - 16.10.2016, 02:10
Re: not the right hp - by StR_MaRy - 16.10.2016, 02:18

Forum Jump:


Users browsing this thread: 1 Guest(s)