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;
}
if(strcmp(udb_hash(inputtext), PlayerInfo[playerid][pPass],true) == 0)
|
Quando queres comparar 2 strings usa sempre strcmp (string compare)
== й para comparar ints (acho eu) pawn Код:
e nгo faзas double post. |
|
if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
por if(!strcmp(udb_hash(inputtext), PlayerInfo[playerid][pPass],true)) |
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.
|
Ambos dгo erro!
pawn Код:
|
if(!strcmp(udb_hash(inputtext), PlayerInfo[playerid][pPass],true))
if(!strcmp(strlen(inputtext), PlayerInfo[playerid][pPass],true))