Little help
#1

Hello.
I am using zcmd,sscanf to make some commands...
I have some questions

1.I have enum PInfo with
pDeaths,
pKills
pCash,
How do I make it load on player LOGIN? I want it to load values from enums
Reply
#2

First you need to save stuff ,then load.
There is multiple ways of saving/loading variables ,but if you are a beginner i recommend dini.
****** it...
Reply
#3

Using
Код:
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
pawn Код:
enum PInfo
{
pDeaths,
pKills
pCash,
}
new PlayerInfo[MAX_PLAYERS][PInfo];

forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
 
    INI_Int("Cash",PlayerInfo[playerid][pCash]);
    INI_Int("Kills",PlayerInfo[playerid][pKills]);
    INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
    return 1;
}
stock UserPath(playerid)
{
    new string[128],playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid,playername,sizeof(playername));
    format(string,sizeof(string),"/YOURPATH/%s.ini",playername);
    return string;
}
public OnPlayerConnect(playerid)
{
    if(fexist(UserPath(playerid)))//Login
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);

//And all other code
Reply
#4

[MM]RoXoR[FS],Thanks Helped me REP ++
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)