Dialog style input get string
#1

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?
Reply
#2

You need to use strcmp to compare strings.
Reply
#3

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
Reply
#4

pawn Code:
new ename[50],string[100];
        if(strcmp(ename,"%s",true))
        {
Like that?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)