SA-MP Forums Archive
[Ajuda] Sistema de login - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Sistema de login (/showthread.php?tid=625718)



Sistema de login - leobpo - 05.01.2017

Irei outra vez criar este topico , Meus admins logam com qualquer senha por exemplo :
ele registra 47741571
mas se ele digitar 4545W FAW5 5a e1 51s| 15E1W 5G1
ele consegue logar , presciso muito da ajuda

Codigo aqui :

PHP код:
public OnPlayerLogin(playerid,password[])
{
if(
NaoPodeLogar[playerid] == 1)
{
ForceClassSelection(playerid);
return 
true;
}
new 
tmp2[256];
new 
string2[150];
format(string2, sizeof(string2), "Players/%s.ini", PlayerName(playerid));
strmid(JogadorInfo[playerid][pKey], dini_Get(string2, "Key"), 0, strlen(dini_Get(string2, "Key")), 255);
new 
File: UserFile = fopen(string2, io_read);
if ( 
UserFile )
{
new 
PassData[256];
new 
keytmp[256], valtmp[256];
fread( UserFile , PassData , sizeof( PassData ) );
keytmp = ini_GetKey( PassData );
if( 
strcmp( keytmp , "Key" , true ) == 0 )
{
valtmp = ini_GetValue( PassData );
strmid(JogadorInfo[playerid][pKey], valtmp, 0, strlen(valtmp)-1, 255);
}
if(
strcmp(JogadorInfo[playerid][pKey],password, true ) == 0 )
{
new 
key[ 256 ] , val[ 256 ];
new 
Data[ 256 ];
while (
fread(UserFile, Data, sizeof(Data)))
{
key = ini_GetKey( Data );
if( 
strcmp( key , "Level" , true ) == 0 ) { val = ini_GetValue( Data ); JogadorInfo[playerid][pLevel] = strval( val ); }
if( 
strcmp( key , "AdminLevel" , true ) == 0 ) { val = ini_GetValue( Data ); JogadorInfo[playerid][pAdmin] = strval( val ); }