IsPlayerAdmin [HELP]!!!!
#1

Hello,
Im scripting a adminhq for my server. But i want ONLY regular administrators allowed not only RCON.
This is what i have. Only work if im logged in as RCON. But i want it to work with regular admins.
p.s- Im using LuxAdmin

This is my code.
Код:
if(strcmp(cmdtext,"/adminhq",true)==0)
{
if(!IsPlayerAdmin(playerid)) return 1;
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,-1201.8862,-1000.5042,128.9680);
GameTextForPlayer(playerid,"~g~Admin ~r~House ~p~!!!",4000,6);
new string[256], pname[MAX_PLAYER_NAME];
return 1;
}
Reply
#2

If players are to create accounts for your server,

add something like this into your enum:

pawn Код:
PlayerInfo[playerid][pAdmin]
this would determine whether the player is an admin or not.

then on your admin HQ, add this:

pawn Код:
if(PlayerInfo[playerid][pAdmin] > 0)
{
    SetPlayerInterior(playerid,0);
    SetPlayerPos(playerid,-1201.8862,-1000.5042,128.9680);
    GameTextForPlayer(playerid,"~g~Admin ~r~House ~p~!!!",4000,6);
    new string[256], pname[MAX_PLAYER_NAME];
    return 1;
}
Reply
#3

Where do i put "PlayerInfo"?
Do i just plug
if(PlayerInfo[playerid][pAdmin] > 0)
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,-1201.8862,-1000.5042,128.9680);
GameTextForPlayer(playerid,"~g~Admin ~r~House ~p~!!!",4000,6);
new string[256], pname[MAX_PLAYER_NAME];
return 1;
}



?
Reply
#4

Alvord you are wrong

it would be something like this

pawn Код:
if(PlayerInfo[playerid][pAdmin] > 1)
DarioKelc make a enum something like

pawn Код:
enum pInfo
{
     pAdmin,
};
new PlayerInfo[MAX_PLAYERS][pInfo];
that should work

EDIT:

if you want to add a message if player is not administrator you will just do like this

pawn Код:
if(PlayerInfo[playerid][pAdmin] > 1)
{
      //codes
}
else return SendClientMessage(playerid, COLOR_ERROR, "You are not Administrator!");
Reply
#5

Im sorry, Im am VERY noob at this.

Where do i plug the enum?
and playerinfo?


?
Reply
#6

put the enum after the #include <a_samp> or after the other #includes

then do Alvord said.
Reply
#7

At the top before OnGamemodeinit.
Reply
#8

Quote:
Originally Posted by Reklez
Посмотреть сообщение
Alvord you are wrong
How is he wrong? Most scripts that uses an administration system have their admin rank start from 1. Regular players would stay as 0 for that matter. Even if that's not the case, there's nothing wrong with what he posted.
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)