Help me asap please :C
#1

I'm trying to put Crate system on my script,
I got these errors

Код:
C:\Users\Douglas\Desktop\Files\[0.3x]Razer Roleplay\gamemodes\RZRP.pwn(97372) : error 017: undefined symbol "IsInRangeOfPoint"
C:\Users\Douglas\Desktop\Files\[0.3x]Razer Roleplay\gamemodes\RZRP.pwn(97376) : error 017: undefined symbol "Get3DZone"
C:\Users\Douglas\Desktop\Files\[0.3x]Razer Roleplay\gamemodes\RZRP.pwn(97376) : warning 202: number of arguments does not match definition
C:\Users\Douglas\Desktop\Files\[0.3x]Razer Roleplay\gamemodes\RZRP.pwn(97452) : error 017: undefined symbol "MAX_GROUPS"
C:\Users\Douglas\Desktop\Files\[0.3x]Razer Roleplay\gamemodes\RZRP.pwn(97517) : error 017: undefined symbol "GetPosBehindVehicle"
C:\Users\Douglas\Desktop\Files\[0.3x]Razer Roleplay\gamemodes\RZRP.pwn(97572) : error 017: undefined symbol "GetPosBehindVehicle"
C:\Users\Douglas\Desktop\Files\[0.3x]Razer Roleplay\gamemodes\RZRP.pwn(97763) : error 017: undefined symbol "GetXYInFrontOfPlayer"
C:\Users\Douglas\Desktop\Files\[0.3x]Razer Roleplay\gamemodes\RZRP.pwn(97829) : error 017: undefined symbol "GetPosBehindVehicle"
C:\Users\Douglas\Desktop\Files\[0.3x]Razer Roleplay\gamemodes\RZRP.pwn(97877) : error 017: undefined symbol "GetPosBehindVehicle"
C:\Users\Douglas\Desktop\Files\[0.3x]Razer Roleplay\gamemodes\RZRP.pwn(97913) : error 017: undefined symbol "GetPosBehindVehicle"
C:\Users\Douglas\Desktop\Files\[0.3x]Razer Roleplay\gamemodes\RZRP.pwn(98063) : error 054: unmatched closing brace ("}")
C:\Users\Douglas\Desktop\Files\[0.3x]Razer Roleplay\gamemodes\RZRP.pwn(26466) : warning 204: symbol is assigned a value that is never used: "IslandGate"
C:\Users\Douglas\Desktop\Files\[0.3x]Razer Roleplay\gamemodes\RZRP.pwn(26466 -- 98064) : warning 203: symbol is never used: "IslandThreatElimTimer"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


10 Errors.
Lines :

pawn Код:
CMD:gotoisland(playerid, params[]) {
    if(PlayerInfo[playerid][pAdmin] >= 4)
    {
        SetPlayerPos(playerid, -1081.0524,4297.9263,4.4044);
        SetPlayerVirtualWorld(playerid, 0);
        SetPlayerInterior(playerid, 0);
        SendClientMessageEx(playerid, COLOR_RED, " Teleported to Crate Factory island. ");
    }
    return 1;
}
CMD:crates(playerid, params[]) {
    if(IsACop(playerid))
    {
        new string[128], zone[MAX_ZONE_NAME];
        format(string, sizeof(string), "List of Crates to be delivered (MAX IN PRODUCTION: %d):", MAXCRATES);
        SendClientMessage(playerid, COLOR_GREEN, string);
        for(new i = 0; i < sizeof(CrateInfo); i++)
        {
            if(CrateInfo[i][crActive])
            {
                if(CrateInfo[i][InVehicle] == INVALID_VEHICLE_ID)
                {
                    GetDynamicObjectPos(CrateInfo[i][crObject], CrateInfo[i][crX],CrateInfo[i][crY],CrateInfo[i][crZ]);
                }
                else
                {
                    GetVehiclePos(CrateInfo[i][InVehicle],CrateInfo[i][crX],CrateInfo[i][crY],CrateInfo[i][crZ]);
                }
                if(IsInRangeOfPoint(-1105.8833,4428.3745,4.4000, CrateInfo[i][crX],CrateInfo[i][crY],CrateInfo[i][crZ], 800.0))
                {
                    format(zone, sizeof(zone), "Gov. Weapon Facility");
                }
                else Get3DZone(CrateInfo[i][crX],CrateInfo[i][crY],CrateInfo[i][crZ],zone, sizeof(zone));
                format(string, sizeof(string), "Crate Serial Number: #%d  Location: %s", i, zone);
                SendClientMessageEx(playerid, COLOR_GRAD2, string);
            }
        }
    }
    else
    {
        SendClientMessageEx(playerid, COLOR_GRAD2, " You do not have access to this information. ");
    }
    return 1;
}

CMD:destroycrate(playerid, params[]) {
    if(IsACop(playerid))
    {
        new string[128], CrateFound;
        new Float:cX, Float: cY, Float: cZ;
        for(new i = 0; i < sizeof(CrateInfo); i++)
        {
            if(CrateInfo[i][crActive])
            {
                GetDynamicObjectPos(CrateInfo[i][crObject], cX, cY, cZ);
                if(IsPlayerInRangeOfPoint(playerid, 5.0, cX, cY, cZ))
                {
                    DestroyDynamicObject(CrateInfo[i][crObject]);
                    DestroyDynamic3DTextLabel(CrateInfo[i][crLabel]);
                    CrateInfo[i][crActive] = 0;
                    CrateInfo[i][InVehicle] = INVALID_VEHICLE_ID;
                    CrateInfo[i][crObject] = INVALID_OBJECT_ID;
                    CrateInfo[i][crX] = 0;
                    CrateInfo[i][crY] = 0;
                    CrateInfo[i][crZ] = 0;
                    CrateFound = 1;
                    break;
                }
            }
        }
        if(!CrateFound) return SendClientMessageEx(playerid, COLOR_GRAD2, "You're not near any crates!");
        format(string, sizeof(string), "* %s seizes the weapon crate.", GetPlayerNameEx(playerid));
        ProxDetector(25.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    }
    else
    {
        SendClientMessageEx(playerid, COLOR_GRAD2, " You are not authorized. ");
    }
    return 1;
}

CMD:cargo(playerid, params[]) {
    new vehicleid = GetPlayerVehicleID(playerid);
    new string[128];
    if(vehicleid == CrateIslandVehicles[0] || vehicleid == CrateIslandVehicles[1] || vehicleid == CrateIslandVehicles[12] || vehicleid == CrateIslandVehicles[13] )
    {
        SendClientMessage(playerid, COLOR_GREEN, "Loaded Cargo:");
        for(new i = 0; i < 6; i++)
        {
            if(CrateVehicleLoad[vehicleid][vCrateID][i] != -1)
            {
                format(string, sizeof(string), "Crate SN: #%d  High Grade Materials: %d", CrateVehicleLoad[vehicleid][vCrateID][i], CrateInfo[CrateVehicleLoad[vehicleid][vCrateID][i]][GunQuantity]);
                SendClientMessage(playerid, COLOR_GRAD2, string);
            }
        }
    }
    else
    {
        return SendClientMessageEx(playerid, COLOR_GRAD2, "Your Vehicle cannot carry Weapon Crates");
    }
    return 1;
}

CMD:delivercrate(playerid, params[])
{
    new vehicleid = GetPlayerVehicleID(playerid), CrateFound = 0;
    if(vehicleid == CrateIslandVehicles[12] || vehicleid == CrateIslandVehicles[13])
    {
        for(new group; group < MAX_GROUPS; group++)
        {

            if(IsPlayerInRangeOfPoint(playerid, 6, 2782.7637, -2417.7644, 13.6349)) //if(IsPlayerInRangeOfPoint(playerid, 6, arrGroupData[group][g_fCratePos][0], arrGroupData[group][g_fCratePos][1], arrGroupData[group][g_fCratePos][2]))
            {
                /*if(arrGroupData[group][g_iLockerStock] >= MAX_LOCKER_STOCK)
                {
                    SendClientMessageEx(playerid, COLOR_GRAD2, "This locker is at full capacity and does not require a delivery.");
                    return 1;
                }*/

                for(new i = 0; i < 2; i++)
                {
                    if(CrateVehicleLoad[vehicleid][vCrateID][i] != -1)
                    {
                        CrateFound = 1;
                        new CrateID = CrateVehicleLoad[vehicleid][vCrateID][i];
                        //if( arrGroupData[group][g_iLockerStock] + floatround(CrateInfo[CrateID][GunQuantity] * 2) < MAX_LOCKER_STOCK)
                        //{
                            //arrGroupData[group][g_iLockerStock] += floatround(CrateInfo[CrateID][GunQuantity] * 2);
                        Tax += floatround(CrateInfo[CrateID][GunQuantity] * 200);
                        CrateInfo[CrateID][GunQuantity] = 0;
                        CrateInfo[CrateID][crActive] = 0;
                        CrateVehicleLoad[vehicleid][vCrateID][i] = -1;
                        //mysql_SaveCrates();
                        /*}
                        else
                        {
                            arrGroupData[group][g_iLockerStock] = 500;
                            CrateInfo[CrateID][GunQuantity] = 0;
                            CrateInfo[CrateID][crActive] = 0;
                            CrateVehicleLoad[vehicleid][vCrateID][i] = -1;
                            mysql_SaveCrates();
                        }*/

                        break;
                    }
                }
                if(CrateFound)
                {
                    SendClientMessageEx(playerid, COLOR_GRAD2, "You've delivered the High Grade Materials to the depot.");
                    //SendClientMessageEx(playerid, COLOR_GRAD2, "You've delivered the High Grade Materials to the Locker.");
                }
                else
                {
                    SendClientMessageEx(playerid, COLOR_GRAD2, "You don't have any crates loaded.");
                }
                break;
            }
        }
    }
    else return SendClientMessageEx(playerid, COLOR_GRAD2, "You're not in a cargo certified armored truck (Securicar).");
    return 1;
}

CMD:loadcrate(playerid, params[]) {
    new vehicleid = GetPlayerVehicleID(playerid);
    if(vehicleid == CrateIslandVehicles[2] || vehicleid == CrateIslandVehicles[3] ||vehicleid == CrateIslandVehicles[4] || GetVehicleModel(vehicleid) == 530)
    {
        if(CrateVehicleLoad[vehicleid][vForkLoaded])
        {
            new TruckFound, FreeSlot;
            TruckFound = INVALID_VEHICLE_ID;
            FreeSlot = -1;
            new Float:vx, Float:vy, Float:vz;
            for(new i = 0; i < sizeof(CrateIslandVehicles); i++)
            {
                GetPosBehindVehicle(CrateIslandVehicles[i], vx, vy, vz, -2);
                if(IsPlayerInRangeOfPoint(playerid, 6, vx, vy, vz))
                {
                    if(GetVehicleModel(CrateIslandVehicles[i]) == 428)
                    {
                        TruckFound = CrateIslandVehicles[i];
                        break;
                    }
                }
            }
            if(TruckFound != INVALID_VEHICLE_ID)
            {
                for(new i = 0; i < 2; i++)
                {
                    if(CrateVehicleLoad[TruckFound][vCrateID][i] == -1)
                    {
                        FreeSlot = i;
                        break;
                    }
                }
            }
            if(TruckFound == INVALID_VEHICLE_ID) return SendClientMessageEx(playerid, COLOR_GRAD2, "You're not near an Armored Truck!");
            if(FreeSlot == -1) return SendClientMessageEx(playerid, COLOR_GRAD2, "The truck is fully loaded!");
            DestroyDynamicObject(CrateVehicleLoad[vehicleid][vForkObject]);
            CrateVehicleLoad[vehicleid][vForkLoaded] = 0;
            CrateVehicleLoad[vehicleid][vForkObject] = INVALID_OBJECT_ID;
            CrateVehicleLoad[TruckFound][vCrateID][FreeSlot] = CrateVehicleLoad[vehicleid][vCrateID][0];
            CrateInfo[CrateVehicleLoad[TruckFound][vCrateID][FreeSlot]][InVehicle] = TruckFound;
            CrateVehicleLoad[vehicleid][vCrateID][0] = -1;
            SendClientMessageEx(playerid, COLOR_GRAD2, "You loaded a crate onto the truck!");
        }
        else
        {
            return SendClientMessageEx(playerid, COLOR_GRAD2, "You don't have a crate loaded!");
        }
    }
    else
    {
        return SendClientMessageEx(playerid, COLOR_GRAD2, "You're not in a forklift!");
    }
    return 1;
}

CMD:unloadcrate(playerid, params[]) {
    new vehicleid = GetPlayerVehicleID(playerid);
    if(vehicleid == CrateIslandVehicles[2] || vehicleid == CrateIslandVehicles[3] ||vehicleid == CrateIslandVehicles[4] || GetVehicleModel(vehicleid) == 530)
    {
        if(!CrateVehicleLoad[vehicleid][vForkLoaded])
        {
            new TruckFound, UsedSlot;
            TruckFound = INVALID_VEHICLE_ID;
            UsedSlot = -1;
            new Float:vx, Float:vy, Float:vz;
            for(new i = 0; i < sizeof(CrateIslandVehicles); i++)
            {
                GetPosBehindVehicle(CrateIslandVehicles[i], vx, vy, vz, -2);
                if(IsPlayerInRangeOfPoint(playerid, 6, vx, vy, vz))
                {
                    if(GetVehicleModel(CrateIslandVehicles[i]) == 428)
                    {
                        TruckFound = CrateIslandVehicles[i];
                        break;
                    }
                }
            }
            if(TruckFound != INVALID_VEHICLE_ID)
            {
                for(new i = 0; i < 2; i++)
                {
                    if(CrateVehicleLoad[TruckFound][vCrateID][i] != -1)
                    {
                        UsedSlot = i;
                        break;
                    }
                }
            }
            if(TruckFound == INVALID_VEHICLE_ID) return SendClientMessageEx(playerid, COLOR_GRAD2, "You're not near a Truck!");
            if(UsedSlot == -1) return SendClientMessageEx(playerid, COLOR_GRAD2, "The Truck is empty!");
            CrateVehicleLoad[vehicleid][vForkLoaded] = 1;
            CrateInfo[CrateVehicleLoad[TruckFound][vCrateID][UsedSlot]][InVehicle] = vehicleid;
            CrateVehicleLoad[vehicleid][vCrateID][0] = CrateVehicleLoad[TruckFound][vCrateID][UsedSlot];
            CrateVehicleLoad[vehicleid][vForkObject] = CreateDynamicObject(964,-1077.59997559,4274.39990234,3.40000010,0.00000000,0.00000000,0.00000000);
            AttachDynamicObjectToVehicle(CrateVehicleLoad[vehicleid][vForkObject], vehicleid, 0, 0.9, 0, 0, 0, 0);
            CrateVehicleLoad[TruckFound][vCrateID][UsedSlot] = -1;
            SendClientMessageEx(playerid, COLOR_GRAD2, "You've unloaded a crate from the Truck!");
        }
        else
        {

            SendClientMessageEx(playerid, COLOR_GRAD2, "Unload your forklift first!");
            return 1;

        }
    }
    else
    {
        return SendClientMessageEx(playerid, COLOR_GRAD2, "You're not in a forklift!");
    }
    return 1;
}

CMD:announcetakeoff(playerid, params[]) {
    new engine,lights,alarm,doors,bonnet,boot,objective,vehicleid, callsign[24], string[128];
    vehicleid = GetPlayerVehicleID(playerid);
    if(vehicleid == CrateIslandVehicles[0] || vehicleid == CrateIslandVehicles[1])
    {
        if(vehicleid == CrateIslandVehicles[0])
        {
            callsign = "SANAN1";
        }
        else
        {
            callsign = "SANAN2";
        }
        if(IslandGateStatus == 0)
        {
            GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
            if(engine == VEHICLE_PARAMS_ON)
            {
                SetVehicleEngine(vehicleid, playerid);
            }
            else if((engine == VEHICLE_PARAMS_OFF || engine == VEHICLE_PARAMS_UNSET))
            {
                format(string, sizeof(string), "** Pilot %s: Tower, %s ready for takeoff, over. **", GetPlayerNameEx(playerid), callsign);
                SendRadioMessage(1, DEPTRADIO, string);
                SendRadioMessage(2, DEPTRADIO, string);
                SendRadioMessage(3, DEPTRADIO, string);
                SendRadioMessage(4, DEPTRADIO, string);
                SendRadioMessage(5, DEPTRADIO, string);
                SendRadioMessage(6, DEPTRADIO, string);
                SendRadioMessage(7, DEPTRADIO, string);
                SendRadioMessage(11, DEPTRADIO, string);
                SendRadioMessage(13, DEPTRADIO, string);
                format(string, sizeof(string), "** Air Traffic Control: %s, cleared takeoff Runway 69, over. **", callsign);
                SendRadioMessage(1, DEPTRADIO, string);
                SendRadioMessage(2, DEPTRADIO, string);
                SendRadioMessage(3, DEPTRADIO, string);
                SendRadioMessage(4, DEPTRADIO, string);
                SendRadioMessage(5, DEPTRADIO, string);
                SendRadioMessage(6, DEPTRADIO, string);
                SendRadioMessage(7, DEPTRADIO, string);
                SendRadioMessage(11, DEPTRADIO, string);
                SendRadioMessage(13, DEPTRADIO, string);
                SendClientMessageEx(playerid, COLOR_WHITE, "Vehicle engine starting, please wait...");
                SetTimerEx("SetVehicleEngine", 1000, 0, "dd",  vehicleid, playerid);
            }
        }
        else
        {
            format(string, sizeof(string), "** Pilot %s: Tower, %s ready for takeoff, over. **", GetPlayerNameEx(playerid), callsign);
            SendRadioMessage(1, DEPTRADIO, string);
            SendRadioMessage(2, DEPTRADIO, string);
            SendRadioMessage(3, DEPTRADIO, string);
            SendRadioMessage(4, DEPTRADIO, string);
            SendRadioMessage(5, DEPTRADIO, string);
            SendRadioMessage(6, DEPTRADIO, string);
            SendRadioMessage(7, DEPTRADIO, string);
            SendRadioMessage(11, DEPTRADIO, string);
            SendRadioMessage(13, DEPTRADIO, string);
            format(string, sizeof(string), "** Air Traffic Control: %s, denied takeoff. Island is under lockdown, over. **", callsign);
            SendRadioMessage(1, DEPTRADIO, string);
            SendRadioMessage(2, DEPTRADIO, string);
            SendRadioMessage(3, DEPTRADIO, string);
            SendRadioMessage(4, DEPTRADIO, string);
            SendRadioMessage(5, DEPTRADIO, string);
            SendRadioMessage(6, DEPTRADIO, string);
            SendRadioMessage(7, DEPTRADIO, string);
            SendRadioMessage(11, DEPTRADIO, string);
            SendRadioMessage(13, DEPTRADIO, string);
        }
    }
    return 1;
}

CMD:loadforklift(playerid, params[]) {
    new vehicleid = GetPlayerVehicleID(playerid);
    if(vehicleid == CrateIslandVehicles[2] || vehicleid == CrateIslandVehicles[3] ||vehicleid == CrateIslandVehicles[4] || GetVehicleModel(vehicleid) == 530)
    {
        new string[128];
        if(!CrateVehicleLoad[vehicleid][vForkLoaded])
        {
            new CrateFound;
            if(IsPlayerInRangeOfPoint(playerid, 5, -1107.9978,4244.9966,3.40000010))
            {
                if(CountCrates() < MAXCRATES)
                {
                    if(Tax < 10000)
                    {
                        SendClientMessageEx(playerid, COLOR_GRAD2, "The San Andreas Government cannot afford this crate");
                        return 1;
                    }
                    if(Streamer_IsItemVisible(playerid, STREAMER_TYPE_OBJECT, CrateLoad))
                    {
                        CrateVehicleLoad[vehicleid][vForkLoaded] = 1;
                        CrateVehicleLoad[vehicleid][vForkObject] = CreateDynamicObject(964,-1077.59997559,4274.39990234,3.40000010,0.00000000,0.00000000,0.00000000);
                        AttachDynamicObjectToVehicle(CrateVehicleLoad[vehicleid][vForkObject], vehicleid, 0, 0.9, -0.2, 0, 0, 0);
                        SendClientMessageEx(playerid, COLOR_GRAD2, " You've successfully loaded the crate!");
                        HideCrate();
                        SetTimer("ShowCrate", 30000, 0);
                        for(new i = 0; i < sizeof(CrateInfo); i++)
                        {
                            if(!CrateInfo[i][crActive])
                            {
                                CrateInfo[i][InVehicle] = vehicleid;
                                CrateInfo[i][GunQuantity] = 50;
                                CrateInfo[i][crActive] = 1;
                                CrateVehicleLoad[vehicleid][vCrateID][0] = i;
                                break;
                            }
                        }
                        CrateFound = 1;
                    }
                    else return SendClientMessage(playerid, COLOR_GRAD2, " Please wait.  There is another crate in production. ");
                }
                else return SendClientMessage(playerid, COLOR_GRAD2, " This facility is at full capacity.  Please wait for the current outstanding crates to be delivered.");
            }
            else
            {
                new Float:cX, Float: cY, Float: cZ;
                for(new i = 0; i < sizeof(CrateInfo); i++)
                {
                    if(CrateInfo[i][crActive])
                    {
                        GetDynamicObjectPos(CrateInfo[i][crObject], cX, cY, cZ);
                        if(IsPlayerInRangeOfPoint(playerid, 5.0, cX, cY, cZ))
                        {
                            DestroyDynamicObject(CrateInfo[i][crObject]);
                            CrateInfo[i][InVehicle] = vehicleid;
                            CrateVehicleLoad[vehicleid][vCrateID][0] = i;
                            CrateVehicleLoad[vehicleid][vForkLoaded] = 1;
                            CrateVehicleLoad[vehicleid][vForkObject] = CreateDynamicObject(964,-1077.59997559,4274.39990234,3.40000010,0.00000000,0.00000000,0.00000000);
                            AttachDynamicObjectToVehicle(CrateVehicleLoad[vehicleid][vForkObject], vehicleid, 0, 0.9, 0, 0, 0, 0);
                            DestroyDynamic3DTextLabel(CrateInfo[i][crLabel]);
                            CrateFound = 1;
                            break;
                        }
                    }
                }
            }
            if(!CrateFound) return SendClientMessageEx(playerid, COLOR_GRAD2, "You're not near any crates!");

        }
        else
        {
            new Float: vX, Float: vY, Float: vZ;
            GetVehiclePos(vehicleid, vX, vY, vZ);
            GetXYInFrontOfPlayer(playerid, vX, vY, 2);
            DestroyDynamicObject(CrateVehicleLoad[vehicleid][vForkObject]);
            CrateVehicleLoad[vehicleid][vForkObject] = INVALID_OBJECT_ID;
            CrateVehicleLoad[vehicleid][vForkLoaded] = 0;
            CrateVehicleLoad[vehicleid][vCrateID][0] = 0;
            for(new i = 0; i < sizeof(CrateInfo); i++)
            {
                if(CrateInfo[i][InVehicle] == vehicleid)
                {
                    CrateInfo[i][InVehicle] = INVALID_VEHICLE_ID;
                    CrateInfo[i][crObject] = CreateDynamicObject(964,vX,vY,vZ-0.8,0.00000000,0.00000000,0.00000000);
                    CrateInfo[i][crX] = vX;
                    CrateInfo[i][crY] = vY;
                    CrateInfo[i][crZ] = vZ;
                    format(string, sizeof(string), "Serial Number: #%d\n High Grade Materials: %d/50", i, CrateInfo[i][GunQuantity]);
                    CrateInfo[i][crLabel] = CreateDynamic3DTextLabel(string, COLOR_ORANGE, CrateInfo[i][crX],CrateInfo[i][crY],CrateInfo[i][crZ]+1, 20.0, _, _, 1, 0, 0, _, 20.0);
                    //mysql_SaveCrates();
                    break;
                }
            }
            SendClientMessageEx(playerid, COLOR_GRAD2, " Crate unloaded onto the ground!");
            return 1;

        }
    }
    else
    {
        return SendClientMessageEx(playerid, COLOR_GRAD2, "You're not in a forklift!");
    }
    return 1;
}

stock CountCrates()
{
    new count;
    for(new i = 0; i < sizeof(CrateInfo); i++)
    {
        if(CrateInfo[i][crActive]) count++;
    }
    return count;
}

forward HideCrate(); public HideCrate()
{
    Streamer_SetArrayData(STREAMER_TYPE_OBJECT, CrateLoad, E_STREAMER_WORLD_ID, { 1 });
    return 1;
}

forward ShowCrate(); public ShowCrate()
{
    Streamer_SetArrayData(STREAMER_TYPE_OBJECT, CrateLoad, E_STREAMER_WORLD_ID, { 0 });
    return 1;
}

CMD:loadplane(playerid, params[]) {
    new vehicleid = GetPlayerVehicleID(playerid);
    if(vehicleid == CrateIslandVehicles[2] || vehicleid == CrateIslandVehicles[3] ||vehicleid == CrateIslandVehicles[4] || GetVehicleModel(vehicleid) == 530)
    {
        if(CrateVehicleLoad[vehicleid][vForkLoaded])
        {
            new PlaneFound, FreeSlot;
            PlaneFound = INVALID_VEHICLE_ID;
            FreeSlot = -1;
            new Float:vx, Float:vy, Float:vz;
            for(new i = 0; i < sizeof(CrateIslandVehicles); i++)
            {
                GetPosBehindVehicle(CrateIslandVehicles[i], vx, vy, vz, -8);
                if(IsPlayerInRangeOfPoint(playerid, 6, vx, vy, vz))
                {
                    if(GetVehicleModel(CrateIslandVehicles[i]) == 592)
                    {
                        PlaneFound = CrateIslandVehicles[i];
                        break;
                    }
                }
            }
            if(PlaneFound != INVALID_VEHICLE_ID)
            {
                for(new i = 0; i < 6; i++)
                {
                    if(CrateVehicleLoad[PlaneFound][vCrateID][i] == -1)
                    {
                        FreeSlot = i;
                        break;
                    }
                }
            }
            if(PlaneFound == INVALID_VEHICLE_ID) return SendClientMessageEx(playerid, COLOR_GRAD2, "You're not near a plane!");
            DestroyDynamicObject(CrateVehicleLoad[vehicleid][vForkObject]);
            CrateVehicleLoad[vehicleid][vForkLoaded] = 0;
            CrateVehicleLoad[vehicleid][vForkObject] = INVALID_OBJECT_ID;
            CrateVehicleLoad[PlaneFound][vCrateID][FreeSlot] = CrateVehicleLoad[vehicleid][vCrateID][0];
            CrateInfo[CrateVehicleLoad[PlaneFound][vCrateID][FreeSlot]][InVehicle] = PlaneFound;
            CrateVehicleLoad[vehicleid][vCrateID][0] = -1;
            SendClientMessageEx(playerid, COLOR_GRAD2, "You loaded a crate onto the plane!");
        }
        else
        {
            return SendClientMessageEx(playerid, COLOR_GRAD2, "You don't have a crate loaded!");
        }
    }
    else
    {
        return SendClientMessageEx(playerid, COLOR_GRAD2, "You're not in a forklift!");
    }
    return 1;
}

CMD:planeinfo(playerid, params[]) {
    new PlaneFound, string[128];
    PlaneFound = INVALID_VEHICLE_ID;
    new Float:vx, Float:vy, Float:vz;
    for(new i = 0; i < sizeof(CrateIslandVehicles); i++)
    {
        GetPosBehindVehicle(CrateIslandVehicles[i], vx, vy, vz, -8);
        if(IsPlayerInRangeOfPoint(playerid, 10, vx, vy, vz))
        {
            if(GetVehicleModel(CrateIslandVehicles[i]) == 592)
            {
                PlaneFound = CrateIslandVehicles[i];
                format(string, sizeof(string), "Plane ID: %d Cargo Information", PlaneFound);
                SendClientMessage(playerid, COLOR_GREEN, string);
                break;
            }
        }
    }
    if(PlaneFound != INVALID_VEHICLE_ID)
    {
        for(new i = 0; i < 6; i++)
        {
            format(string, sizeof(string), "Cargo Slot %d Crate SN %d",i, CrateVehicleLoad[PlaneFound][vCrateID][i]);
            SendClientMessage(playerid, COLOR_GRAD2, string);
        }
    }
    if(PlaneFound == INVALID_VEHICLE_ID) return SendClientMessageEx(playerid, COLOR_GRAD2, "You're not near a plane!");
    return 1;
}

CMD:unloadplane(playerid, params[]) {
    new vehicleid = GetPlayerVehicleID(playerid);
    if(vehicleid == CrateIslandVehicles[2] || vehicleid == CrateIslandVehicles[3] ||vehicleid == CrateIslandVehicles[4] || GetVehicleModel(vehicleid) == 530)
    {
        if(!CrateVehicleLoad[vehicleid][vForkLoaded])
        {
            new PlaneFound, UsedSlot;
            PlaneFound = INVALID_VEHICLE_ID;
            UsedSlot = -1;
            new Float:vx, Float:vy, Float:vz;
            for(new i = 0; i < sizeof(CrateIslandVehicles); i++)
            {
                GetPosBehindVehicle(CrateIslandVehicles[i], vx, vy, vz, -8);
                if(IsPlayerInRangeOfPoint(playerid, 6, vx, vy, vz))
                {
                    if(GetVehicleModel(CrateIslandVehicles[i]) == 592)
                    {
                        PlaneFound = CrateIslandVehicles[i];
                        break;
                    }
                }
            }
            if(PlaneFound != INVALID_VEHICLE_ID)
            {
                for(new i = 0; i < 6; i++)
                {
                    if(CrateVehicleLoad[PlaneFound][vCrateID][i] != -1)
                    {
                        UsedSlot = i;
                        break;
                    }
                }
            }
            if(PlaneFound == INVALID_VEHICLE_ID) return SendClientMessageEx(playerid, COLOR_GRAD2, "You're not near a plane!");
            if(UsedSlot == -1) return SendClientMessageEx(playerid, COLOR_GRAD2, "The Plane is empty!");
            CrateVehicleLoad[vehicleid][vForkLoaded] = 1;
            CrateInfo[CrateVehicleLoad[PlaneFound][vCrateID][UsedSlot]][InVehicle] = vehicleid;
            CrateVehicleLoad[vehicleid][vCrateID][0] = CrateVehicleLoad[PlaneFound][vCrateID][UsedSlot];
            CrateVehicleLoad[vehicleid][vForkObject] = CreateDynamicObject(964,-1077.59997559,4274.39990234,3.40000010,0.00000000,0.00000000,0.00000000);
            AttachDynamicObjectToVehicle(CrateVehicleLoad[vehicleid][vForkObject], vehicleid, 0, 0.9, 0, 0, 0, 0);
            CrateVehicleLoad[PlaneFound][vCrateID][UsedSlot] = -1;
            SendClientMessageEx(playerid, COLOR_GRAD2, "You've unloaded a crate from the plane!");
        }
        else
        {

            SendClientMessageEx(playerid, COLOR_GRAD2, "Unload your forklift first!");
            return 1;

        }
    }
    else
    {
        return SendClientMessageEx(playerid, COLOR_GRAD2, "You're not in a forklift!");
    }
    return 1;
}

CMD:cratelimit(playerid, params[]) {
    if(PlayerInfo[playerid][pMember] == 11 || (PlayerInfo[playerid][pLeader] == 11))
    {
        new string[128];
        new moneys;
        if(sscanf(params, "d", moneys)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /cratelimit [10-20] (Limits the total production of crates)");
        if(moneys < 10 || moneys > MAX_CRATES) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /cratelimit [10-20] (Limits the total production of crates)");
        MAXCRATES = moneys;
        format(string, sizeof(string), "* You have restricted weapon crate production to %d", moneys);
        SendClientMessageEx(playerid, COLOR_YELLOW, string);
        format(string, sizeof(string), "** %s has restricted weapon crate production to %d", GetPlayerNameEx(playerid), moneys);
        SendRadioMessage(11, DEPTRADIO, string);
    }
    else
    {
        SendClientMessageEx(playerid, COLOR_GRAD2, " Only the Government has the authority to do this! ");
    }
    return 1;
}

CMD:delgps(playerid, params[]) {
    return cmd_deliverygps(playerid, params);
}

CMD:deliverygps(playerid, params[]) {
    new vehicleid = GetPlayerVehicleID(playerid);
    if(vehicleid == CrateIslandVehicles[0] || vehicleid == CrateIslandVehicles[1] || (PlayerInfo[playerid][pMember] == 6))
    {
        SetPVarInt(playerid,"delgps", 1);
        DisablePlayerCheckpoint(playerid);
        SetPlayerCheckpoint(playerid, 2782.7637,-2417.7644,13.6349, 15.0);
    }
    else
    {
        return SendClientMessageEx(playerid, COLOR_GRAD2, " You do not have access to the GPS co-ordinates");
    }
    return 1;
}

CMD:igps(playerid, params[]) {
    return cmd_islandgps(playerid, params);
}

CMD:islandgps(playerid, params[]) {
    new vehicleid = GetPlayerVehicleID(playerid);
    if(vehicleid == CrateIslandVehicles[0] || vehicleid == CrateIslandVehicles[1] || PlayerInfo[playerid][pMember] == 6)
    {
        SetPVarInt(playerid,"igps", 1);
        DisablePlayerCheckpoint(playerid);
        SetPlayerCheckpoint(playerid, -1173.3702,4491.6836,4.4765, 15.0);
    }
    else
    {
        return SendClientMessageEx(playerid, COLOR_GRAD2, " You do not have access to the GPS co-ordinates");
    }
    return 1;
}

CMD:cgun(playerid, params[]) {
    if(IsPlayerInAnyVehicle(playerid))
    {
        return SendClientMessageEx(playerid, COLOR_GRAD2, "You can't reach into the crate from inside your vehicle! ");
    }
    new Float:cX, Float: cY, Float: cZ, CrateFound;
    for(new i = 0; i < sizeof(CrateInfo); i++)
    {
        if(CrateInfo[i][crActive])
        {
            GetDynamicObjectPos(CrateInfo[i][crObject], cX, cY, cZ);
            if(IsPlayerInRangeOfPoint(playerid, 3.0, cX, cY, cZ))
            {
                if(CrateInfo[i][GunQuantity] < 1)
                {
                    SendClientMessageEx(playerid, COLOR_GRAD2, "The crate is empty! ");
                    DestroyDynamicObject(CrateInfo[i][crObject]);
                    DestroyDynamic3DTextLabel(CrateInfo[i][crLabel]);
                    CrateInfo[i][crActive] = 0;
                    CrateInfo[i][InVehicle] = INVALID_VEHICLE_ID;
                    CrateInfo[i][crObject] = 0;
                    CrateInfo[i][crX] = 0;
                    CrateInfo[i][crY] = 0;
                    CrateInfo[i][crZ] = 0;
                    CrateFound = 1;
                    break;
                }
                else
                {
                    SetPVarInt(playerid, "CrateGuns_CID", i);
                    ShowPlayerDialog(playerid, CRATE_GUNMENU, DIALOG_STYLE_LIST, "Select a gun from the Crate", "Desert Eagle - 4 HG Mats\nSPAS-12 - 8 HG Mats\nMP5 - 5 HG Mats\nM4A1 - 6 HG Mats\nAK-47 - 5 HG Mats\nSniper Rifle - 5 HG Mats\nShotgun - 6 HG Mats\nFirst Aid Kit - 1 HG Mats", "Select", "Cancel");
                    CrateFound = 1;
                    break;
                }
            }
        }
    }
    if(!CrateFound)
    {
        SendClientMessageEx(playerid, COLOR_GRAD2, "You're not near a crate! ");
    }
    return 1;
}

new IslandThreatElimTimer;
forward IslandThreatElim();

Please help me
Reply


Messages In This Thread
Help me asap please :C - by DouglasRamirez - 19.10.2013, 03:54

Forum Jump:


Users browsing this thread: 1 Guest(s)