How to do this in y_ini?
#1

What equals this in y_ini?

SetPlayerScore(playerid, dini_Int(file, "Score"));
SetPlayerMoney(playerid, dini_Int(file, "Cash"));
Reply
#2

pawn Код:
INI:ininame(name[], value[])
{
    if (!strcmp(name, "Score"))
    {
        SetPlayerScore(playerid, value);
    }
    //or
    //new cash, score;
    //INI_Int("Score", score);
    //INI_Int("Cash", cash);
    //SetPlayerCash(playerid, cash);
    //SetPlayerScore(playerid, score);
    if (!strcmp(name, "Cash"))
    {
        SetPlayerMoney(playerid, value);
    }
    return 1;
}
Reply
#3

Quote:
Originally Posted by maramizo
Посмотреть сообщение
pawn Код:
INI:mine[examples](name[], value[])
{
    if (!strcmp(name, "Score"))
    {
        SetPlayerScore(playerid, value);
    }
    if (!strcmp(name, "Cash"))
    {
        SetPlayerMoney(playerid, value);
    }
    return 1;
}
So I can't do it like I just did in DINI? To simply set it under the loading?
This is how I have it now when someone logins
pawn Код:
PlayerData[playerid][pAdmin] = dini_Int(file, "Admin");
PlayerData[playerid][pPlayTime] = dini_Int(file, "PlayTime");
SetPlayerScore(playerid, dini_Int(file, "Score"));
SetPlayerMoney(playerid, dini_Int(file, "Cash"));
In Y_INI it has to be
pawn Код:
INI_Int("Admin", PlayerData[playerid][pAdmin]);
INI_Int("PlayTime", PlayerData[playerid][pPlayTime]);
INI_Int("Score", PlayerData[playerid][pScore]);
INI_Int("Cash", PlayerData[playerid][pCash]);
SetPlayerScore(playerid, PlayerData[playerid][pScore]);
SetPlayerMoney(playerid, PlayerData[playerid][pCash]);
Would this work
pawn Код:
SetPlayerScore(playerid, INI_Int("Score"));
SetPlayerMoney(playerid, INI_Int("Cash"));
Reply
#4

Quote:
Originally Posted by 101
Посмотреть сообщение
Would this work
pawn Код:
SetPlayerScore(playerid, INI_Int("Score"));
SetPlayerMoney(playerid, INI_Int("Cash"));
Negative.
Reply
#5

Quote:
Originally Posted by 101
Посмотреть сообщение
So I can't do it like I just did in DINI? To simply set it under the loading?
This is how I have it now when someone logins
pawn Код:
PlayerData[playerid][pAdmin] = dini_Int(file, "Admin");
PlayerData[playerid][pPlayTime] = dini_Int(file, "PlayTime");
SetPlayerScore(playerid, dini_Int(file, "Score"));
SetPlayerMoney(playerid, dini_Int(file, "Cash"));
In Y_INI it has to be
pawn Код:
INI_Int("Admin", PlayerData[playerid][pAdmin]);
INI_Int("PlayTime", PlayerData[playerid][pPlayTime]);
INI_Int("Score", PlayerData[playerid][pScore]);
INI_Int("Cash", PlayerData[playerid][pCash]);
SetPlayerScore(playerid, PlayerData[playerid][pScore]);
SetPlayerMoney(playerid, PlayerData[playerid][pCash]);
Would this work
pawn Код:
SetPlayerScore(playerid, INI_Int("Score"));
SetPlayerMoney(playerid, INI_Int("Cash"));
when you already know this -
SetPlayerScore(playerid, PlayerData[playerid][pScore]);
SetPlayerMoney(playerid, PlayerData[playerid][pCash]);

use it....and on disconnect save it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)