Admin Skin
#1

I am having problems creating a skin only for admins to use.

Here are the codes I have so far.

I have this under GameModeInit
pawn Код:
//Adminstator Skin
    AddPlayerClass(294,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); // Adminstators Skin
I then have this further down my script.
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    GetPlayerSkin(playerid);
    if(IsPlayerAdmin(playerid))
    {
          if(classid == 294)
          {
        SendClientMessage(playerid, 0xB60000FF, "Welcome Admin");
     }
     else
     {
        GameTextForPlayer(playerid, "You aren't an Admin!", 5000, 5);
        return 0;
   }
}
    SetupPlayerForClassSelection(playerid);
    return 1;
}
It all compiles correctly but when I go in-game to test it, the skin doesnt say Welcome Admin when we select it and anybody can select it, I only want admins to be able to use it.

Thanks.
Reply
#2

You would be better off checking under "OnPlayerSpawn" what skin the player has. If the skin ID matches the one you are hoping to make an "admin only" skin, then force them to choose a new skin. Of course, if they are an administrator, send the message and leave them be. Next time, search before you post.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)