check valid name - 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: check valid name (
/showthread.php?tid=621734)
check valid name -
MerryDeer - 14.11.2016
Hi,
How to check if connected name is valid? form like that Name_Surname.
Re: check valid name -
Micko123 - 14.11.2016
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
Re: check valid name - iLearner - 14.11.2016
Ill give you a hint.... *OnPlayerConnect, *!strcmp
Re: check valid name -
MerryDeer - 14.11.2016
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);
Re: check valid name -
SyS - 14.11.2016
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
Re: check valid name -
MerryDeer - 14.11.2016
What it mean, not need to use that function?
Re: check valid name -
oMa37 - 14.11.2016
http://forum.sa-mp.com/showpost.php?...postcount=4570
Re: check valid name -
SyS - 14.11.2016
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.
Re: check valid name -
iKevin - 14.11.2016
Use regex plugin, I can PM you my code for this if you want tho.
Re: check valid name -
SickAttack - 14.11.2016
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.