SA-MP Forums Archive
if inputtext does not contain - 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: if inputtext does not contain (/showthread.php?tid=455182)



if inputtext does not contain - CH | FuDo - 31.07.2013

Okay guys, I'm working on my gamemode from 0, and in reg system I want to add something. It's e-mail, and I want on registration, on entering my email, if inputtext in dialog does not contain @hotmail, gmail, and that, to warn player to enter the right email. How to do that?

Thanks anyway. <3


Re: if inputtext does not contain - Sascha - 31.07.2013

https://sampwiki.blast.hk/wiki/Strfind


Re: if inputtext does not contain - CH | FuDo - 31.07.2013

Can you little explain this? It's somehow harddy learning from wiki.
Anyway, thanks for this. +REP


Re: if inputtext does not contain - Sascha - 31.07.2013

use something like:
Код:
if(strfind(inputtext, "@hotmail.com", true) == -1 && strfind(inputtext "@gmail.com", true) == -1 && strfind(inputtext, "@yahoo.com", true) == -1 && strfind(inputtext, "@******mail.com", true) == -1)
{
    //false mail
}
although you have to mention that this wouldn't allow a player to use a custom mail from e.g. his website...
or one you've forgotten to list...
so I'd advise you just to check for an @
Код:
if(strfind(inputtext, "@", true) == -1)
{
  //send warning
}