09.09.2015, 11:05
Quote:
Dude, why you would have this include ? you scripted your own FS, no need to include it.
- KillerDVX. |
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;
}
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");
}