admin include
#1

i have one question...how to make an admin.inc so i can access to if(PlayerInfo[playerid][pAdmin] >= 1) without any problem if i want to make a filterscript that need to know if player is admin...
i use y_ini for ini read/write...

this is the user data example
Код:
[data]
Password = 0
Cash = 0
Admin = 0
Kills = 0
Deaths = 0
Vip = 0
Banned = 0
i have a filterscript called antispam that mute the player if the player spam...i want to include /mute command for admin directly in that filterscript...
Reply
#2

and one more thing..my user data path is "scriptfiles\Users"
Reply
#3

pawn Код:
enum pInfo
{
    pAdmin
}
new PlayerInfo[MAX_PLAYERS][pInfo];
Reply
#4

can you make a whole code..not just a piece of code
Reply
#5

Well, that will apply to you to type PlayerInfo[playerid][pAdmin];.
Example:
pawn Код:
CMD:makeadmin(playerid, params[])
{
     new playerb, adminlevel;
     if(PlayerInfo[playerid][pAdmin] == 4) return SendClientMessage(playerid, 0, "You can't use this command!");
     if(sscanf(params, "ui", playerb, adminlevel)) return SendClientMessage(playerid, 0, "/makeadmin [playerid] [adminlevel]");
     {
                  PlayerInfo[playerb][pAdmin] = adminlevel;
                  }
     return 1;
}
Reply
#6

Ah, I just understood what you meant, if you want to use filterscript for admin commands, you need to make new admin system in the filterscript.
Or you just can use rcon in the filterscript.
pawn Код:
if(IsPlayerAdmin(playerid)
Reply
#7

i know but this is not rcon admin...but custom admin..
Reply
#8

please read my description below carefully..i want to make an include file for admin so when i create new filterscript, i can easily use if(PlayerInfo[playerid][pAdmin] >= 1) without reading the ini file and it will reading through the include file (e.g admin.inc)..
Reply
#9

INCLUDE FILE e.g: zcmd.inc,admin,inc,y_ini.inc like that
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)