Ребят, может кто объяснить, зачем из PVar там вычитается 1 ?
PHP код:
public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
for(new i; i < 53; i++)
{
if(playertextid == Inventory[i][playerid])
{
if(GetPVarInt(playerid,"ChangeSlot") == 0)
{
SetPVarInt(playerid,"SelectSlot",i);
if(InventoryPlayer[playerid][invSlot][GetPVarInt(playerid,"SelectSlot") - 1] != 0)
{
SetPVarInt(playerid,"ChangeSlot",GetPVarInt(playerid,"SelectSlot"));
PlayerTextDrawBackgroundColor(playerid,Inventory[GetPVarInt(playerid,"ChangeSlot")][playerid], -65281);
PlayerTextDrawShow(playerid,Inventory[GetPVarInt(playerid,"ChangeSlot")][playerid]);
}
}
else
{
SetPVarInt(playerid,"SelectSlot",i);
PlayerTextDrawBackgroundColor(playerid,Inventory[GetPVarInt(playerid,"ChangeSlot")][playerid], -86);
PlayerTextDrawShow(playerid,Inventory[GetPVarInt(playerid,"ChangeSlot")][playerid]);
UpdateInventory(playerid);
ObjInventory(playerid);
SetPVarInt(playerid,"ChangeSlot",0);
SetPVarInt(playerid,"SelectSlot",0);
return 1;
}
}
}
return 1;
}
Из номера слота отнимается 1, зачем???