05.01.2015, 16:29
Как сделать перемещение предметов по слотам.
В чем ошибка, в моем коде?
Code:
for(new i; i < 48; i++) { if(playertextid == InvSlot[playerid][i]) { if(GetPVarInt(playerid, "SelectSlot") == -1) { if(PlayerInfo[playerid][pInvSlot][i] != -1) { SetPVarInt(playerid, "SelectSlot", i); PlayerTextDrawBackgroundColor(playerid, InvSlot[playerid][i], 0xf2ddc6ff); PlayerTextDrawShow(playerid, InvSlot[playerid][i]); } } else if(GetPVarInt(playerid, "SelectSlot") != -1) { if(PlayerInfo[playerid][pInvSlot][i] == -1) { SetPVarInt(playerid, "NewSelectSlot", i); PlayerTextDrawBackgroundColor(playerid, InvSlot[playerid][GetPVarInt(playerid,"SelectSlot")], -1061109505); PlayerTextDrawShow(playerid, InvSlot[playerid][GetPVarInt(playerid,"SelectSlot")]); PlayerTextDrawSetPreviewModel(playerid,InvSlot[playerid][GetPVarInt(playerid,"SelectSlot")], 1649); PlayerTextDrawSetPreviewRot(playerid, InvSlot[playerid][GetPVarInt(playerid,"SelectSlot")], 0.000000, 0.000000, 90.000000, 2.000000); PlayerTextDrawSetPreviewModel(playerid,InvSlot[playerid][GetPVarInt(playerid,"NewSelectSlot")], Items_All[PlayerInfo[playerid][pInvSlot][GetPVarInt(playerid,"ChangeSlot") - 1]][invObject]); PlayerTextDrawSetPreviewRot(playerid, InvSlot[playerid][GetPVarInt(playerid,"NewSelectSlot")], 0.000000, 0.000000, 0.000000, 1.000000); SetPVarInt(playerid, "SelectSlot", -1); SetPVarInt(playerid, "NewSelectSlot", -1); } } new string[10]; format(string, sizeof(string), "Clot %i", i); SendClientMessage(playerid, -1, string); } }