admin include - 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: admin include (
/showthread.php?tid=576992)
admin include -
Armageddonz - 08.06.2015
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...
Re: admin include -
Armageddonz - 08.06.2015
and one more thing..my user data path is "scriptfiles\Users"
Re: admin include -
Rabea - 08.06.2015
pawn Код:
enum pInfo
{
pAdmin
}
new PlayerInfo[MAX_PLAYERS][pInfo];
Re: admin include -
Armageddonz - 08.06.2015
can you make a whole code..not just a piece of code
Re: admin include -
Rabea - 08.06.2015
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;
}
Re: admin include -
Rabea - 08.06.2015
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)
Re: admin include -
Armageddonz - 08.06.2015
i know but this is not rcon admin...but custom admin..
Re: admin include -
Armageddonz - 08.06.2015
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)..
Re: admin include -
Armageddonz - 08.06.2015
INCLUDE FILE e.g: zcmd.inc,admin,inc,y_ini.inc like that