if inputtext does not contain
#1

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

https://sampwiki.blast.hk/wiki/Strfind
Reply
#3

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

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
}
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)