Two questions (y_INI + Vehicle system) -
roleplay500 - 23.05.2012
1. Does it possible to read information from one selected tag?
for example:
[character0]
level = 1
[character1]
level = 20
So how to read only from the [character1] tag? (the level...)
using y_INI
2. I wanted to make a dynamic vehicles system like LS-RPs or WC-RPs.
But before im starting, i wanted to ask if exist any vehicle system like these - so i won't work for free :/
Re: Two questions (y_INI + Vehicle system) -
leonardo1434 - 23.05.2012
can you be more clear? i don't get what you mean.
Re: Two questions (y_INI + Vehicle system) -
roleplay500 - 23.05.2012
Im trying to read from a selected tag '[...]' w/o reading the previous or next information.
My main problem is the information should be stored in a variable/array as PlayerInfo[playerid][Level].
So i can't make two sections, since only the last section will give me actual values.
Im meaning like, if its the sitauation
Im loading this way:
INI_Load("playername.ini");
Then im not sure, but thats what im asking, if i'll load this way
INI
layername[char0](name[], value[])
INI
layername[char1](name[], value[])
{
PlayerInfo[playerid][Level] = ini_...
}
Only the last will be loaded since i loaded the whole file.
Its possible to use it this way?
switch(character)
{
case 0:
INI
layername[char0](name[], value[])
case 1:
INI
layername[char1](name[], value[])
}
This is possible? since it's must be the only way,
Here i need your suggestion
EDIT: I thought for a solution,
If i'll make a variable like this.
new LoadedCharacter[MAX_PLAYERS];
I'll be able easily to avoid loading unnecessary data from file.
INI
layername[char0](name[], value[])
{
if(LoadedCharacter[playerid] == 0)
{
//then loading..
}
}
Correctt?
Re: Two questions (y_INI + Vehicle system) -
leonardo1434 - 23.05.2012
ff's, why you don't know how to express yourself?
Do you want save the player level i'am right?
Re: Two questions (y_INI + Vehicle system) -
roleplay500 - 23.05.2012
No, to READ from file.
Can't express myself better.
Anyway, I think i solved this, check previous post.
Re: Two questions (y_INI + Vehicle system) -
CharlieSanchez - 06.03.2014
Ok so i assume your using Ini files and Y_Ini, ok i am using the same system , so i use this for example:
GivePlayerCash(playerid,PlayerInfo[playerid][pCash]);
So it all depends on the way you did you Playerinfo Enum...The Most used is ..
enum pInfo
{
pLevel,
pCash,
pScore
}
new PlayerInfo[MAX_PLAYERS][pInfo];
//------- Load the User's data ------//
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
INI_Int("Level",PlayerInfo[playerid][pLevel]);
INI_Int("Cash",PlayerInfo[playerid][pCash]);
INI_Int("Score",PlayerInfo[playerid][pScore]);
return 1;
}
Hope that helps a bit.
Re: Two questions (y_INI + Vehicle system) -
Ada32 - 06.03.2014
i'm not sure why you bumped such an old topic but for anyone who wants to know how to use y_inis tag mechanism
https://sampforum.blast.hk/showthread.php?tid=485611