How to Make Text for Team Selection?
#1

Hi , i want whene a player is in Team Selection Creat a Text like : HUMANS for Skin ID 290

How to do it?
Reply
#2

hi,
id try smth. like:

pawn Code:
if (classid == 0)//ur first skin added with AddPlayerClass
    {
    GameTextForPlayer(playerid, "~r~Zombie", 500, 5);
    gTeam[playerid] = TEAM1;
    SetPlayerTeam(playerid,TEAM1);
    }
    else if (classid == 1)//second skin
    {
    GameTextForPlayer(playerid, "~b~Human", 500, 5);
    gTeam[playerid] = TEAM2;
    SetPlayerTeam(playerid,TEAM2);
    }
    }
    else if (classid == 2)//and so on...
    {
    //...
    }
Use this code in the callback OnPlayerRequestClass.

Do u use gTeam?
If so, just adjust the gTeam variable to ur needs: gTeam[playerid] = ChangeThisToYourDefinedTeams;

Was this helpfull?
Reply
#3

Thank you a lot !
Reply
#4

np mate
just ask if u have further questions.
Reply
#5

i have a question ;
what Does if (classid == 0) Mean?

for Example i have the 4 First Skins for Zombie Team
what i have to do?
Reply
#6

You can also do it by using the "switch" statement. This is easier for larger amounts.

pawn Code:
switch(classid)
{
    case 0 .. 3: { // This is for skin 0 untill 3 (0, 1, 2, 3)
        // allt he stuff you want for the first 4 skins
    }
    case 4, 5, 6, 7: {
        // all the stuff you want for the classes 4, 5, 6, 7
    }
}
Reply
#7

k, ill explain more:

U add ur skins like this:

pawn Code:
AddPlayerClass(/*blablabla*/);//skin or class 1
AddPlayerClass(/*blablabla*/);//skin or class 2
AddPlayerClass(/*blablabla*/);//skin or class 3
Now in the callback OnPlayerRequestClass u tell the script what text u wanna have shown for what skin.
Like:

pawn Code:
if (classid == 0)//this means: when the player looks at the skin 1 it shows
    {
    GameTextForPlayer(playerid, "Human", 500, 5);//the text humans
    gTeam[playerid] = TEAM1;//sets this skin to team1
    SetPlayerTeam(playerid,TEAM1);
    }
    else if (classid == 1)//and then if the skin is the 2nd skin we have set up with AddPlayerClass
    {
   //...do stuff...
    }
//and so on
Also u should use AddPlayerClassEx for setting up teams.
Reply
#8

Thank you ! i uderstand now
Reply
#9

But an other Problem... whene i'm in Spawn Selection i can't See The Characters... i see only "Next"+"back"+"Spawn" Buttons.
Reply
#10

Quote:
Originally Posted by BlackWolf120
View Post
hi,
id try smth. like:

pawn Code:
if (classid == 0)//ur first skin added with AddPlayerClass
    {
    GameTextForPlayer(playerid, "~r~Zombie", 500, 5);
    gTeam[playerid] = TEAM1;
    SetPlayerTeam(playerid,TEAM1);
    }
    else if (classid == 1)//second skin
    {
    GameTextForPlayer(playerid, "~b~Human", 500, 5);
    gTeam[playerid] = TEAM2;
    SetPlayerTeam(playerid,TEAM2);
    }
    }
    else if (classid == 2)//and so on...
    {
    //...
    }
Use this code in the callback OnPlayerRequestClass.

Do u use gTeam?
If so, just adjust the gTeam variable to ur needs: gTeam[playerid] = ChangeThisToYourDefinedTeams;

Was this helpfull?
pawn Code:
switch(classid)
{
    case 0: GameTextForPlayer(playerid, "~r~CJ", 500, 5);
    case 1: GameTextForPlayer(playerid, "~b~Weed Smoker", 500, 5);
    case 2: GameTextForPlayer(playerid, "~b~Gangster", 500, 5);
}
They will work both the same ways but this way is more efficient.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)