26.04.2011, 13:57
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
I then have this further down my script.
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.
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
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;
}
Thanks.