SA-MP Forums Archive
[HELP] Restrict certain skins to a faction - 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] Restrict certain skins to a faction (/showthread.php?tid=485704)



[HELP] Restrict certain skins to a faction - FreddeN93 - 05.01.2014

I have no clue if this actually is possible to perform, but this is pretty much what I'm trying to do. It's obviously wrong somewhere as it doesn't work.

pawn Код:
lspdskin1 = AddPlayerClass(280,1528.6588,-1677.7656,5.8906,270.3174,0,0,0,0,0,0);
    lspdskin2 = AddPlayerClass(211,1528.6588,-1677.7656,5.8906,270.3174,0,0,0,0,0,0);
    lspdskin3 = AddPlayerClass(281,1528.6588,-1677.7656,5.8906,270.3174,0,0,0,0,0,0);
    lspdskin4 = AddPlayerClass(265,1528.6588,-1677.7656,5.8906,270.3174,0,0,0,0,0,0);
    lspdskin5 = AddPlayerClass(266,1528.6588,-1677.7656,5.8906,270.3174,0,0,0,0,0,0);
    lspdskin6 = AddPlayerClass(267,1528.6588,-1677.7656,5.8906,270.3174,0,0,0,0,0,0);
    lspdskin7 = AddPlayerClass(284,1528.6588,-1677.7656,5.8906,270.3174,0,0,0,0,0,0);
    lspdskin8 = AddPlayerClass(285,1528.6588,-1677.7656,5.8906,270.3174,0,0,0,0,0,0);

    sasdskin1 = AddPlayerClass(71,611.0428,-585.4861,17.2266,178.7129,0,0,0,0,0,0);
    sasdskin2 = AddPlayerClass(282,611.0428,-585.4861,17.2266,178.7129,0,0,0,0,0,0);
    sasdskin3 = AddPlayerClass(211,611.0428,-585.4861,17.2266,178.7129,0,0,0,0,0,0);
    sasdskin4 = AddPlayerClass(283,611.0428,-585.4861,17.2266,178.7129,0,0,0,0,0,0);
    sasdskin5 = AddPlayerClass(288,611.0428,-585.4861,17.2266,178.7129,0,0,0,0,0,0);
    sasdskin6 = AddPlayerClass(287,611.0428,-585.4861,17.2266,178.7129,0,0,0,0,0,0);
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    if(PlayerInfo[playerid][pFaction] != 1)
    {
        if(GetPlayerSkin(playerid) == lspdskin1 || GetPlayerSkin(playerid) == lspdskin2 || GetPlayerSkin(playerid) == lspdskin3 || GetPlayerSkin(playerid) == lspdskin4 || GetPlayerSkin(playerid) == lspdskin5 || GetPlayerSkin(playerid) == lspdskin6 || GetPlayerSkin(playerid) == lspdskin7 || GetPlayerSkin(playerid) == lspdskin8)
        {
            SendClientMessage(playerid, COLOR_GREY, " You're not a member of this faction.");
        }
    }
    else if(PlayerInfo[playerid][pFaction] != 2)
    {
        if(GetPlayerSkin(playerid) == sasdskin1 || GetPlayerSkin(playerid) == sasdskin2 || GetPlayerSkin(playerid) == sasdskin3 || GetPlayerSkin(playerid) == sasdskin4 || GetPlayerSkin(playerid) == sasdskin5 || GetPlayerSkin(playerid) == sasdskin6)
        {
            SendClientMessage(playerid, COLOR_GREY, " You're not a member of this faction.");
        }
    }
    return 0;
}



Re: [HELP] Restrict certain skins to a faction - RowdyrideR - 05.01.2014

- Set classes normally:

Код:
AddPlayerClass(280,1528.6588,-1677.7656,5.8906,270.3174,0,0,0,0,0,0);
AddPlayerClass(211,1528.6588,-1677.7656,5.8906,270.3174,0,0,0,0,0,0);
AddPlayerClass(281,1528.6588,-1677.7656,5.8906,270.3174,0,0,0,0,0,0);
AddPlayerClass(265,1528.6588,-1677.7656,5.8906,270.3174,0,0,0,0,0,0);
AddPlayerClass(266,1528.6588,-1677.7656,5.8906,270.3174,0,0,0,0,0,0);
AddPlayerClass(267,1528.6588,-1677.7656,5.8906,270.3174,0,0,0,0,0,0);
AddPlayerClass(284,1528.6588,-1677.7656,5.8906,270.3174,0,0,0,0,0,0);
AddPlayerClass(285,1528.6588,-1677.7656,5.8906,270.3174,0,0,0,0,0,0);

AddPlayerClass(71,611.0428,-585.4861,17.2266,178.7129,0,0,0,0,0,0);
AddPlayerClass(282,611.0428,-585.4861,17.2266,178.7129,0,0,0,0,0,0);
AddPlayerClass(211,611.0428,-585.4861,17.2266,178.7129,0,0,0,0,0,0);
AddPlayerClass(283,611.0428,-585.4861,17.2266,178.7129,0,0,0,0,0,0);
AddPlayerClass(288,611.0428,-585.4861,17.2266,178.7129,0,0,0,0,0,0);
AddPlayerClass(287,611.0428,-585.4861,17.2266,178.7129,0,0,0,0,0,0);


- Fix this code:

Код:
public OnPlayerRequestSpawn(playerid)
{
	switch(GetPlayerSkin(playerid))
	{
 		case 280,211,281,265,266,267,284,285:
		{
        	SendClientMessage(playerid, COLOR_GREY, " You're not a member of this faction.");
		}
		case 71,282,211,283,288,287:
		{
         	SendClientMessage(playerid, COLOR_GREY, " You're not a member of this faction.");
		}
	}
	return 1;
}
************ Fix skin 211, it's in both...


Re: [HELP] Restrict certain skins to a faction - FreddeN93 - 05.01.2014

Well, that's one thing. I need those two skins locked to two different factions, or teams. That's the reason I tried with naming each class with lspdskin1 etc.