towcar
#1

hey guys i have this cmd is supposed to tow the attached car to my trail if the car has under 900 hp but is not working i can tow a car with 1k health

Код 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
towcar - by StR_MaRy - 16.10.2016, 21:31
Re: towcar - by Threshold - 17.10.2016, 04:26
Re: towcar - by Marven - 17.10.2016, 04:49
Re: towcar - by StR_MaRy - 17.10.2016, 06:23
Re: towcar - by Threshold - 19.10.2016, 03:53
Re: towcar - by StR_MaRy - 19.10.2016, 04:09
Re: towcar - by Threshold - 19.10.2016, 07:03
Re: towcar - by StR_MaRy - 19.10.2016, 12:57
Re: towcar - by Threshold - 19.10.2016, 14:38
Re: towcar - by StR_MaRy - 19.10.2016, 15:32

Forum Jump:


Users browsing this thread: