Register Limit - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Register Limit (
/showthread.php?tid=81706)
Register Limit -
shark - 13.06.2009
Hello,
I'm trouble. When someone do, for example "/register 90123801938018931908301983901381908301989013890389 0183108309893890381019031893" the server freeze!
I want to know, how to limite character in /register.
Thanks!
Re: Register Limit -
Correlli - 13.06.2009
Use something like this:
pawn Код:
if(strlen(pwd) > 20) return SendClientMessage(playerid, 0xFFFFFFAA, "You can't have more than 20 characters in password.");
20 characters is just an example, set your own value.
Re: Register Limit -
shark - 13.06.2009
Quote:
Originally Posted by Don Correlli
Use something like this:
pawn Код:
if(strlen(pwd) > 20) return SendClientMessage(playerid, 0xFFFFFFAA, "You can't have more than 20 characters in password.");
20 characters is just an example, set your own value.
|
But.. 'pwd' is not specific before..
And I'm using strcmp.
Re: Register Limit -
Correlli - 13.06.2009
'pwd' is just an example.
Re: Register Limit -
OmeRinG - 13.06.2009
On top of your script under include a samp:
pawn Код:
stock strval_fix(string[]) return strlen(string) > 49? 0 : strval(string); //By Amit_B
#define strval strval_fix