Two questions (y_INI + Vehicle system)
#1

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 :/
Reply
#2

can you be more clear? i don't get what you mean.
Reply
#3

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

INIlayername[char0](name[], value[])
INIlayername[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:
INIlayername[char0](name[], value[])
case 1:
INIlayername[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.

INIlayername[char0](name[], value[])
{
if(LoadedCharacter[playerid] == 0)
{
//then loading..
}
}

Correctt?
Reply
#4

ff's, why you don't know how to express yourself?

Do you want save the player level i'am right?
Reply
#5

No, to READ from file.

Can't express myself better.

Anyway, I think i solved this, check previous post.
Reply
#6

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.
Reply
#7

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)