check valid name
#1

Hi,

How to check if connected name is valid? form like that Name_Surname.
Reply
#2

Wow that might search button

https://sampforum.blast.hk/showthread.php?tid=309062

https://sampforum.blast.hk/showthread.php?tid=418573

https://sampforum.blast.hk/showthread.php?tid=207889

https://sampforum.blast.hk/showthread.php?tid=116608
Reply
#3

Ill give you a hint.... *OnPlayerConnect, *!strcmp
Reply
#4

What do this part:

pname[0] = toupper(pname[0]);
for(new x=1; x<maxname; x++)
{
if(pname[x] == '_') pname[x+1] = toupper(pname[x+1]);
else if(pname[x] != '_' && pname[x-1] != '_') pname[x] = tolower(pname[x]);
}
SetPlayerName(playerid, "New_Name");
SetPlayerName(playerid, pname);
Reply
#5

Quote:
Originally Posted by MerryDeer
Посмотреть сообщение
What do this part:

pname[0] = toupper(pname[0]);
for(new x=1; x<maxname; x++)
{
if(pname[x] == '_') pname[x+1] = toupper(pname[x+1]);
else if(pname[x] != '_' && pname[x-1] != '_') pname[x] = tolower(pname[x]);
}
SetPlayerName(playerid, "New_Name");
SetPlayerName(playerid, pname);
Thats bullshit! man
Reply
#6

What it mean, not need to use that function?
Reply
#7

http://forum.sa-mp.com/showpost.php?...postcount=4570
Reply
#8

Quote:
Originally Posted by MerryDeer
Посмотреть сообщение
What it mean, not need to use that function?
Im talking about the thing you doing in the loop.Re check its process again.
Reply
#9

Use regex plugin, I can PM you my code for this if you want tho.
Reply
#10

Quote:
Originally Posted by KevinExec
Посмотреть сообщение
Use regex plugin, I can PM you my code for this if you want tho.
Regex is quite slow compared to PAWN code.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)