25.08.2010, 02:24
Eai pessoal blz ?
to com um problema acho que nгo tгo complicado mais tambйm nгo consegui resolver.
Entгo tenho esse dialog acima que seria o logar do meu servidor, mais nгo consegui usar else para a segunda reposta pois ja tem um e tambйm nгo estб dando muito certo usar:
if(response == 1) e if(response == 0) porque ele confunde com outro response ja existentes
tem alguma outra maneira que eu possa fazer ele reconheзer cada resposta sem conflito ?
Obrigado desde jб!
to com um problema acho que nгo tгo complicado mais tambйm nгo consegui resolver.
Код:
if(dialogid == Logar)
{
if(response == 0)
{
new file[128];
new string[128];
new PlayerName[24];
if(strlen(inputtext) == 0)
{
GetPlayerName(playerid, PlayerName, sizeof PlayerName);
format(string, sizeof string, "Bem Vindo %s! \n\nPor favor digite sua senha.", PlayerName);
ShowPlayerDialog(playerid, Logar, DIALOG_STYLE_INPUT, "Brasil .::[XDB]::. X-Treme", string, "Logar", "Sair");
return 0;
}
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file,sizeof(file),"/Contas/%s.ini",name);
new password = dini_Int(file, "Password");
if(udb_hash(inputtext) != password)
{
GetPlayerName(playerid, PlayerName, sizeof PlayerName);
format(string, sizeof string,"Senha incorreta para o nick '%s'\n\nTente novamente!", PlayerName);
ShowPlayerDialog(playerid, Logar, DIALOG_STYLE_INPUT, "Brasil .::[XDB]::. X-Treme", string, "Logar", "Sair");
}
else
{
SetPVarInt(playerid, "IsLogged", 1);
GivePlayerMoney(playerid,-1000);
SetPlayerScore(playerid, dini_Int(file,"Score"));
GivePlayerMoney(playerid, dini_Int(file,"Money"));
PlayerInfo[playerid][pKills] = dini_Int(file, "Kills");
PlayerInfo[playerid][pDeaths] = dini_Int(file, "Deaths");
PlayerInfo[playerid][pLogins] = dini_Int(file, "Logins");
PlayerInfo[playerid][pBanco] = dini_Int(file, "Banco");
PlayerInfo[playerid][pLogins] ++;
SendClientMessage(playerid, Verde, "Logado com sucesso!");
TogglePlayerSpectating(playerid, 0);
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
GetPlayerName(playerid, name, sizeof(name));
printf("%s Registrou a conta!!", name);
}
}
}
if(response == 1)
{
SendClientMessage(playerid,Vermelho,"Vocк nгo se logou e por isso foi kickado!");
}
if(response == 1) e if(response == 0) porque ele confunde com outro response ja existentes
tem alguma outra maneira que eu possa fazer ele reconheзer cada resposta sem conflito ?
Obrigado desde jб!



que tem na primeira mensagem do trуpico.