SA-MP Forums Archive
Help with setting team colors - 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)
+--- Thread: Help with setting team colors (/showthread.php?tid=523071)



Help with setting team colors - YanLanger - 30.06.2014

Hello, i got a server Ballas vs grove street

and idk how to set colors to these teams grove green ballas purple...

and 1 more thing how to make em teams ?

Thanks.


AW: Help with setting team colors - Macronix - 30.06.2014

I suggest you read these two pages:

SetPlayerColor
SetPlayerTeam

If you want a custom team system, then you need to do it with variables


Re: Help with setting team colors - YanLanger - 30.06.2014

I don't really understand i am not scripter

I am new xd


Re: Help with setting team colors - ikkentim - 30.06.2014

Then learn to understand it:
https://sampwiki.blast.hk/wiki/Scripting_Basics

Or if you really feel like not scripting yourself, ask it here:
https://sampforum.blast.hk/showthread.php?tid=447813

Do not expect us in the scripting help section to give you ready made code (or guess what code you've already got).


Re: Help with setting team colors - greentarch - 30.06.2014

Quote:
Originally Posted by YanLanger
Посмотреть сообщение
I don't really understand i am not scripter

I am new xd
Then try to be one.
Read wiki pages, learn from other people's script.

Anyways, here is an example~

Put this on top of your script! (below includes)
pawn Код:
#define TEAM_GROVE  (0)
#define TEAM_BALLAS (1)
// Colors
#define COL_GREEN 0x33FF33FF
#define COL_PURPLE 0x2E8054FF
So, the top of your script should look like
pawn Код:
#include <a_samp>

#define TEAM_GROVE  (0)
#define TEAM_BALLAS (1)
// Colors
#define COL_GREEN 0x33FF33FF
#define COL_PURPLE 0x2E8054FF
On GameModeInit, put your classes (GroveStreet, Ballas) with AddPlayerClass
Then, go find the callback
pawn Код:
public OnPlayerSpawn(playerid)
Modify it to
pawn Код:
public OnPlayerSpawn(playerid)
{
    switch(GetPlayerSkin(playerid)) { // Get player's skin, and check it
        case 105..107 : { // Grove Street OGs Skins, I don't know what you have in your script
            SetPlayerTeam(playerid, TEAM_GROVE);
            SetPlayerColor(playerid, COL_GREEN);
        }
        case 102..104 : { // Ballas Skins, I don't know what you have in your script
            SetPlayerTeam(playerid, TEAM_BALLAS);
            SetPlayerColor(playerid, COL_PURPLE);
        }
    }
    return 1;
}
Easy, right?


Re: Help with setting team colors - YanLanger - 30.06.2014

Finally !

Thanks bro :P