27.07.2014, 11:26
When i use /poll command it shows random name. For example my name is Edward in game and community Director, if i use /poll questions. it shows Community director Someone's name instead of edward.
Код:
CMD:poll(playerid, params[]) { new result[96], alevel[25], string2[128]; if(PlayerInfo[playerid][pAdmin] <= 2) return SendClientMessage(playerid, COLOR_GRAD2, " You are not authorized to use that command !"); if(sscanf(params, "s[96]", result)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /poll [question]"); for(new i; i<MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { Vote[i] = 1; SetTimerEx("PollEnd3", 61000, false, "i", i); SetTimerEx("PollEnd", 60000, false, "i", i); SetTimerEx("PollEnd2", 30000, false, "i", i); } } if(PlayerInfo[playerid][pAdmin] == 2) { alevel = "Junior Administrator"; } if(PlayerInfo[playerid][pAdmin] == 3) { alevel = "General Administrator"; } if(PlayerInfo[playerid][pAdmin] >= 4 && PlayerInfo[playerid][pAdmin] <= 1336) { alevel = "Senior Administrator"; } if(PlayerInfo[playerid][pAdmin] >= 1337 && PlayerInfo[playerid][pAdmin] <= 99998) { alevel = "Head Administrator"; } if(PlayerInfo[playerid][pAdmin] == 99999) { alevel = "Executive Administrator"; } if(PlayerInfo[playerid][pAdmin] >= 100000) { alevel = "Server Manager"; } if(PlayerInfo[playerid][pAdmin] >= 100001) { alevel = "Community Director"; } if(PlayerInfo[playerid][pAdmin] >= 100002) { alevel = "Community Founder"; } format(string2, sizeof(string2), "*Suggestion Poll: %s %s has started a poll.", alevel, sendername); SendClientMessageToAll(COLOR_ORANGE, string2); format(string2, sizeof(string2), "Question is:{FFFFFF} %s", result); SendClientMessageToAll(COLOR_LIGHTGREEN, string2); SendClientMessageToAll(COLOR_LIGHTBLUE, "Type /vote [Yes/No] or Press 'Y' button for Yes - Press 'N' button for No."); return 1; }