PDA

View Full Version : Mask Code Saving


hhaaoo123
17/02/2015, 12:28 PM
I have made a mask system that when the player type /mask, it will give the player something like this
"Stranger 55555" the problem is when I take off the mask and put it back, the mask name will be changed to another number. Any idea to save the mask name? I did save the "MaskName" , but it's not saving the mask name.

OnPlayerLogin
if(strcmp(key , "MaskName" , true) == 0) { val = Ini_Value(Data); strmid(PlayerInfo[playerid][pMaskName], val, 0, strlen(val)-1, 255); }

OnPlayerRegister
format(var, 32, "MaskName=%d\n",PlayerInfo[playerid][pMaskName]);fwrite(hFile, var);

OnPlayerConnect
strmid(PlayerInfo[playerid][pMaskName], "None", 0, strlen("None"), 255);

StatsUpdate
format(var, 32, "MaskName=%d\n",PlayerInfo[playerid][pMaskName]);fwrite(hFile, var);

Kaperstone
17/02/2015, 01:22 PM
First of all, why don't you save it into an array if he already put the mask on once before ? Faster and less load on the server when he tries to put a mask on.

Second, try to print the "PlayerInfo[playerid][pMaskName]" and "var" when he puts the mask on.
then just search for that print on the server console.
if everything is fine, then you're fetching the mask name not correctly.

hhaaoo123
18/02/2015, 02:35 AM
Anyone help please? Still not saving?