SA-MP Forums Archive
Text Format [ REP ++ ] - 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: Text Format [ REP ++ ] (/showthread.php?tid=423136)



Text Format [ REP ++ ] - teomakedonija - 16.03.2013

Hi.How to make when player registered and now we need to put email but when player don't put text only press enter to show he message EROR:You need to put format @hotmail, @live, @gmail and etc and text... How to make this ?


Re: Text Format [ REP ++ ] - Mystique - 16.03.2013

Are you using dialogs or just a normal command? If you use a normal command, I would suggest you take a look at this: https://sampforum.blast.hk/showthread.php?tid=120356


Re: Text Format [ REP ++ ] - teomakedonija - 16.03.2013

Dialogs


Re: Text Format [ REP ++ ] - Mystique - 16.03.2013

So if I understood right you want it to tell the player that he has to enter something that has the "@hotmail" or any other email service in the string?

If you want to find a certain string format you need to use
Код:
if(strfind(inputtext,"@gmail",true))
That should return true if the script can find it.


Re: Text Format [ REP ++ ] - B-Matt - 16.03.2013

Create input dialog. When he click enter and strlen is equal to 0 you just send him message. Like this:

pawn Код:
#define DIALOG_BLA  1
ShowPlayerDialog(playerid,DIALOG_BLA, DIALOG_STYLE_INPUT, "Login", "Bla bla", "Login", "Cancel");

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_BLA)
    {
        if(strlen(inputtext) == 0) return SCM...
        //If strlen is more then 0 your code
        return 1;
    }
    return 0;
}



Re: Text Format [ REP ++ ] - teomakedonija - 16.03.2013

thanks repped for all