[ Need help ] enums funtions
#1

Guys i need help using enums
not for players but for server

my problem is it will not save
and help me create file
i am using Y_INI please anyone can help me


Код:
enum sData
{
	sRich, // This will be for the Rich list command
}
new sFile[sData];
Код:
public Loadserver_data(name[],value[])
{
	INI_Int("RichMoney",sFile[sRich]);
	return 1;
}
and the command

Код:
CMD:setrichmoney(playerid,params[])
{
	if(pFile[playerid][pAdmin] >= OWNER || IsPlayerAdmin(playerid))
	{
	    new ammount;
        if(sscanf(params,"d",ammount)) return SendClientMessage(playerid,usage,"[ Usage ]: /setrichmoney [ "cmoney"$ ammount"cusage" ]");
       	sFile[sRich] = ammount;
        return 1;
	}
	return 1;
}
This one is for the package for them to create the data
Код:
CMD:package(playerid)
{
	if(IsPlayerAdmin(playerid))
	{
	    new INI:File = INI_Open(SPATH);
	    INI_WriteInt(File,"RichMoney",0);
	    INI_Close(File);
	    return 1;
	}
	return 1;
}
and my file location

Код:
#define             SPATH                       "/RicaNiel/ServerData/ServerSettings.ini"
It will compile successfully but when i test it In game it will not write and save
Reply
#2

anyone please help
Reply
#3

Is the file created?
Reply
#4

Well i don't know how to use Y_INI as i am familiarized with dini (I know is old) but i can help you giving you a tutorial that uses it. There was one named "Get Familiarized with Y_INI" but i don't find it. Take a look at this one...

https://sampforum.blast.hk/showthread.php?tid=273088
Reply
#5

Still same thing
i dont want to create enums for players
i want it for everyone or for server sided
and all admins can edit via command

if for player we use

Код:
PlayerFile[playerid][pAdmin] >= 10 || IsPlayerAdmin(playerid))
{
     return 1;
}
for server that would be for everyone it would be like this

Код:
Код:
ServerFile[LIMIT_PING] >= 600)     // this would detect if the ping is 600 or up
{
      Kick(playerid);   then would kick the player 
     return 1;
}
now all i want is that the 600 can be editable in game via admin commands
or shall we say dynamic admin system
and i am confused in it

i need help
i wish ****** can see this
Reply
#6

guys anyone help
Reply
#7

I think this:
pawn Код:
enum sData
{
    sRich, // This will be for the Rich list command
}
new sFile[sData];
Should be this:
pawn Код:
enum sData
{
    sRich, // This will be for the Rich list command
}
new sFile[MAX_PLAYERS][sData];
Reply
#8

NO NO not for players

i want like in LuxAdmin
server data will be saved in one folder
and will be editable in game
i want something like that
please anyone help me

not for players
for server only please
Reply
#9

guys anyone please
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)