13.09.2009, 12:01
pawn Код:
new CommandCheck[MAX_PLAYERS];
public ResetCommandCheck(playerid)
{
return CommandCheck[playerid] = 0;
}
if(strcmp(cmd, "/askq", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /askq [text]");
return 1;
}
if(CommandCheck[playerid] == 1)
{
return SendClientMessage(playerid, COLOR_WHITE, "You must wait 2 minutes before using this command again.");
}
format(string, sizeof(string), "Frage von %s: %s", sendername, (result));
ABroadCast(COLOR_ASKQ,string,1);
CommandCheck[playerid] = 1;
SetTimerEx("ResetCommandCheck", 120000, 0, "i", playerid); // 120,000 MS = 2 minutes.
SendClientMessage(playerid, COLOR_ASKQ, "Deine Frage wurde an alle Online Admins verschickt.");
}
return 1;
}