23.08.2011, 14:01
I am using Xtreme Admin and I have this function in XtremeAdmin.inc:
This function works fine in the FilterScript. But I want to use it in my GameMode:
But the problem is, the game mode script doesn't recognise me as an admin. The filterscript works fine, but I wanna use this function in my Gamemode...
pawn Code:
stock IsPlayerXAdmin(playerid) return (Variables[playerid][LoggedIn] && Variables[playerid][Level]) ? true:false;
pawn Code:
#include "xadmin/XtremeAdmin.inc"
pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/help", cmdtext, true, 10) == 0)
{
if(IsPlayerXAdmin(playerid))
{
SendClientMessage(playerid,orange,"You are an admin");
}
else
{
SendClientMessage(playerid,orange,"You are not an admin");
}
return 1;
}
return 0;
}