Not loading stats?
#2

Quote:
Originally Posted by Dr
View Post
Hello,

The player registers and everything is working fine, but then say I change their money in their .ini file to 5000, it does not load it...

Here is the parsefile:
pawn Code:
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
    INI_Int("Password",PlayerInfo[playerid][pPassword]);
    INI_Int("Bank",PlayerInfo[playerid][pBank]);
    INI_Int("Money",PlayerInfo[playerid][pMoney]);
    INI_Int("Gender",PlayerInfo[playerid][pGender]);
    INI_Int("Skin",PlayerInfo[playerid][pSkin]);
    INI_Int("Age",PlayerInfo[playerid][pAge]);
    INI_Int("Origin",PlayerInfo[playerid][pOrigin]);
    INI_Int("Accent",PlayerInfo[playerid][pAccent]);
    INI_Int("Job",PlayerInfo[playerid][pJob]);
    INI_Int("Faction",PlayerInfo[playerid][pFaction]);
    INI_Int("Rank",PlayerInfo[playerid][pRank]);
    INI_Int("License",PlayerInfo[playerid][pLicense]);
    INI_Int("Cocaine",PlayerInfo[playerid][pCocaine]);
    INI_Int("Marijuana",PlayerInfo[playerid][pMarijuana]);
    INI_Int("Donater",PlayerInfo[playerid][pDonater]);
    INI_Int("DonaterPoints",PlayerInfo[playerid][pDonaterPoints]);
    INI_Int("Watch",PlayerInfo[playerid][pWatch]);
    INI_Int("Phone",PlayerInfo[playerid][pPhone]);
    INI_Int("PhoneNumber",PlayerInfo[playerid][pPhoneNumber]);
    INI_Int("Cigars",PlayerInfo[playerid][pCigars]);
    INI_Int("Lighter",PlayerInfo[playerid][pLighter]);
    INI_Int("Mask",PlayerInfo[playerid][pMask]);
    INI_Int("JailTime",PlayerInfo[playerid][pJailTime]);
    INI_Int("Gun01",PlayerInfo[playerid][pGun01]);
    INI_Int("Ammo01",PlayerInfo[playerid][pAmmo01]);
    INI_Int("Gun02",PlayerInfo[playerid][pGun02]);
    INI_Int("Ammo02",PlayerInfo[playerid][pAmmo02]);
    INI_Int("Gun03",PlayerInfo[playerid][pGun03]);
    INI_Int("Ammo03",PlayerInfo[playerid][pAmmo03]);
    INI_Int("Gun04",PlayerInfo[playerid][pGun04]);
    INI_Int("Ammo04",PlayerInfo[playerid][pAmmo04]);
    INI_Int("Gun05",PlayerInfo[playerid][pGun05]);
    INI_Int("Ammo05",PlayerInfo[playerid][pAmmo05]);
    INI_Int("Gun06",PlayerInfo[playerid][pGun06]);
    INI_Int("Ammo06",PlayerInfo[playerid][pAmmo06]);
    INI_Int("Gun07",PlayerInfo[playerid][pGun07]);
    INI_Int("Ammo07",PlayerInfo[playerid][pAmmo07]);
    INI_Int("Gun08",PlayerInfo[playerid][pGun08]);
    INI_Int("Ammo08",PlayerInfo[playerid][pAmmo08]);
    INI_Int("Gun09",PlayerInfo[playerid][pGun09]);
    INI_Int("Ammo09",PlayerInfo[playerid][pAmmo09]);
    INI_Int("Gun11",PlayerInfo[playerid][pGun11]);
    INI_Int("Ammo11",PlayerInfo[playerid][pAmmo11]);
    INI_Int("Registered",PlayerInfo[playerid][pRegistered]);
    return 1;
}
Why would you change money Via .ini. Dont be cheap and make a command.

SSCANF is the way to go for making this kind of command.

I will show you mine. (You can have it if you want)

pawn Code:
CMD:givecash(playerid,params[])
{
    if(PlayerInfo[playerid][pAdminLevel] >=2)
    {
        new
            id,
            amount;
        new Str[64];
        if(sscanf(params, "ud", id, amount)) SendClientMessage(playerid,COLOR_RED,"Usage: /givecash <ID> <Amount>");
        else if(id == INVALID_PLAYER_ID) SendClientMessage(playerid,COLOR_RED,"Error: Player Not Connected!");
        else
        {
            new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
            GetPlayerName(playerid, name, sizeof(name));
            GetPlayerName(id, PlayerName, sizeof(PlayerName));
            GivePlayerMoney(id,amount);
            new str[40+MAX_PLAYER_NAME];
            format(str, sizeof(str), "You have sent %d to %s(ID:%d)",amount,PlayerName,id);
            SendClientMessage(playerid, COLOR_GREEN, str);
            format(str, sizeof(str), "Admin:%s(ID:%d)Has gave you %d!",name,id,amount);
            SendClientMessage(id, COLOR_GREEN, str);
            SaveToLog("Givecash_Log.txt", Str);
            }
        return 1;
        }
    else return SendClientMessage(playerid, COLOR_RED, " You are not allowed to use this command");
}
This is for admins only.
Reply


Messages In This Thread
Not loading stats? - by Dr - 03.08.2011, 22:07
Re: Not loading stats? - by Shockey HD - 03.08.2011, 22:10
Re: Not loading stats? - by Kush - 03.08.2011, 22:11
Re: Not loading stats? - by Dr - 03.08.2011, 22:12
Re: Not loading stats? - by Kush - 03.08.2011, 22:38
Re: Not loading stats? - by PrawkC - 03.08.2011, 23:07
Re: Not loading stats? - by Calgon - 03.08.2011, 23:07
Re: Not loading stats? - by Dr - 03.08.2011, 23:24
Re: Not loading stats? - by Calgon - 03.08.2011, 23:26
Re: Not loading stats? - by Dr - 04.08.2011, 01:54

Forum Jump:


Users browsing this thread: 2 Guest(s)