[Tutorial] How to create teams and colors
#1

Hello ! Now i will teach u how to create teams anyways let's start it kinda sux but whatever.

EDIT: Do not forget to define the colors Here is some colors put them on the top of your script
PHP Code:
#define COLOR_PLAYER_LIGHTBLUE 0x9292FFDD
#define COLOR_PLAYER_VLIGHTBLUE 0x66FFFFFF
#define COLOR_PLAYER_BLUE 0xA098F0AA
#define COLOR_PLAYER_FBI 0xFFFFFF77
#define COLOR_PLAYER_FBIHIGH 0xFFFFFF77
#define COLOR_PLAYER_DARKBLUE 0x000096FF
#define COLOR_PLAYER_SPECIALBLUE 0x4169FFFF
#define COLOR_PLAYER_LIGHTRED 0xFFB0B0DD
#define COLOR_PLAYER_RED 0xFF0000DD
#define COLOR_PLAYER_DARKRED 0xA10000FF
#define COLOR_PLAYER_SPECIALRED 0xB22222DD
#define COLOR_PLAYER_LIGHTGREEN 0x92FF92DD
#define COLOR_PLAYER_GREEN 0x00FF00DD
#define COLOR_PLAYER_DARKGREEN 0x009600DD
#define COLOR_PLAYER_SPECIALGREEN 0x00FF00FF
#define COLOR_PLAYER_LIGHTYELLOW 0xFFFF5EDD
#define COLOR_PLAYER_YELLOW 0xFFFF00DD
#define COLOR_PLAYER_DARKYELLOW 0xD3D300FF
#define COLOR_PLAYER_SPECIALYELLOW 0xCFAE00DD
#define COLOR_PLAYER_LIGHTPURPLE 0xFF92FFDD
#define COLOR_PLAYER_PURPLE 0xFF00FFDD
#define COLOR_PLAYER_DARKPURPLE 0x800080FF
#define COLOR_PLAYER_SPECIALPURPLE 0xDA70D6DD
#define COLOR_PLAYER_LIGHTBROWN 0xBA9072DD
#define COLOR_PLAYER_BROWN 0x663300FF
#define COLOR_PLAYER_DARKBROWN 0x6D360EDD
#define COLOR_PLAYER_LIGHTGREY 0xC7C7C7DD
#define COLOR_PLAYER_GREY 0x8B8B8BDD
#define COLOR_PLAYER_DARKGREY 0x656565FF
#define COLOR_PLAYER_WHITE 0xFFFFFF77
#define COLOR_PLAYER_WHITE_INV 0xFFFFFFFF
#define COLOR_PLAYER_BLACK 0x212121FF
#define COLOR_PLAYER_AQUAMARINE 0x7FFFD4DD
#define COLOR_PLAYER_CYAN 0x00FFFFDD
#define COLOR_PLAYER_VIOLET 0xCC0066AA
#define COLOR_PLAYER_SASF 0x556B2FFF
#define COLOR_PLAYER_POLITIC 0xCC9999FF
#define COLOR_PLAYER_MEXICAN1 0xFF8000FF
#define COLOR_PLAYER_BLACK1 0x741827FF
#define COL_PURPLE 0x7E1A6CAA
#define COLOR_BLUE 0x0000FFFF
#define COL_YELLOW 0xFFFF33FF
#define COL_BLUE 002FFF
#define COLOR_PINK 0xFF66FFAA
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x00FF00AA
#define COLOR_PURPLE 0xFF00FFAA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_RED 0xAA3333AA
#define COLOR_LIME 0x10F441AA
#define COLOR_MAGENTA 0xFF00FFFF
#define COLOR_NAVY 0x000080AA
#define COLOR_AQUA 0xF0F8FFAA
#define COLOR_CRIMSON 0xDC143CA
#define COLOR_BISQUE 0xFFE4C4AA
#define COLOR_BLACK 0x000000AA
#define COLOR_CHARTREUSE 0x7FFF00AA
#define COLOR_BROWN 0XA52A2AAA
#define COLOR_CORAL 0xFF7F50AA
#define Green 0x33AA33AA
#define COLOR_GOLD 0xB8860BAA
#define COLOR_GREENYELLOW 0xADFF2FAA
#define COLOR_INDIGO 0x4B00B0AA
#define COLOR_IVORY 0xFFFF82AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_LAWNGREEN 0x7CFC00AA
#define COLOR_SEAGREEN 0x20B2AAAA 
now i will explain how to put the colors but first of all define your teams at the top
PHP Code:
#define TEAM_BLAH 0
#define TEAM_BLA 1// This defines your team and it's important so don't forget it !! 
Now go to on player spawn

pawn Code:
public OnPlayerSpawn(playerid)//Now underit we will create the colors and the teams !
PHP Code:
switch (GetPlayerSkin(playerid))
    {
//Before u start 
Add this
PHP Code:
 case 1:{SetPlayerColor(playeridCOLOR_WHITE);}// case 1: the 1 is the skin id you want SetPlayerColor it sets the player color ofcourse and if u do COLOR_WHITE it makes his color white do not forget to define it at the top ! 
Now u can make the colors but ! i will also teach u how to make teams so they will not kill eachother !
PHP Code:
case .. 26://These two is the ids Now why .. ? it the skins "In it" like 1 what after 1 ? 2 and till then it's 26 so .. it's the numbers inside it 
Now put this
PHP Code:
{//Under case: 1 .. 26: 
Ok let's make da teams !
pawn Code:
SetPlayerTeam(playerid, TEAM_BLAH);// Setplayeteam it sets the player team player and ofc the team make sure u defined it !
Now for this
PHP Code:
}//Close it. 
Plus if u want teams and colors like together do this:
PHP Code:
case .. 26:
{
   
SetPlayerTeam(playeridTEAM_BLA);
   
SetPlayerColor(playeridCOLOR_YOUR COLOR); 
And remember always put it under the cmd when u done
PHP Code:
return 1;

or it will not work.
something like that
pawn Code:
case 281 .. 286:
        {
            SetPlayerTeam(playerid, TEAM_BLA);
            SetPlayerColor(playerid, COL_YOUR COLOR);
        }
    }
    return 1;
}
This is an example of a lot of teams/colors that iv'e made.
PHP Code:
public OnPlayerSpawn(playerid)
{
   
    switch (
GetPlayerSkin(playerid))
    {
        case 
102 .. 104:
        {
            
SetPlayerTeam(playeridTEAM_BALLAS);
            
SetPlayerColor(playeridCOL_PURPLE);
        }
        case 
105 .. 107:
        {
            
SetPlayerTeam(playeridTEAM_GROVE);
            
SetPlayerColor(playeridCOL_GREEN);
        }
        case 
108 .. 110:
        {
            
SetPlayerTeam(playeridTEAM_VAGOS);
            
SetPlayerColor(playeridCOL_YELLOW);
        }
        case 
132 .. 230:
        {
            
SetPlayerTeam(playeridTEAM_HOMLESS);
            
SetPlayerColor(playeridCOLOR_WHITE);
        }
        case 
120 .. 122:
        {
            
SetPlayerTeam(playeridTEAM_CHINESE);
            
SetPlayerColor(playeridCOLOR_RED);
        }
        case 
114 .. 116:
        {
            
SetPlayerTeam(playeridTEAM_AZTECAS);
            
SetPlayerColor(playeridCOL_LIGHTBLUE);
        }
        case 
281 .. 286:
        {
            
SetPlayerTeam(playeridTEAM_POLICE);
            
SetPlayerColor(playeridCOL_BLUE);
        }
    }
    return 
1;

I know bad tutorial next time better.
Reply
#2

Nice Job
Reply
#3

Thank you
Reply
#4

Very nice tutorial!
Reply
#5

Thanks
Reply
#6

A very nice tutorial
Reply
#7

thank u shady
Reply
#8

On the line

pawn Code:
case 1:{SetPlayerColor(playerid, COLOR_WHITE);
You forget to define the white color, I hope you fix that because some newbies don't know how to define colors
Reply
#9

ohh ye thanks
Reply
#10

No problem, anytime .
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)