SA-MP Forums Archive
[Help] Restricted skins on skin selection to factions - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [Help] Restricted skins on skin selection to factions (/showthread.php?tid=554687)



[Help] Restricted skins on skin selection to factions - freddiebox - 04.01.2015

Hello,

Is there a better way to restrict faction skins on skin selection than as follows?

I have this set under OnPlayerRequestSpawn:
pawn Код:
if(GetPlayerSkin(playerid) == 280 || GetPlayerSkin(playerid) == 281 || GetPlayerSkin(playerid) == 265 || GetPlayerSkin(playerid) == 266 || GetPlayerSkin(playerid) == 267 || GetPlayerSkin(playerid) == 284 || GetPlayerSkin(playerid) == 285)
        {
            if(PlayerInfo[playerid][pFaction] != 1)
            {
                SendClientMessage(playerid, COLOR_LIGHTRED, " {FF6347}ERROR:{FF6347} {F0F8FF}Locked faction skin.{F0F8FF}");
                return 0;
            }
            else
            {
                return 1;
            }
        }
The annoying issue with this is that when someone press spawn the error mesage will spam the player while they keep the spawn key pressed. Other than that, it works relatively good. But like I said, better way to restrict faction skins?


Re: [Help] Restricted skins on skin selection to factions - ikkentim - 04.01.2015

Try y_classes


Re: [Help] Restricted skins on skin selection to factions - freddiebox - 05.01.2015

Quote:
Originally Posted by ikkentim
Посмотреть сообщение
Try y_classes
Thanks for the response. I've been looking into y_classes but I just can't get any smarter at it. Could you give me a small example how it would benefit my situation?


Re: [Help] Restricted skins on skin selection to factions - Nitin - 05.01.2015

Well, make it like "new factionrank=0;" and then "OnPlayerRequestClass - if factionrank=0;" Use "if" and make it like that, and it may help you.