Showing only certain skins
#1

Alright so I've found a problem, I want to show player only some skins. Take a look at the code.

pawn Код:
if(PlayerInfo[playerid][pTeam] <= 1) // IT SHOULD SHOW ONLY THESE SKINS WHEN PLAYER IS pTeam 0
    {
        switch (classid)
        {
            case 0 .. 10:
            {
                gTeam[playerid] = POLICE;
                GameTextForPlayer(playerid, "~b~Police~b~", 1000, 5);
            }
            case 11 .. 13:
            {
                gTeam[playerid] = LATIN_KINGS;
                GameTextForPlayer(playerid, "~y~Latin Kings~y~", 1000, 5);
            }
            case 14 .. 16:
            {
                gTeam[playerid] = BALAS;
                GameTextForPlayer(playerid, "~p~Balas", 1000, 5);
            }
        }
    }
    else if(PlayerInfo[playerid][pTeam] == 1)
    {
        switch (classid)
        {
            case 17 .. 20: // IT SHOULD SHOW ONLY THESE SKINS WHEN PLAYER IS pTeam 1
            {
                GameTextForPlayer(playerid, "~b~My Team", 1000, 5);
                gTeam[playerid] = MY_TEAM;
            }
        }
    }
    return 1;
}

So as I said there, if they are team less show only the upper code, if they are not, show the bottom code.


Now my problem is that no matter if you have team or not, it will show all skins



This is under OnGameModeInit
pawn Код:
//THESE SKINS SHOULD BE SHOWN ONLY IF THE PLAYER DOESNT HAVE A TEAM
    AddPlayerClass(265, 2267.6841,2449.1069,3.5313, 269.1425, 0, 0, 0, 0, 0, 0); // 1
    AddPlayerClass(266, 2267.6841,2449.1069,3.5313, 269.1425, 0, 0, 0, 0, 0, 0); // 2
    AddPlayerClass(267, 2267.6841,2449.1069,3.5313, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(280, 2267.6841,2449.1069,3.5313, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(281, 2267.6841,2449.1069,3.5313, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(282, 2267.6841,2449.1069,3.5313, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(283, 2267.6841,2449.1069,3.5313, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(284, 2267.6841,2449.1069,3.5313, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(285, 2267.6841,2449.1069,3.5313, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(286, 2267.6841,2449.1069,3.5313, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(288, 2267.6841,2449.1069,3.5313, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(108, 2507.3748,1242.6487,10.8203, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(109, 2507.3748,1242.6487,10.8203, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(110, 2507.3748,1242.6487,10.8203, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(102, 2625.9739,2018.8618,10.8203, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(103, 2625.9739,2018.8618,10.8203, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(104, 2625.9739,2018.8618,10.8203, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(1, 0,0,0, 269.1425, 0, 0, 0, 0, 0, 0); // 1


    //THESE SKINS WILL BE SHOWN WHEN THE PLAYER DOES HAVE THE TEAM
    AddPlayerClass(4, 0,0,0, 269.1425, 0, 0, 0, 0, 0, 0); // 1
    AddPlayerClass(5, 0,0,0, 269.1425, 0, 0, 0, 0, 0, 0); // 1
    AddPlayerClass(6, 0,0,0, 269.1425, 0, 0, 0, 0, 0, 0); // 1
Reply
#2

You mentioned this should show only if the player team is 0
Then why not:
pawn Код:
if(PlayerInfo[playerid][pTeam] == 0)
That's the easiest solution i could think of.
Reply
#3

Quote:
Originally Posted by DaRk_RaiN
Посмотреть сообщение
You mentioned this should show only if the player team is 0
Then why not:
pawn Код:
if(PlayerInfo[playerid][pTeam] == 0)
That's the easiest solution i could think of.
Yes but you dont understand, it calls ALL skins from the GameModeInit. It should call only skins from Classid from 0 to 17.


Currently you see all skins on RequestClass that are under GameModeInit, but I want to make it so if you are TeamLess you will see only the first 17 ADdPlayerClass that are added under GameModeInit, and if you are pTeam >= 1 you will see all other skins, but you WONT see the first 17.
Reply
#4

For something like that you need a dynamic class selection
You could script it by yourself but the easiest would be to use y_classes

Otherwise you just could add a GameText that tells the player "Class no available" and reject their spawn request
Reply
#5

Hmmm, yep yep. Thank Nero, I'll try to do something with those Y_classes
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)