07.07.2011, 10:06
I dont now how to add this in dialog?
Whit inputext
Pls, help
pawn Код:
if(strcmp(cmd,"/ask",true)==0 || strcmp(cmd,"/askq",true)==0 || strcmp(cmd,"/report",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: /ask [text]");
return 1;
}
format(string, sizeof(string), "Ask from %s: %s", sendername, (result));
ABroadCast(COLOR_ASKQ,string,1);
SendClientMessage(playerid, COLOR_ASKQ, "Your Q is sent to Admins.");
}
return 1;
}
Pls, help