SA-MP Forums Archive
[HELP] Faction skins - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] Faction skins (/showthread.php?tid=256802)



[HELP] Faction skins - Fredden1993 - 22.05.2011

I'm trying to make some faction skicks locked for only faction members and I'm not sure how I should script this. The script is put under OnPlayerSpawn.

pawn Код:
if(GetPlayerSkin(playerid) == 280 || GetPlayerSkin(playerid) == 281 || GetPlayerSkin(playerid) == 284 || GetPlayerSkin(playerid) == 265 || GetPlayerSkin(playerid) == 266 ||
    GetPlayerSkin(playerid) == 285)
    {
        if(gTeam[playerid] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pTeam] == 1)
        {
            SendClientMessage(playerid, COLOR_LIGHTRED, "You are not allowed to enter this skin. (Kicked)");
            Kick(playerid);
        }
    }
    else if(GetPlayerSkin(playerid) == 282 || GetPlayerSkin(playerid) == 283 || GetPlayerSkin(playerid) == 288 || GetPlayerSkin(playerid) == 287)
    {
        if(gTeam[playerid] == 2 || PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pTeam] == 2)
        {
            SendClientMessage(playerid, COLOR_LIGHTRED, "You are not allowed to enter this skin. (Kicked)");
            Kick(playerid);
        }
    }
Can you find any problems? Thanks for the help!


Re: [HELP] Faction skins - joeri55 - 22.05.2011

You need to put the GetPlayerSkin command where the "if gTeam" is placed. Turn them around and people will get kicked for having the skin incase of being in a gTeam.

Код:
if(gTeam[playerid] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pTeam] == 1)
    {
        if(GetPlayerSkin(playerid) == 280 || GetPlayerSkin(playerid) == 281 || GetPlayerSkin(playerid) == 284 || GetPlayerSkin(playerid) == 265 || GetPlayerSkin(playerid) == 266 ||
    GetPlayerSkin(playerid) == 285)
        {
            SendClientMessage(playerid, COLOR_LIGHTRED, "You are not allowed to enter this skin. (Kicked)");
            Kick(playerid);
        }
    }
I think you mean something doing it like this;


Re: [HELP] Faction skins - xalith - 22.05.2011

wouldnt it be better to place this under onplayerrequestspawn(playerid), so that they wont spawn in the first place? so instead of kicking them, they'll just choose another skin.

pawn Код:
if(gTeam[playerid] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pTeam] == 1)
    {
        if(GetPlayerSkin(playerid) == 280 || GetPlayerSkin(playerid) == 281 || GetPlayerSkin(playerid) == 284 || GetPlayerSkin(playerid) == 265 || GetPlayerSkin(playerid) == 266 ||
    GetPlayerSkin(playerid) == 285)
        {
            SendClientMessage(playerid, COLOR_LIGHTRED, "You are not allowed to enter this skin.");
        else return true;
}



Re: [HELP] Faction skins - Fredden1993 - 22.05.2011

Quote:
Originally Posted by joeri55
Посмотреть сообщение
You need to put the GetPlayerSkin command where the "if gTeam" is placed. Turn them around and people will get kicked for having the skin incase of being in a gTeam.

Код:
if(gTeam[playerid] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pTeam] == 1)
    {
        if(GetPlayerSkin(playerid) == 280 || GetPlayerSkin(playerid) == 281 || GetPlayerSkin(playerid) == 284 || GetPlayerSkin(playerid) == 265 || GetPlayerSkin(playerid) == 266 ||
    GetPlayerSkin(playerid) == 285)
        {
            SendClientMessage(playerid, COLOR_LIGHTRED, "You are not allowed to enter this skin. (Kicked)");
            Kick(playerid);
        }
    }
I think you mean something doing it like this;
Well, it kind of works, but now if I'm in gTeam 1 I can still use skins which should be locked for gTeam 2, what now?