Class ID's
#1

closed.
Reply
#2

Quote:
Originally Posted by WarriorEd22
Посмотреть сообщение
I have this in my script. What does this exactly mean?:

pawn Код:
SetPlayerTeamFromClass(playerid, classid)
{
    if(classid == 0 || classid == 1 || classid == 2 || classid == 3 || classid == 4 || classid == 5)
    {
        gTeam[playerid] = Team_Cop;
    }
    else if(classid == 6)
    {
        gTeam[playerid] = Team_Army;
    }
    else if(classid == 7)
    {
        gTeam[playerid] = Team_FBI;
    }
    else if(classid >= 8)
    {
        gTeam[playerid] = Team_Civi;
    }
}
This is saying that when you register it shows you skins? if you choose 0 to 5 for example, it will put you in Team_Cop.
Reply
#3

Better do it like this;

pawn Код:
switch(classid)
    {
        case 0 .. 2:
        {
            gTeam[playerid] = BALLA;
        }
        case 3 .. 7:
        {
            gTeam[playerid] = GROVE;
        }
        case 8 .. 10:
        {
            gTeam[playerid] = VAGOS;
        }
The cases are directed to the Playerclasses you've created under "OnGameModeInit"...Then you'll set the gTeam for the player to a special team. Change your code to the one I've posted, it's way more effecient and easier!
Reply
#4

Okay thanks guys. So does it mean it starts with the first skin? For example, the first 5 classes will be the first 5 AddPlayerClass?
Reply
#5

Yep, you got it homie! Let's take this as an example;

pawn Код:
AddPlayerClass //first one
AddPlayerClass //second one
AddPlayerClass //third one
AddPlayerClass //fourth one
AddPlayerClass //fifth one
AddPlayerClass //sixth one
Let's say you've got 2 different teams as example:

pawn Код:
switch(classid)    {
    case 0 .. 2: //the first three playerclasses
    {
            gTeam[playerid] = TEAM1; //set their gTeam to YOUR teams
    }
    case 3 .. 5: //the other three playerclasses
    {
            gTeam[playerid] = TEAM2; //set their gTeam to YOUR teams
    }
Sorry for the format, typed in a browser! Hope you understood it now good and I could help!
Reply
#6

+rep! Thanks so much! God bless!
Reply
#7

Thanks Very Useful
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)