16.03.2011, 20:57
So i have command like /ask peoples to ask questions and admins to read but i need something one time i created
it with timer btw it was not good
it with timer btw it was not good
pawn Код:
if(strcmp(cmd,"/p",true)==0 || strcmp(cmd,"/pitaj",true)==0 || strcmp(cmd,"/ask",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, "Use: /pitaj [text]");
return 1;
}
format(string, sizeof(string), "Question from %s-a: %s", sendername, (result));
ABroadCast(COLOR_YELLOW2,string,1);
SendClientMessage(playerid, COLOR_YELLOW2, "Your question is sended to admins.");
}
return 1;
}