20.09.2012, 13:01
Hey guys!
I want to change a name IG so I created a system where a dialog pops up and you can change a name after you entered the rank number (which is stored in the PVaR). that works but saving and loading the name goes wrong!
Here's the code:
At Dialog:
The savefactions function:
And last but not least the loading function:
Another weird thing. When SaveFactions is called, the fleader goes to default instead of saving the name of the player..
Anyone who can help me? This is a big problem :P.
I want to change a name IG so I created a system where a dialog pops up and you can change a name after you entered the rank number (which is stored in the PVaR). that works but saving and loading the name goes wrong!
Here's the code:
At Dialog:
Код:
new i = PlayerInfo[playerid][pFaction]; if(GetPVarInt(playerid, "FrankEdit") == 1) { strcat(FactionInfo[i][fRank1], inputtext); } SaveFactions(i);
Код:
stock SaveFactions(id) { new dFile[128]; format(dFile, sizeof(dFile),"Factions/%i.ini",id); new INI:File = INI_Open(dFile); INI_WriteString(File, "Name", FactionInfo[id][fName]); INI_WriteString(File, "fRank1", FactionInfo[id][fRank1]); INI_WriteString(File, "fRank2", FactionInfo[id][fRank2]); INI_WriteString(File, "fLeader", FactionInfo[id][fLeader]); INI_Close(File); return 1; }
Код:
forward LoadFactions(id, name[], value[]); public LoadFactions(id, name[], value[]) { INI_String("Name",FactionInfo[id][fName],529); INI_String("fLeader",FactionInfo[id][fLeader],256); INI_String("fRank1",FactionInfo[id][fRank1],256); INI_String("fRank2",FactionInfo[id][fRank2],256); return 1; }
Anyone who can help me? This is a big problem :P.