SA-MP Forums Archive
Something I need help with! TDM, adding teams - 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: Something I need help with! TDM, adding teams (/showthread.php?tid=69758)



Something I need help with! TDM, adding teams - Klutty - 20.03.2009

Alright I have added TEAM_GROVE and TEAM_BALLAS

pawn Код:
#define TEAM_GROVE 1
#define TEAM_BALLA 2
#define TEAM_GROVE_COLOR 0x00FF00AA // Bright Green (in RGBA format)
#define TEAM_BALLA_COLOR 0xFF00FFAA // Bright Purple
new gTeam[MAX_PLAYERS];
pawn Код:
SetPlayerTeamFromClass(playerid, classid)
{
    if (classid == 0)
    {
        gTeam[playerid] = TEAM_GROVE;
    }
    else
    {
        gTeam[playerid] = TEAM_BALLA;
    }
}
pawn Код:
SetPlayerTeamFromClass(playerid, classid);
pawn Код:
SetPlayerToTeamColor(playerid)
{
    if (gTeam[playerid] == TEAM_GROVE)
    {
        SetPlayerColor(playerid, TEAM_GROVE_COLOR);
    }
    else if (gTeam[playerid] == TEAM_BALLA)
    {
        SetPlayerColor(playerid, TEAM_BALLA_COLOR);
    }
}
pawn Код:
SetPlayerToTeamColor(playerid);
pawn Код:
if (classid == 0)
    {
        gTeam[playerid] = TEAM_GROVE;
    }
pawn Код:
if (classid == 0)
    {
        gTeam[playerid] = TEAM_GROVE;
    }
pawn Код:
if (gTeam[playerid] == TEAM_GROVE)
    {
        SetPlayerColor(playerid, TEAM_GROVE_COLOR);
    }

else if (gTeam[playerid] == TEAM_BALLA)
    {
        SetPlayerColor(playerid, TEAM_BALLA_COLOR);
    }

    else
    {
        SetPlayerColor(playerid, TEAM_BALLA_COLOR);
    }
All the things in the SAMP wiki tutorial (https://sampwiki.blast.hk/wiki/PAWN_tutorial) for adding teams, ballas and grove works perfect.

And now 1 thing, i have scripted Aztecas,vagos,army,LSPD for my TDM script, but how do I add them as teams? So that ppl who wear LSPD skins get Blue names, aztecas skins light blue, vagos yellow etc etc..

Can someone post some extra pawn codes? So I can in some way copy/paste..

Best regards,

Klutty.


Re: Something I need help with! TDM. - Klutty - 20.03.2009

Please? Anyone can answer? Does any experienced PAWN scripter understand what I mean, and can help me with it?


Re: Something I need help with! TDM. - harly - 20.03.2009

Код:
#define TEAM_AZTECS 3
#define TEAM_ VEGOS 4

SetPlayerTeamFromClass(playerid, classid)
{
	if (classid == 3)
	{
		gTeam[playerid] = TEAM_AZTES;
	}
	else
	{
		gTeam[playerid] = TEAM_VAGOS;
	}
}

ect...



Re: Something I need help with! TDM. - Klutty - 20.03.2009

Thank you.


Re: Something I need help with! TDM adding teams! - Klutty - 21.03.2009

I don't really get it, should I add that pawn code again under the "if team_grove else team_balla" shit?

Someone help!