[Ajuda] Passwords do servidor - 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] Passwords do servidor (
/showthread.php?tid=249338)
[Ajuda] Passwords do servidor -
Swat007forever - 18.04.2011
Boas pessoal.
Eu tenho tudo direito na pKey, mas se eu nгo meter a password correcta dб para fazer login na mesma.
Serб que alguйm me pode ajudar ?
Re: [Ajuda] Passwords do servidor -
Macintosh - 18.04.2011
Se vocк nгo postar o cуdigo fica dнficil nй amigo?
Re: [Ajuda] Passwords do servidor -
Swat007forever - 18.04.2011
Код:
public OnPlayerLogin(playerid,password[])
{
new string2[128];
format(string2, sizeof(string2), "GMRP/Accounts/%s.ini", PlayerName(playerid));
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(PlayerInfo[playerid][pKey], valtmp, 0, strlen(valtmp)-1, 255);
}
if(strcmp(PlayerInfo[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 ); PlayerInfo[playerid][pLevel] = strval( val ); }
Код:
public OnPlayerRegister(playerid, password[])
{
if(IsPlayerConnected(playerid))
{
new string3[128];
format(string3, sizeof(string3), "GMRP/Accounts/%s.ini", PlayerName(playerid));
new File: hFile = fopen(string3, io_write);
if (hFile)
{
strmid(PlayerInfo[playerid][pKey], password, 0, strlen(password), 255);
new var[32];
format(var, 32, "Key=%s\n", PlayerInfo[playerid][pKey]);fwrite(hFile, var);
PlayerInfo[playerid][pCash] = GetPlayerCash(playerid);
Re: [Ajuda] Passwords do servidor -
Macintosh - 18.04.2011
Posta a public OnPlayerLogin completa.
Re: [Ajuda] Passwords do servidor -
noobre - 18.04.2011
Pois, assim tornasse difнcil de ajudar.
Re: [Ajuda] Passwords do servidor -
Swat007forever - 19.04.2011
Jб consegui resolver o problema.
Obrigado,