/load command bugged?
#2

You are finding if it is greater than or equal to that variable. It doesn't work like that (i think).

Check if they are EQUAL.

EDIT: Try this, it loops 11 times, checking if the player is in one of the 11 vehicles.

pawn Код:
//-----------------------------------------[Commerce Trucking]--------------------//
if(strcmp(cmd, "/load", true) == 0)
{
    if(PlayerInfo[playerid][pJob] == 26)
    {
        if(PlayerInfo[playerid][pTruckerCooldown] <= 0)
        {
            if(GetPVarInt(playerid, "Delivering") == 0)
            {
                if(IsPlayerInRangeOfPoint(playerid, 8.0, 2484.2195,-2118.1204,13.5469))
                {
                    new InVehicle = 0;
                    for(new i = 0; i < 11; i++)
                    {
                        if(GetPlayerVehicleID(playerid) == ComTruck[i])
                        {
                            InVehicle = 1;
                        }
                    }
                    if(InVehicle == 1)
                    {
                        if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
                        {
                            if(GetPVarInt(playerid, "Loading") == 0)
                            {
                                PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                                SendClientMessage(playerid, LIGHTBLUE, "Please wait while the products are loaded onto the truck...");
                                SetTimerEx("LoadProducts", 10000, false, "i", playerid);
                                SetPVarInt(playerid, "Loading", 1);
                                TogglePlayerControllable(playerid, 0);
                                return 1;
                            }
                            else return SendClientMessage(playerid, GREY, "Please wait...");
                        }
                        else return SendClientMessage(playerid, GREY, "Wait.. where's the trailer? We need something to put the products inside.");
                    }
                    else return SendClientMessage(playerid, GREY, "    You can only deliver in a truck.");
                }
                else return SendClientMessage(playerid, GREY, "    You are not at the Los Santos Product Factory.");
            }
            else return SendClientMessage(playerid, GREY, "    You are already delivering products, either deliver it or /killcp.");
        }
        else return format(string, sizeof(string), "You still have %d seconds left before you can deliver more products.", PlayerInfo[playerid][pTruckerCooldown]), SendClientMessage(playerid, GREY, string);
    }
    else { SendClientMessage(playerid, GREY, "    You are not a trucker."); }
    return 1;
}
Reply


Messages In This Thread
/load command bugged? - by Donvalley - 21.06.2013, 02:36
Re: /load command bugged? - by Kindred - 21.06.2013, 02:45
Re: /load command bugged? - by Donvalley - 21.06.2013, 03:05

Forum Jump:


Users browsing this thread: 1 Guest(s)