01.10.2009, 15:15
Something is wrong with my Dini Code that whenever someone does /register, nothing happens. It says, "Account Created". But Nothing is created .
Note: First Time using Dini.
Code:
Note: First Time using Dini.
Code:
Code:
if(strcmp(cmd, "/register", true) == 0) { new name[MAX_PLAYER_NAME]; tmp = strtok(cmdtext, idx); if(strlen(tmp) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /register [password]"); if(dini_Exists(file)) { dini_Create(file); dini_IntSet(file, "Password", udb_hash(tmp)); dini_IntSet(file,"Level", 0); dini_IntSet(file,"AdminLevel", 0); dini_IntSet(file,"Cash", 0); dini_IntSet(file,"Muted", 0); dini_IntSet(file,"Score", 0); SendClientMessage(playerid, eadmin, "[EADMIN]: Account Created!"); PlayerPlaySound(playerid,1057,0.0,0.0,0.0); GetPlayerName(playerid, name, sizeof(name)); printf("%s has registered a account!", name); } else { SendClientMessage(playerid, eadmin, "[EADMIN]: Account Already Found In Database"); PlayerPlaySound(playerid,1057,0.0,0.0,0.0); } } if(strcmp(cmd, "/login", true) == 0) { new name[MAX_PLAYER_NAME]; if(gLogged[playerid] == 1) { SendClientMessage(playerid, eadmin, "You already are logged in!"); return 1; } else { if(dini_Exists(file)) { tmp2 = dini_Get(file, "Password"); if(udb_hash(tmp) != strval(tmp2)) { SendClientMessage(playerid, eadmin, "Login Failed!"); GetPlayerName(playerid, PlayerName, sizeof(PlayerName)); printf("%s has failed to login", name); } else { gLogged[playerid] = 1; GivePlayerMoney(playerid, dini_Int(file, "Cash")); PlayerInfo[playerid][pLevel] = dini_Int(file, "Level"); PlayerInfo[playerid][pAdminLevel] = dini_Int(file, "AdminLevel"); PlayerInfo[playerid][pMuted] = dini_Int(file, "Muted"); PlayerInfo[playerid][pScore] = dini_Int(file, "Score"); SendClientMessage(playerid, eadmin, "[EADMIN]: Account Logged into!"); } return 1; } } }