07.08.2017, 16:35
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;
}
}
}