17.06.2010, 17:11
I made this little Dialog Login/Register system. All works fine - there's just 1 problem. The code doesn't create the *.ini file. I tried run as administrator, but that didn't work as well. Can someone please tell me how to fix this issue?
- Yes I do have Includes. Dini & dudb
Also I need help with a few warnings:
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == 0) { if (response) { new Pname[MAX_PLAYER_NAME]; GetPlayerName(playerid, Pname, sizeof(Pname)); format(File, sizeof(File), "\\Users\\%s.ini", Pname); dini_Create(File); dini_IntSet(File, "HashPW", udb_hash(inputtext)); dini_Set(File, "Password", inputtext); dini_IntSet(File, "AdminLevel",PlayerInfo[playerid][AdminLevel] = 0); dini_IntSet(File, "Score", PlayerInfo[playerid][Score] = 0); dini_IntSet(File, "Money", PlayerInfo[playerid][Cash] = 500); Logged[playerid] = 1; } else { new Pname[MAX_PLAYER_NAME]; GetPlayerName(playerid, Pname, sizeof(Pname)); SendClientMessageToAll(Warning, "%s was kicked by AutoAdmin: Failed to register.", Pname); Kick(playerid); } return 1; } if(dialogid == 1) // LoginBox { if (response) { new Pname[MAX_PLAYER_NAME]; GetPlayerName(playerid, Pname, sizeof(Pname)); format(File, sizeof(File), "\\Users\\%s.ini", Pname); new TMP; TMP = dini_Int(File, "HashPW"); if(udb_hash(inputtext) != TMP) { SendClientMessageToAll(Warning, "%s was kicked by AutoAdmin: Failed to input vailed password.", Pname); Kick(playerid); } else { Logged[playerid] = 1; PlayerInfo[playerid][AdminLevel] = dini_Int(File, "AdminLevel"); SetPlayerScore(playerid, PlayerInfo[playerid][Score]); GivePlayerMoney(playerid, dini_Int(File, "Money")-GetPlayerMoney(playerid)); } } else { new Pname[MAX_PLAYER_NAME]; GetPlayerName(playerid, Pname, sizeof(Pname)); SendClientMessageToAll(Warning, "%s was kicked by AutoAdmin: Failed to login.", Pname); Kick(playerid); } } return 0; }
Also I need help with a few warnings:
Quote:
C:\Users\Mikkel Petersen\Documents\CityLifeRoleplay.pwn(130) : warning 202: number of arguments does not match definition C:\Users\Mikkel Petersen\Documents\CityLifeRoleplay.pwn(147) : warning 202: number of arguments does not match definition C:\Users\Mikkel Petersen\Documents\CityLifeRoleplay.pwn(162) : warning 202: number of arguments does not match definition C:\Users\Mikkel Petersen\Documents\CityLifeRoleplay.pwn(166) : warning 217: loose indentation Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Warnings. |