[Help]Dini, again
#1

Hi i need help with dini, again..

I've done this code practicing round with it

pawn Код:
#include <a_samp>
#include <zcmd>

public OnPlayerConnect(playerid)
{
    new file[50], Float:Armour;
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(file, sizeof(file), "%s.ini", name);
    if(!dini_Exists(file))
    {
      dini_Create(file);
      dini_FloatSet(file, "Armour", 0);
      printf("%s's file created", name);
    }
    else
    {
      Armour = dini_Float(file, "Armour");
      SetPlayerArmour(playerid, Armour);
      printf("%s's file loaded", name);
    }
    return 1;
}


COMMAND:atest(playerid, params[])
{
    SetPlayerArmour(playerid, 100);
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    new Float:Armour, file[50];
    GetPlayerArmour(playerid, Armour);
    dini_FloatSet(file, "Armour", Armour);
    return 1;
}
It does work getting the players armour on connect, but when leaving it doesnt set the new armour value...anyone know why?

Thanks
Reply


Messages In This Thread
[Help]Dini, again - by Dirty_bum - 18.11.2009, 03:10
Re: [Help]Dini, again - by Zeex - 18.11.2009, 03:30
Re: [Help]Dini, again - by Dirty_bum - 18.11.2009, 04:06
Re: [Help]Dini, again - by LarzI - 18.11.2009, 12:07

Forum Jump:


Users browsing this thread: 1 Guest(s)