[HELP] What's wrong with this?
#1

I'm trying to create something that blocks people from using team-based skin ids. The issue I have is that it works from team 1 to 5 but when I join team 6 with the skin I'm tring to block it allows me in anyway!

pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    if(PlayerInfo[playerid][pTeam] != 1)
    {
        if(GetPlayerSkin(playerid) == 105 || GetPlayerSkin(playerid) == 106 || GetPlayerSkin(playerid) == 107 || GetPlayerSkin(playerid) == 195)
        {
            SendClientMessage(playerid, COLOR_WHITE, "You are not allowed to use this skin. (Team-Skin)");
            return 0;
        }
    }
    if(PlayerInfo[playerid][pTeam] != 2)
    {
        if(GetPlayerSkin(playerid) == 102 || GetPlayerSkin(playerid) == 103 || GetPlayerSkin(playerid) == 104)
        {
            SendClientMessage(playerid, COLOR_WHITE, "You are not allowed to use this skin. (Team-Skin)");
            return 0;
        }
    }
    if(PlayerInfo[playerid][pTeam] != 3)
    {
        if(GetPlayerSkin(playerid) == 114 || GetPlayerSkin(playerid) == 115 || GetPlayerSkin(playerid) == 116 || GetPlayerSkin(playerid) == 41)
        {
            SendClientMessage(playerid, COLOR_WHITE, "You are not allowed to use this skin. (Team-Skin)");
            return 0;
        }
    }
    if(PlayerInfo[playerid][pTeam] != 4)
    {
        if(GetPlayerSkin(playerid) == 108 || GetPlayerSkin(playerid) == 109 || GetPlayerSkin(playerid) == 110)
        {
            SendClientMessage(playerid, COLOR_WHITE, "You are not allowed to use this skin. (Team-Skin)");
            return 0;
        }
    }
    if(PlayerInfo[playerid][pTeam] != 5)
    {
        if(GetPlayerSkin(playerid) == 280 || GetPlayerSkin(playerid) == 281 || GetPlayerSkin(playerid) == 284 || GetPlayerSkin(playerid) == 93 || GetPlayerSkin(playerid) == 285)
        {
            SendClientMessage(playerid, COLOR_WHITE, "You are not allowed to use this skin. (Team-Skin)");
            return 0;
        }
    }
    if(PlayerInfo[playerid][pTeam] != 6)
    {
        if(GetPlayerSkin(playerid) == 280 || GetPlayerSkin(playerid) == 281 || GetPlayerSkin(playerid) == 284 || GetPlayerSkin(playerid) == 93 || GetPlayerSkin(playerid) == 285)
        {
            SendClientMessage(playerid, COLOR_WHITE, "You are not allowed to use this skin. (Team-Skin)");
            return 0;
        }
    }
    return 1;
}
Thanks
Reply
#2

pawn Код:
public OnPlayerSpawn(playerid)
{
    if(PlayerInfo[playerid][pTeam] != 1)
    {
        if(GetPlayerSkin(playerid) == 105 || GetPlayerSkin(playerid) == 106 || GetPlayerSkin(playerid) == 107 || GetPlayerSkin(playerid) == 195)
        {
            SendClientMessage(playerid, COLOR_WHITE, "You are not allowed to use this skin. (Team-Skin)");
            ForceClassSelection( playerid );
            return 0;
        }
    }
    if(PlayerInfo[playerid][pTeam] != 2)
    {
        if(GetPlayerSkin(playerid) == 102 || GetPlayerSkin(playerid) == 103 || GetPlayerSkin(playerid) == 104)
        {
            SendClientMessage(playerid, COLOR_WHITE, "You are not allowed to use this skin. (Team-Skin)");
            ForceClassSelection( playerid );
            return 0;
        }
    }
    if(PlayerInfo[playerid][pTeam] != 3)
    {
        if(GetPlayerSkin(playerid) == 114 || GetPlayerSkin(playerid) == 115 || GetPlayerSkin(playerid) == 116 || GetPlayerSkin(playerid) == 41)
        {
            SendClientMessage(playerid, COLOR_WHITE, "You are not allowed to use this skin. (Team-Skin)");
            ForceClassSelection( playerid );
            return 0;
        }
    }
    if(PlayerInfo[playerid][pTeam] != 4)
    {
        if(GetPlayerSkin(playerid) == 108 || GetPlayerSkin(playerid) == 109 || GetPlayerSkin(playerid) == 110)
        {
            SendClientMessage(playerid, COLOR_WHITE, "You are not allowed to use this skin. (Team-Skin)");
            ForceClassSelection( playerid );
            return 0;
        }
    }
    if(PlayerInfo[playerid][pTeam] != 5)
    {
        if(GetPlayerSkin(playerid) == 280 || GetPlayerSkin(playerid) == 281 || GetPlayerSkin(playerid) == 284 || GetPlayerSkin(playerid) == 93 || GetPlayerSkin(playerid) == 285)
        {
            SendClientMessage(playerid, COLOR_WHITE, "You are not allowed to use this skin. (Team-Skin)");
            ForceClassSelection( playerid );
            return 0;
        }
    }
    if(PlayerInfo[playerid][pTeam] != 6)
    {
        if(GetPlayerSkin(playerid) == 280 || GetPlayerSkin(playerid) == 281 || GetPlayerSkin(playerid) == 284 || GetPlayerSkin(playerid) == 93 || GetPlayerSkin(playerid) == 285)
        {
            SendClientMessage(playerid, COLOR_WHITE, "You are not allowed to use this skin. (Team-Skin)");
            ForceClassSelection( playerid );
            return 0;
        }
    }
    return 1;
}
Reply
#3

Sorry aRoach but this didn't do anything. It just spawned me and sent me the message and I can still use the team skins.
Reply
#4

Bump!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)