Help With Locking Skins
#1

Hello, Well I need help with locking a group of skins so only official members can use them.

My server has a tag system and a skin selection.(Ask for more information if it will be needed)

Lets take LSPD for example: In my script I made a enum for all skin categories, official LSPD members skin is called LSPD and Unofficial skins(cadet) are called Cadet. Now I wonder if there is any way to lock the LSPD skins only for those players who will have an official [LSPD] tag on the server(name check), if the name does not have the tag it shouldent allow the player to use an official LSPD skin(which leaves him only a Cadet skin to use)

I hope you understood what im trying to ask for here, thank you.
Reply
#2

Hello,
Replace (IsPlayerAdmin) With your administration variables.
Thank You!
The code below will be on (OnPlayerRequestClass)
pawn Код:
case 0,2,1,4,5(Replace these with your skin's):
      {
       if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"You are not authorized to use this command!");
        Or If You want Other Skin'
s To Not Use This Then
        if(gTeam[playerid] == (Other Teams)) return SendClientMessage(playerid,-1,"Choose Other Skin, These Are For Official Members Only!
    SetPlayerColor(playerid,0x8EEE7DFF);
        SetPlayerVirtualWorld(playerid,1);
        SetPlayerInterior(playerid,0);
        SetPlayerPos(playerid, 2239.9063,-1641.9432,15.5267);
        SetPlayerFacingAngle(playerid, 151.7758);
        SetPlayerCameraPos(playerid, 2237.3972,-1646.6178,16.3376);
        SetPlayerCameraLookAt(playerid, 2239.9063,-1641.9432,15.5267);
    GameTextForPlayer(playerid, "
Admins!", 500, 3);
    ApplyAnimation(playerid,"
SMOKING", "M_smklean_loop", 4.0, 1, 0, 0, 0, 0);
    gTeam[playerid] = TEAM_ADMINS; ( Used team_admins as an example, replace it with your administration team)
      }
Reply
#3

That dosent help me much.
Reply
#4

Well, for example if you have a command like /buyskin then this should be your code.

pawn Код:
cmd(buyskin, playerid, params[])
{
    new skinid;
    if(skinid == IDHERE || skinid == IDHERE || skinid  == IDHERE) return SendClientMessage(playerid, -1,"The skin you have selected is for LSPD only"); //Add the skins to this line
    SetPlayerSkin(playerid, skinid);
}
Try this.
Reply
#5

Quote:
Originally Posted by JhnzRep
Посмотреть сообщение
Well, for example if you have a command like /buyskin then this should be your code.

pawn Код:
cmd(buyskin, playerid, params[])
{
    new skinid;
    if(skinid == IDHERE || skinid == IDHERE || skinid  == IDHERE) return SendClientMessage(playerid, -1,"The skin you have selected is for LSPD only"); //Add the skins to this line
    SetPlayerSkin(playerid, skinid);
}
Try this.
He did not mentioned any /Buyskin command...
Reply
#6

Quote:
Originally Posted by Littlehelper[MDZ]
Посмотреть сообщение
He did not mentioned any /Buyskin command...
Yes I know, but what I meant by that, is to put that into the command or what ever he wants it in.
Reply
#7

You guys didnt understand me I guess, the things you posted here still wont solve my problem.

My problem is that alot of newbies come to the server take official PD skins(which is not allowed in rules) and start to DM, so I want to make a name check while the player is in skin selection, if the player has the [LSPD]Name tag then he can spawn with LSPD skins and if he has no official tag he will be able to use only Cadet skins.
Reply
#8

Try playing around with this.

pawn Код:
{
new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    for(new i = 0; i < MAX_PLAYER_NAME; i++)
    {
        if(name[i] != '[LSPD]')
    }
}
EDIT: Post me your class selection code, I will try to shape it up for you.
Reply
#9

Here Official LSPD skins:
Код:
case 58..64:
		{
		GangInfo[playerid][LSPD] = 1;
        GangInfo[playerid][Cadet] = 0;
		GangInfo[playerid][CRASH] = 0;
		if(IsPlayerNPC(playerid)) return 1;
		SetPlayerPos(playerid, 1539.4164,-1675.2948,13.5469);
		SetPlayerFacingAngle(playerid,100.0);
		SetPlayerCameraPos(playerid, 1535.5811,-1675.2346,13.3828);
		SetPlayerCameraLookAt(playerid, 1539.4164,-1675.2948,13.5469);
  		ApplyAnimation(playerid,"ped", "ARRESTgun", 4.0, 0, 1, 1, 1, -1, 1);
		GameTextForPlayer(playerid, "~b~Los Santos Police Department", 2000, 6);
		SetPlayerColor(playerid,0x0000BBAA);
		}
Reply
#10

pawn Код:
{
new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    for(new i = 0; i < MAX_PLAYER_NAME; i++)
    {
        if(name[i] == '[LSPD]')
       {
            GangInfo[playerid][LSPD] = 1;
        GangInfo[playerid][Cadet] = 0;
        GangInfo[playerid][CRASH] = 0;
        if(IsPlayerNPC(playerid)) return 1;
        SetPlayerPos(playerid, 1539.4164,-1675.2948,13.5469);
        SetPlayerFacingAngle(playerid,100.0);
        SetPlayerCameraPos(playerid, 1535.5811,-1675.2346,13.3828);
        SetPlayerCameraLookAt(playerid, 1539.4164,-1675.2948,13.5469);
        ApplyAnimation(playerid,"ped", "ARRESTgun", 4.0, 0, 1, 1, 1, -1, 1);
        GameTextForPlayer(playerid, "~b~Los Santos Police Department", 2000, 6);
        SetPlayerColor(playerid,0x0000BBAA);
        }
    }
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)