O que se passa!?
#1

Eu entro no server e me registo com a password "portugal", relogo faзo o login com a password "p" e o faz o login ou entao "gdfklgdf" qualquer palavara faz o login, nгo sei o que se passa com o sistema! alguem me ajuda!

Ai ta a parte do login, o gamemode nгo apresenta erros nem nada!

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch( dialogid )
    {
        case DIALOG_REGISTER:
        {
            if (!response) return Kick(playerid);
            if(response)
            {
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Registering...","You have entered an invalid password.\nType your password below to register a new account.","Register","Quit");
                new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File,"data");
                INI_WriteInt(File,"Password",udb_hash(inputtext));
                INI_WriteInt(File,"Cash",0);
                INI_WriteInt(File,"Admin",0);
                INI_WriteInt(File,"Kills",0);
                INI_WriteInt(File,"Deaths",0);
                INI_Close(File);
                pLogged[playerid] = 1;
                //SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
                //SpawnPlayer(playerid);
                ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,"Sucesso!","{FFFFFF}Conta registada com sucesso!\nPor favor reloga!","Ok","");
                Kick(playerid);
			}
        }

        case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
					ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,"Sucesso!","{FFFFFF}Login bem sucedido!\nTeamSpeak IP: {00BFFF}ts72.light-speed.com:6620","Ok","");
					pLogged[playerid] = 1;
                }
                else
                {
                	new string[256];
        			format(string, sizeof(string), "{FA0000}Password incorrecta!\n{FFFFFF}Por favor digite a password corretamente em baixo!");
        			ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Login", string, "Login", "Cancelar");
                }
                return 1;
            }
        }
    }
                return 0;
            }
Reply
#2

Alguem??
Reply
#3

Quando queres comparar 2 strings usa sempre strcmp (string compare)
== й para comparar ints (acho eu)
pawn Код:
if(strcmp(udb_hash(inputtext), PlayerInfo[playerid][pPass],true) == 0)
e a proxima vez usa [pawn] tag
e nгo faзas double post.
Reply
#4

if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])

por

if(!strcmp(udb_hash(inputtext), PlayerInfo[playerid][pPass],true))
Reply
#5

Quote:
Originally Posted by FireCat
Посмотреть сообщение
Quando queres comparar 2 strings usa sempre strcmp (string compare)
== й para comparar ints (acho eu)
pawn Код:
if(strcmp(udb_hash(inputtext), PlayerInfo[playerid][pPass],true) == 0)
e a proxima vez usa [pawn] tag
e nгo faзas double post.
Quote:
Originally Posted by Pharrel
Посмотреть сообщение
if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])

por

if(!strcmp(udb_hash(inputtext), PlayerInfo[playerid][pPass],true))
Ambos dгo erro!

pawn Код:
C:\Users\Patch\Desktop\•Challenge of Stunt•\gamemodes\COS.pwn(263) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Reply
#6

Quote:
Originally Posted by CJoao
Посмотреть сообщение
Ambos dгo erro!

pawn Код:
C:\Users\Patch\Desktop\•Challenge of Stunt•\gamemodes\COS.pwn(263) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Mostra-me PlayerInfo[playerid][pPass]
pPass й array?
Reply
#7

Sim e
Reply
#8

Quote:
Originally Posted by CJoao
Посмотреть сообщение
Sim e
E udb_hash(inputtext)?
й que nгo uso nada disso, uso whirlpool
Reply
#9

Linha de erro:
pawn Код:
if(!strcmp(udb_hash(inputtext), PlayerInfo[playerid][pPass],true))
Reply
#10

vei, n sei q q й esse udb_hash, mas c vc ta salvando uma senha... tenta por

pawn Код:
if(!strcmp(strlen(inputtext), PlayerInfo[playerid][pPass],true))
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)