[Help] How I Fix This
#1

Hi, Im Creating My First TDM GM But Why Always The First Person Of The Skin Gets The Color Nmae Of The Skin Before The Selected One .
Ex. My Gangs Are
Grove 4 Skins
Ballas 3 Skins
Cops 5 Skins
Vagos 3 Skins
Desertians 1 Skin - The People In Desert
The Problem Is That The First Person Of Ballas Get The Name Color Of Grove - Green, And The First Person Of Cops Get The Name Color Of Ballas, etc...

Ok When A Player Gets The First Skin Of Grove The Player Name Color Go To The Desertian Skin Name Color In Witch Is Orange, When A Player Get Skin Of The First Ballas Skin The Color Of The Name Go To The Last Skin In Grove Witch Is Green, How Can I Fix This Problem? Every Skin Of The 1ST Gang Always Gets The Color Of The Skin Before It.

pawn Код:
public OnPlayerSpawn(playerid)
{

   switch(gClass[playerid])
   {
    case 0:
    {
      SetPlayerColor(playerid, COLOR_GREEN); //Grove
    }
    case 1:
    {
      SetPlayerColor(playerid, COLOR_GREEN); //Grove
    }
    case 3:
    {
      SetPlayerColor(playerid, COLOR_GREEN); //Grove
    }
    case 4:
    {
      SetPlayerColor(playerid, COLOR_GREEN); //Grove
    }
    case 5:
    {
      SetPlayerColor(playerid, COLOR_PURPLE); //Ballas
    }
    case 6:
    {
      SetPlayerColor(playerid, COLOR_PURPLE); //Ballas
    }
    case 7:
    {
      SetPlayerColor(playerid, COLOR_PURPLE); //Ballas
    }
    case 8:
    {
      SetPlayerColor(playerid, COLOR_BLUE); //Cops
    }
    case 9:
    {
       SetPlayerColor(playerid, COLOR_BLUE); //Cops
    }
    case 10:
    {
       SetPlayerColor(playerid, COLOR_BLUE); //Cops
    }
    case 11:
    {
       SetPlayerColor(playerid, COLOR_BLUE); //Cops
    }
    case 12:
    {
       SetPlayerColor(playerid, COLOR_BLUE); //Cops
    }
    case 14:
    {
       SetPlayerColor(playerid, COLOR_YELLOW); //Los Santos Vagos
    }
    case 15:
    {
       SetPlayerColor(playerid, COLOR_YELLOW); //Los Santos Vagos
    }
    case 16:
    {
       SetPlayerColor(playerid, COLOR_YELLOW); //Los Santos Vagos
    }
    case 17:
    {
       SetPlayerColor(playerid, COLOR_DESERTIAN); //Desertians
    }

  }
  return 1;
}
Is The Code Wrong ?
Reply
#2

Change it to this

pawn Код:
public OnPlayerSpawn(playerid)
{

   switch(gClass[playerid])
   {
    case 0:
    {
      SetPlayerColor(playerid, COLOR_GREEN); //Grove
    }
    case 1:
    {
      SetPlayerColor(playerid, COLOR_GREEN); //Grove
    }
    case 3:
    {
      SetPlayerColor(playerid, COLOR_GREEN); //Grove
    }
    case 4:
    {
      SetPlayerColor(playerid, COLOR_GREEN); //Grove
    }
    case 5:
    {
      SetPlayerColor(playerid, COLOR_PURPLE); //Ballas
    }
    case 6:
    {
      SetPlayerColor(playerid, COLOR_PURPLE); //Ballas
    }
    case 7:
    {
      SetPlayerColor(playerid, COLOR_PURPLE); //Ballas
    }
    case 8:
    {
      SetPlayerColor(playerid, COLOR_BLUE); //Cops
    }
    case 9:
    {
       SetPlayerColor(playerid, COLOR_BLUE); //Cops
    }
    case 10:
    {
       SetPlayerColor(playerid, COLOR_BLUE); //Cops
    }
    case 11:
    {
       SetPlayerColor(playerid, COLOR_BLUE); //Cops
    }
    case 12:
    {
       SetPlayerColor(playerid, COLOR_BLUE); //Cops
    }
    case 14:
    {
       SetPlayerColor(playerid, COLOR_YELLOW); //Los Santos Vagos
    }
    case 15:
    {
       SetPlayerColor(playerid, COLOR_YELLOW); //Los Santos Vagos
    }
    case 16:
    {
       SetPlayerColor(playerid, COLOR_YELLOW); //Los Santos Vagos
    }
    case 17:
    {
       SetPlayerColor(playerid, COLOR_DESERTIAN); //Desertians
    }
  }

    return 1;
    }
This will solve it , ask me if you get any other problem
Reply
#3

Quote:
Originally Posted by ►►►Peter Corneile◄◄◄
Change it to this

pawn Код:
public OnPlayerSpawn(playerid)
{

   switch(gClass[playerid])
   {
    case 0:
    {
      SetPlayerColor(playerid, COLOR_GREEN); //Grove
    }
    case 1:
    {
      SetPlayerColor(playerid, COLOR_GREEN); //Grove
    }
    case 3:
    {
      SetPlayerColor(playerid, COLOR_GREEN); //Grove
    }
    case 4:
    {
      SetPlayerColor(playerid, COLOR_GREEN); //Grove
    }
    case 5:
    {
      SetPlayerColor(playerid, COLOR_PURPLE); //Ballas
    }
    case 6:
    {
      SetPlayerColor(playerid, COLOR_PURPLE); //Ballas
    }
    case 7:
    {
      SetPlayerColor(playerid, COLOR_PURPLE); //Ballas
    }
    case 8:
    {
      SetPlayerColor(playerid, COLOR_BLUE); //Cops
    }
    case 9:
    {
       SetPlayerColor(playerid, COLOR_BLUE); //Cops
    }
    case 10:
    {
       SetPlayerColor(playerid, COLOR_BLUE); //Cops
    }
    case 11:
    {
       SetPlayerColor(playerid, COLOR_BLUE); //Cops
    }
    case 12:
    {
       SetPlayerColor(playerid, COLOR_BLUE); //Cops
    }
    case 14:
    {
       SetPlayerColor(playerid, COLOR_YELLOW); //Los Santos Vagos
    }
    case 15:
    {
       SetPlayerColor(playerid, COLOR_YELLOW); //Los Santos Vagos
    }
    case 16:
    {
       SetPlayerColor(playerid, COLOR_YELLOW); //Los Santos Vagos
    }
    case 17:
    {
       SetPlayerColor(playerid, COLOR_DESERTIAN); //Desertians
    }
  }

    return 1;
    }
This will solve it , ask me if you get any other problem
didnt work, i founded out that the first skin doenst need change but the other ones yes
Reply
#4

What do you mean , i didnt get it ....
Reply
#5

it didnt work, The Problem Is That The First Person Of Ballas Get The Name Color Of Grove - Green, And The First Person Of Cops Get The Name Color Of Ballas, etc...
Reply
#6

Why don't you just set the color under OnPlayerRequestClass and use 'classid' in the switch ?
Reply
#7

Quote:
Originally Posted by dice7
Why don't you just set the color under OnPlayerRequestClass and use 'classid' in the switch ?
idk how to can u please give me an example like where to put it, and what to put just give me an example
Reply
#8

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
if(skinid == 0)
{
SetPlayerColor(playerid, COLOR_GREEN);
}
if(skinid == 1)
{
SetPlayerColor(playerid, COLOR_GREEN);
}
and so on... ^^
Reply
#9

Quote:
Originally Posted by » sTeVe
public OnPlayerRequestClass(playerid, classid)
{
if(skinid == 0)
{
SetPlayerColor(playerid, COLOR_GREEN);
}
if(skinid == 1)
{
SetPlayerColor(playerid, COLOR_GREEN);
}

and so on... ^^
Yup that can be one way
Reply
#10

Quote:
Originally Posted by » sTeVe
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
if(skinid == 0)
{
SetPlayerColor(playerid, COLOR_GREEN);
}
if(skinid == 1)
{
SetPlayerColor(playerid, COLOR_GREEN);
}
and so on... ^^
ok lemme try
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)