27.07.2014, 14:35
That's because you use a global variable called 'sendername' for something that doesn't need to be a global variable at all...
This is the fixed command:
This is the fixed command:
pawn Код:
CMD:poll(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_GRAD2, " You are not authorized to use that command !");
new result[105];
if(sscanf(params, "s[105]", result)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /poll [question]");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
Vote[i] = 1;
SetTimerEx("PollEnd3", 61000, false, "i", i);
SetTimerEx("PollEnd", 60000, false, "i", i);
SetTimerEx("PollEnd2", 30000, false, "i", i);
}
new alevel[24], adminname[MAX_PLAYER_NAME], fstr[128];
switch(PlayerInfo[playerid][pAdmin])
{
case 2: alevel = "Junior Administrator";
case 3: alevel = "General Administrator";
case 4 .. 1336: alevel = "Senior Administrator";
case 1337 .. 99998: alevel = "Head Administrator";
case 99999: alevel = "Executive Administrator";
case 100000: alevel = "Server Manager";
case 100001: alevel = "Community Director";
case 100002: alevel = "Community Founder";
}
GetPlayerName(playerid, adminname, sizeof(adminname));
format(fstr, sizeof(fstr), "*Suggestion Poll: %s %s has started a poll.", alevel, adminname);
SendClientMessageToAll(COLOR_ORANGE, fstr);
format(fstr, sizeof(fstr), "Question is:{FFFFFF} %s", result);
SendClientMessageToAll(COLOR_LIGHTGREEN, fstr);
SendClientMessageToAll(COLOR_LIGHTBLUE, "Type /vote [Yes/No] or Press 'Y' button for Yes - Press 'N' button for No.");
return 1;
}