Dialog - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Dialog (
/showthread.php?tid=267121)
Dialog -
Speed - 07.07.2011
I dont now how to add this in dialog?
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;
}
Whit inputext
Pls, help
Re: Dialog -
[MG]Dimi - 07.07.2011
PHP код:
if(strcmp(cmd,"/ask",true)==0 || strcmp(cmd,"/askq",true)==0 || strcmp(cmd,"/report",true)==0)
if(IsPlayerConnected(playerid))
{
ShowPlayerDialog(playerid,dialogid,DIALOG_STYLE_INPUT,"Contact","Enter your message below", "Send", "Cancel");
return 1;
}
And then use
PHP код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
Re: Dialog -
Shadoww5 - 07.07.2011
PHP код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmd,"/ask",true)==0 || strcmp(cmd,"/askq",true)==0 || strcmp(cmd,"/report",true)==0)
{
ShowPlayerDialog(playerid,489,DIALOG_STYLE_INPUT,"REPORT:","Enter your message below", "Send", "Cancel");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 489)
{
if(response)
{
new string[128];
GetPlayerName(playerid, string, 24);
if(!strlen(inputtext)) return ShowPlayerDialog(playerid,489,DIALOG_STYLE_INPUT,"REPORT:","Enter your message below", "Send", "Cancel");
if(strlen(inputtext) > 90)
{
SendClientMessage(playerid, 0xFF0000FF, "Your message must have less than 90 characters.");
ShowPlayerDialog(playerid,489,DIALOG_STYLE_INPUT,"REPORT:","Enter your message below", "Send", "Cancel");
return 1;
}
format(string, 128, "Ask from %s: %s", string, inputtext);
ABroadCast(COLOR_ASKQ,string,1);
SendClientMessage(playerid, COLOR_ASKQ, "Your Q is sent to Admins.");
}
}
return 1;
}