Dialog style input get string - 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)
+--- Thread: Dialog style input get string (
/showthread.php?tid=561170)
Dialog style input get string -
vassilis - 01.02.2015
How to get the typed text of an inputted dialog?
using strfind? if yes could you give me an example using this:
pawn Code:
case DIALOG_EVENTNAME:
{
if(inputtext[0] == "%s",ename)
{
new ename[50],string[100];
playerid = adminevent[playerid];
eventteleports = 1;
if(pinfo[playerid][Admin]< 3) return 0;
if(sscanf(params,"s[50]",ename)) return SendClientMessage(playerid, COLOR_RED, " SERVER : /startevent [eventname]");
if(eventon == 1) return SendClientMessage(playerid, COLOR_RED," SERVER : You have already started the event!");
eventon = 1;
if(eventamount == 1)
{
format(string,sizeof(string),"~b~ %s~w~ has started! price : ~g~$~w~10,000~n~~w~type ~r~ /yes~w~ to join!",ename);
GameTextForAll(string,3000,5);
}
P.S:I know its wrong but i try to find a way to make it could you give me an example of how it is possible to get a string?
Re: Dialog style input get string -
biker122 - 01.02.2015
You need to use strcmp to compare strings.
Re: Dialog style input get string -
Abagail - 01.02.2015
Inputtext is the input string simply. Then to compare that string to another string, you'd use strcmp. See:
wiki.sa-mp.com/wiki/OnDialogResponse,
wiki.sa-mp.com/wiki/strcmp
Re: Dialog style input get string -
vassilis - 01.02.2015
pawn Code:
new ename[50],string[100];
if(strcmp(ename,"%s",true))
{
Like that?