Include For Admin System -
Harith - 09.09.2015
Hi Guys I'm Have A Own Admin System I'm Trying To Making Include For My Admin System But FAIL I Need Your Help I Want Make The Include That I Can Use It On My Other FS Any Idea? Please Help Me
Re: Include For Admin System -
saffierr - 09.09.2015
What kind of include do you mean?
Re: Include For Admin System -
Harith - 09.09.2015
same like ladmin.inc
Re: Include For Admin System -
saffierr - 09.09.2015
If you want your own admin system, Script it.
And what do you mean, which .inc Do you have errors?
Re: Include For Admin System -
Harith - 09.09.2015
Quote:
Originally Posted by saffierr
If you want your own admin system, Script it.
|
Lol No I'm Not I Already Have My Own But I Need A Include Same Like Ladmin.inc
Re: Include For Admin System -
Harith - 09.09.2015
Quote:
Originally Posted by saffierr
If you want your own admin system, Script it.
And what do you mean, which .inc Do you have errors?
|
No Error But It 100% Not Working
Re : Include For Admin System -
KillerDVX - 09.09.2015
Dude, why you would have this include ? you scripted your own FS, no need to include it.
- KillerDVX.
Re: Re : Include For Admin System -
Gammix - 09.09.2015
Quote:
Originally Posted by KillerDVX
Dude, why you would have this include ? you scripted your own FS, no need to include it.
- KillerDVX.
|
No, includes for admin scripts are required if someone is interested in integrating the admin system with other scripts and especially for gamemodes.
OT:
In order to make an include, you need to study your database structure, assuming you are known to such things as you coded the admin script. There is no problem in making one. You may also use PVars (
https://sampwiki.blast.hk/wiki/Per-player_variable_system) only if your admin system is using it, using PVars will increase the reading and writing speed, overall performance and there would be no hassle of database structuring as well.
But in order to read player stats and records, use your database functions.
For example you are using easydb.inc, i can make a simple player admin level reader:
pawn Код:
stock GetPlayerAdminLevel(playerid) {
new
t_sName[MAX_PLAYER_NAME],
t_iKey
;
GetPlayerName(playerid, t_sName, MAX_PLAYER_NAME);
t_iKey = DB::RetrieveKey(user_table, "username", t_sName);
if (t_iKey != DB::INVALID_KEY) {
return DB::GetIntEntry(user_table, t_iKey, "admin");
}
return 0;
}
This will read the column "adminlevel" from the specified table from a SQLITE database.
In case you are using dini:
pawn Код:
stock GetPlayerAdminLevel(playerid) {
new
t_sName[MAX_PLAYER_NAME],
t_sPath[MAX_PLAYER_NAME + 20]
;
GetPlayerName(playerid, t_sName, MAX_PLAYER_NAME);
strcat(t_sPath, "AdminPath/");
strcat(t_sPath, t_sName);
strcat(t_sPath, ".ini");
if (! dini_Exists(t_sPath)) {
return 0;
}
return dini_Int(t_sPath, "adminlevel");
}
Reading the value from ini file(player name) situated in "AdminPath" folder.
Re : Include For Admin System -
KillerDVX - 09.09.2015
Or create an AdminLevel's variable ?
Re: Re : Include For Admin System -
Gammix - 09.09.2015
Quote:
Originally Posted by KillerDVX
Or create an AdminLevel's variable ?
|
You cannot access variables across multiple platforms (create a variable in filterscript, how would you read the value from gamemode?), that's why we have PVars and SVars.