SA-MP Forums Archive
Cmd help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Cmd help (/showthread.php?tid=638883)



Cmd help - N0FeaR - 07.08.2017

This cmd makes my pawno to crash i can't find what i am doing wrong, maybe you guys can see it, thanks in advance.

pawn Код:
ALT:inv->inventory;
CMD:inventory(playerid, params[]]
{
    if(GetPVarInt(playerid, "PlayerLogged") == 0) return SendErrorMessage(playerid, "You must be logged in to use this.");
    if(GetPVarInt(playerid, "Mute") == 1) return SendErrorMessage(playerid, "You are currently muted!");
    if(GetPVarInt(playerid, "Jailed") > 0) return SendErrorMessage(playerid, "Cannot use this CMD while in-jail.");
    if(GetPVarInt(playerid, "Dead") > 0) return SendErrorMessage(playerid, "You are not able to use this!");
    if(GetPVarInt(playerid, "LSPD_Ta") != 0) return true;
    new diatxt[128];
    new count_in = 0;
    format(diatxt, sizeof(diatxt), "Player Inventory");
    new id = GetPVarInt(playerid, "HouseEnter");
    if(id != 0 && GetCloseHouseSafe(playerid, id) && HouseInfo[id][sLocked] != 1)
    {
        format(diatxt, sizeof(diatxt), "%s\nProperty Inventory", diatxt);
        count_in = 1;
    }
    id = GetPVarInt(playerid, "BizzEnter");
    if(id != 0 && GetCloseBizzSafe(playerid, id) && BizInfo[id][sLocked] != 1)
    {
        format(diatxt, sizeof(diatxt), "%s\nBusiness Inventory", diatxt);
        count_in = 1;
    }
    if(!IsPlayerInAnyVehicle(playerid))
    {
        new key = -1, keyex = -1;
        if(PlayerToCar(playerid, 1, 4.0))
        {
            keyex = PlayerToCar(playerid, 2, 4.0);
            if(IsValidTCar(keyex))
            {
                if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
                {
                    format(diatxt, sizeof(diatxt), "%s\n%s Inventory", diatxt, PrintVehName(keyex));
                    count_in = 2;
                    key = keyex;
                }
            }
            if(key == -1)
            {
                if(IsPoliceCar(playerid))
                {
                    format(diatxt, sizeof(diatxt), "%s\n%s Inventory",diatxt, PrintVehName(GetPoliceCarID(playerid)));
                    count_in = 2;
                }
            }
            else
            {
                new key = GetPlayerVehicleID(playerid);
                if(!IsHelmetCar(key) && VehicleInfo[key][vType] == VEHICLE_PERSONAL)
                {
                    format(diatxt, sizeof(diatxt), "%s\n%s Glovebox",diatxt, PrintVehName(key));
                    count_in = 2;
                }
            }
            if(count_in != 0)
            {
                ShowPlayerDialog(playerid, 204, DIALOG_STYLE_LIST, "Select inventory", diatxt, "Open","Close");
            }
            else
            {
                CallRemoteFunction("PrintInv", "i", playerid);
            }
            return 1;
        }
    }
}



Re: Cmd help - Misiur - 07.08.2017

Divide and conquer. Comment out one half - if it compiles, uncomment half, and so on until you isolate specific lines which do that.


Re: Cmd help - N0FeaR - 07.08.2017

I found the problem lol, i put ] instead of this ) in the end.

pawn Код:
CMD:inventory(playerid, params[]]



Re: Cmd help - cuber - 07.08.2017

Out of topic, is this the command from PR-RP gamemode?