AdminSkins
From SA-MP Wiki
Contents |
Admin skins
This tutorial will help you make certain skins OR classes, only for RCON admins!
By Class
This part of the tutorial will help you make a certain class be for RCON admins only.
Create the class
For this example, we will add classes 0-5.
AddPlayerClass(0,X,Y,Z,0.0,0,0,0,0,0,0); //Class 0 AddPlayerClass(60,X,Y,Z,0.0,0,0,0,0,0,0); //Class 1 AddPlayerClass(99,X,Y,Z,0.0,0,0,0,0,0,0); //Class 2 AddPlayerClass(84,X,Y,Z,0.0,0,0,0,0,0,0); //Class 3 AddPlayerClass(92,X,Y,Z,0.0,0,0,0,0,0,0); //Class 4 AddPlayerClass(280,X,Y,Z,0.0,0,0,0,0,0,0); //Class 5
Save the class in an array
We will use OnPlayerRequestSpawn to stop people using this skin. This is how you can get the classid
new pClass[MAX_PLAYERS]; public OnPlayerRequestClass(playerid, classid) { pClass[playerid] = classid; //Save the players classid to the array to use later. return 1; }
Deny the request
For this example, class 2 will be for admins only!
public OnPlayerRequestSpawn(playerid) { if(pClass[playerid] == 2 && !IsPlayerAdmin(playerid)) { SendClientMessage(playerid,COLOR_RED,"This skin is for RCON admins only!"); return 0; } return 1; }
By Skin
This part of the tutorial will help you make a certain skin ID be for RCON admins only.
Deny the request
This is alot easier than the other one!
For this example, skin ID 0 (CJ) will be for RCON admins only.
public OnPlayerRequestSpawn(playerid) { if(GetPlayerSkin(playerid) == 0 && !IsPlayerAdmin(playerid)) { return 0; } return 1; }