How to make a check for not-allowed symbols?
#6

Quote:
Originally Posted by bogeyman_EST
Use
pawn Код:
if(strfind(insert_new_name_string_here, "&") != -1 ||
strfind(insert_new_name_string_here, "$") != -1 ||
strfind(insert_new_name_string_here, "^") != -1 ||
strfind(insert_new_name_string_here, "@") != -1) return SendClientMesssage(playerid, 0xFF0000FF, "Invalid characters!");
//Here goes your code to change the nick.
this code work...



and this


Quote:
Originally Posted by bogeyman_EST
You could do a loop...
pawn Код:
for(new i = 0; i < new_name_string_length; i++)
{
    switch(new_name_string[i])
    {
        case '&', '$', '@', '^': return SendClientMessage(playerid, 0xFF0000FF, "Invalid characters!");
        default: continue;
    }
}
//Here goes your code to change the nick
what new_name_string_length and new_name_string ?

i do

Код:
		
for(new i = 0; i < strfind(tmp); i++)
{
switch(tmp[i])
{
case '&', '$', '@', '^': return SendClientMessage(playerid, 0xFF0000FF, "Invalid characters!");
default: continue;
}
}
it is not right?
i have error
D:\samp\mod.pwn(1089 : warning 202: number of arguments does not match definition


Reply


Messages In This Thread
How to make a check for not-allowed symbols? - by HB - 29.03.2009, 12:28
Re: How to make a check for not-allowed symbols? - by bogeymanEST - 29.03.2009, 13:01
Re: How to make a check for not-allowed symbols? - by HB - 29.03.2009, 13:04
Re: How to make a check for not-allowed symbols? - by bogeymanEST - 29.03.2009, 13:11
Re: How to make a check for not-allowed symbols? - by HB - 29.03.2009, 13:35
Re: How to make a check for not-allowed symbols? - by PawnNewCommer - 22.07.2009, 14:05

Forum Jump:


Users browsing this thread: 1 Guest(s)