08.03.2015, 23:40
INI_WriteString is for writing new values on an INI file. So that is what will be made in the end:
And if he uses INI_SetTag it will be made like
You can either use INI_Load or INI_Parsefile to open a file for reading or editing.
Edited it a little bit, it gave me no errors while compiling. Try that and don't use INI_WriteString as the others say.
Also make sure that in your enumerator the size of Password is already set
Something like that.
Quote:
this is my config file
i tried your code,now it shows this in my file Password = 04C730B23159E2FA3B3148B8C3EC784EA8E0D62D11D44E5040 405E24440A554B376A54AAE82625B93C8804BF00666FA748A2 5DC198E30DE6025BE9DC09C3B717 [Player's Data] Password = 0AA2336AC0A19C46864358E6F39FA9E48C252A705170CF4B7C A4F8A93C55960F93A156BFD81B9FBA286AFBC07E6B982D156D AD03AB250361CB8A503A673DFA13 AdminLevel = 7 Money = 0 Score = 0 Kill = 0 Death = 0 Mute = 0 Jail = 0 CMDMuted = 0 Crashed = 0 Crash = 0 |
Код:
[Player's Data] Password = 04C730B23159E2FA3B3148B8C3EC784EA8E0D62D11D44E5040405E24440A554B376A54AAE82625B93C8804BF00666FA748A25DC198E30DE6025BE9DC09C3B717 [Player's Data] Password = 0AA2336AC0A19C46864358E6F39FA9E48C252A705170CF4B7CA4F8A93C55960F93A156BFD81B9FBA286AFBC07E6B982D156DAD03AB250361CB8A503A673DFA13 AdminLevel = 7 Money = 0 Score = 0 Kill = 0 Death = 0 Mute = 0 Jail = 0 CMDMuted = 0 Crashed = 0 Crash = 0
Edited it a little bit, it gave me no errors while compiling. Try that and don't use INI_WriteString as the others say.
Код:
CMD:changepass(playerid,params[]) { new newstring[64], hashpass[129], newpass[32]; if(PInfo[playerid][Logged] == 0) return SendClientMessage(playerid,STEALTH_BLUE,"You need to be logged in first."); if(sscanf(params,"s[32]",newpass)) return SendClientMessage(playerid,STEALTH_BLUE,"USAGE: /changepass [new pass]"); format(newstring, sizeof(newstring), "You have successfully changed your password to %s",newpass); SendClientMessage(playerid,COLOR_PALEGREEN,newstring); WP_Hash(hashpass,sizeof(hashpass),newpass); format(PInfo[playerid][Password], 129, "%s", hashpass); INI_ParseFile(Path(playerid), "ChangePass", .bExtra = true, .extra = playerid); return 1; } forward ChangePass(playerid, name[], value[]); public ChangePass(playerid, name[], value[]) { INI_String("Password", PInfo[playerid][Password], 129); return 0; }
Код:
enum Example { Password[129] } new PInfo[MAX_PLAYERS][Example];