SA-MP Forums Archive
[ Need help ] enums funtions - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [ Need help ] enums funtions (/showthread.php?tid=317354)



[ Need help ] enums funtions - RicaNiel - 11.02.2012

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


Re: [ Need help ] enums funtions - RicaNiel - 11.02.2012

anyone please help


Re: [ Need help ] enums funtions - KingHual - 11.02.2012

Is the file created?


Re : [ Need help ] enums funtions - ricardo178 - 11.02.2012

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


Re: [ Need help ] enums funtions - RicaNiel - 11.02.2012

Quote:
https://sampforum.blast.hk/showthread.php?tid=273088
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


Re: [ Need help ] enums funtions - RicaNiel - 11.02.2012

guys anyone help


Re: [ Need help ] enums funtions - thimo - 11.02.2012

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];



Re: [ Need help ] enums funtions - RicaNiel - 11.02.2012

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


Re: [ Need help ] enums funtions - RicaNiel - 11.02.2012

guys anyone please