Help with code
#4

Код:
CMD:putoutfire(playerid)
{
    new Float:X1, Float:Y1, Float:Z1, Float:X2, Float:Y2, Float:Z2, Float:X3, Float:Y3, Float:Z3, Float:X4, Float:Y4, Float:Z4, Float:X5, Float:Y5, Float:Z5;

    GetObjectPos(o1, X1, Y1, Z1);
    GetObjectPos(o2, X2, Y2, Z2);
    GetObjectPos(o3, X3, Y3, Z3);
    GetObjectPos(o4, X4, Y4, Z4);
    GetObjectPos(o5, X5, Y5, Z5);

new vehid = GetPlayerVehicleID(playerid);
new vehicle =GetVehicleModel(vehid);
if(vehicle == 407 || GetPlayerWeapon(playerid) == 42))
{


    if(FireInProgress == false) return SendClientMessage(playerid, 0xFFFFFF, "ERROR: There are no fires in progress");
    
    if(IsPlayerInRangeOfPoint(playerid, 20.0, X1, Y1, Z1) == 0 || IsPlayerInRangeOfPoint(playerid, 20.0, X2, Y2, Z2) == 0 || IsPlayerInRangeOfPoint(playerid, 20.0, X3, Y3, Z3) == 0 || IsPlayerInRangeOfPoint(playerid, 20.0, X4, Y4, Z4) == 0 || IsPlayerInRangeOfPoint(playerid, 20.0, X5, Y5, Z5) == 0) return SendClientMessage(playerid, 0xFFFFFF, "ERROR: You are not near the fire");

    if(Reload[playerid] != false) return SendClientMessage(playerid, 0xFFFFFF, "ERROR: You need to wait before putting the fire again");
    if(GetPlayerSkin(playerid) == 277 || GetPlayerSkin(playerid) == 278 || GetPlayerSkin(playerid) == 279)
    {
        if(FireStatus < 0)
        {
            KillFire();
            return 1;
        }
        if(FireStatus < 80)
        {
            DestroyObject(o1);
            return 1;
        }
        if(FireStatus < 60)
        {
            DestroyObject(o1);
            return 1;
        }
        if(FireStatus < 40)
        {
            DestroyObject(o1);
            return 1;
        }
        if(FireStatus < 20)
        {
            DestroyObject(o1);
            return 1;
        }

        if(IsPlayerInAnyVehicle(playerid) == 1)
        {
            if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 407)
            {
                FireStatus = FireStatus - 15;
                SetTimerEx("ReloadFun", 30000, false, "i", playerid);
                Reload[playerid] = true;
                SendClientMessage(playerid, 0xFFFFFF, "You managed to put out some of the fire ((reload 30 seconds))");
            }
        }
        else if(GetPlayerWeapon(playerid) == 42)
        {
            FireStatus = FireStatus - 5;
            SetTimerEx("ReloadFun", 15000, false, "i", playerid);
            Reload[playerid] = true;
            SendClientMessage(playerid, 0xFFFFFF, "You managed to put out some of the fire ((reload 15 seconds))");
        }
        else return SendClientMessage(playerid, 0xFFFFFF, "ERROR: You must be in a Firetruck or using a fire extingusher");
    }
}
    else return SendClientMessage(playerid, 0xFFFFFF, "You are not in a fireman suit");
    return 1;

}
[/code]
Reply


Messages In This Thread
Help with code - by The_J0ker - 29.09.2011, 03:20
Re: Help with code - by Yamoo - 29.09.2011, 03:23
Re: Help with code - by The_J0ker - 29.09.2011, 03:53
Re: Help with code - by Saurik - 29.09.2011, 04:27
Re: Help with code - by The_J0ker - 29.09.2011, 04:35
Re: Help with code - by Buzzbomb - 29.09.2011, 04:41
Re: Help with code - by The_J0ker - 04.10.2011, 02:27
Re: Help with code - by DRIFT_HUNTER - 04.10.2011, 02:40
Re: Help with code - by The_J0ker - 16.10.2011, 02:10

Forum Jump:


Users browsing this thread: 1 Guest(s)