Include For Admin System
#1

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

What kind of include do you mean?
Reply
#3

same like ladmin.inc
Reply
#4

If you want your own admin system, Script it.
And what do you mean, which .inc Do you have errors?
Reply
#5

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

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

Dude, why you would have this include ? you scripted your own FS, no need to include it.

- KillerDVX.
Reply
#8

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

Or create an AdminLevel's variable ?
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)