Stock - IsValidCaracter - 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: Stock - IsValidCaracter (
/showthread.php?tid=303918)
Stock - IsValidCaracter -
Mati_IBV - 16.12.2011
Hey, who could create a stock that only serves to accept these symbols
$
_
@
=
A-Z
a-z
0-9
and not accept spaces
EXAMPLE:
LAST NAME
Re: Stock - IsValidCaracter -
MP2 - 16.12.2011
I presume this is for names? ****** made a function for this. I will post it tomorrow if I remember and if nobody else does (in bed on iPhone). Perhaps search his posts.
Respuesta: Re: Stock - IsValidCaracter -
Mati_IBV - 16.12.2011
Quote:
Originally Posted by MP2
I presume this is for names? ****** made a function for this. I will post it tomorrow if I remember and if nobody else does (in bed on iPhone). Perhaps search his posts.
|
is seriously? Please send me the link
Re: Stock - IsValidCaracter -
Jefff - 16.12.2011
pawn Код:
stock bool:IsValidCaracter(nick[])
{
new d;
while(nick[d] != EOS)
{
if(!('0' <= nick[d] <= '9') || !('A' <= nick[d] <= 'Z') || !('a' <= nick[d] <= 'z'))
if((nick[d] != '$') && (nick[d] != '_') && (nick[d] != '@') && (nick[d] != '=')) return true;
d++;
}
return false;
}
if(IsValidCaracter(nick[])) return wrong letters in nick