04.09.2018, 04:18
Its because you set the new info before checking:
^ This way your if check will always work!
But this will work:
Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid) { for(new i = 3; i < 13; i++) { if(clickedid == TD_ListBox[i]) { TimeClickTD_List[playerid] = gettime() + 1; IDClickTD_List[playerid] = i; if(gettime() < TimeClickTD_List[playerid] && IDClickTD_List[playerid] == i) { return 1; } } } return 1; }
But this will work:
Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid) { for(new i = 3; i < 13; i++) { if(clickedid == TD_ListBox[i]) { if(gettime() < TimeClickTD_List[playerid] && IDClickTD_List[playerid] == i) { return 1; } TimeClickTD_List[playerid] = gettime() + 1; IDClickTD_List[playerid] = i; break; // also add a break since one item can be clicked at a time } } return 1; }