SA-MP Forums Archive
[Help] How I Fix This - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Help] How I Fix This (/showthread.php?tid=97332)



[Help] How I Fix This - legendario - 13.09.2009

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 ?


Re: [Help] How I Fix This - Peter_Corneile - 13.09.2009

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


Re: [Help] How I Fix This - legendario - 13.09.2009

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


Re: [Help] How I Fix This - Peter_Corneile - 13.09.2009

What do you mean , i didnt get it ....


Re: [Help] How I Fix This - legendario - 13.09.2009

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...


Re: [Help] How I Fix This - dice7 - 13.09.2009

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


Re: [Help] How I Fix This - legendario - 13.09.2009

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


Re: [Help] How I Fix This - » sTeVe - 13.09.2009

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


Re: [Help] How I Fix This - Peter_Corneile - 13.09.2009

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


Re: [Help] How I Fix This - legendario - 13.09.2009

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