gteam help.
#1

Код:
#include <a_samp>

#if defined FILTERSCRIPT

#define TEAM_TERORISTS 1
#define TEAM_COUNTERTERORISTS 2
#define TEAM_COUNTERTERORISTS_COLOR 0xFF0000FF
#define TEAM_TERORISTS_COLOR 0xFFFF0000

#else

main()
{
	print("\n----------------------------------");
	print(" Blank Gamemode by your name here");
	print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{

	// Don't use these lines if it's a filterscript
	SetGameModeText("Blank Script");
	AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
	return 1;
}

public OnGameModeExit()
{
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
	return 1;
}
SetPlayerTeamFromClass(playerid, classid)
{
	if (classid == 0)
	{
		gTeam[playerid] = TEAM_TERORISTS;
	}
	else
	{
		gTeam[playerid] = TEAM_COUNTERTERORISTS;
	}
}
SetPlayerToTeamColor(playerid)
{
	if (gTeam[playerid] == TEAM_TERRORISTS)
	{
		SetPlayerColor(playerid, TEAM_TERORISTS_COLOR);
	}
	else if (gTeam[playerid] == TEAM_COUNTERTERRORISTS)
	{
		SetPlayerColor(playerid, TEAM_COUNTERTERORISTS_COLOR);
	}
}
have i done this right? and where do i put:
Код:
if (classid == 0)
	{
		gTeam[playerid] = TEAM_TERRORISTS;
	}
if (classid == 1)
	{
		gTeam[playerid] = TEAM_COUNTERTERORISTS;
	}
I got this from " https://sampwiki.blast.hk/wiki/PAWN_tutorial ".

When i compile it says

(245) : warning 203: symbol is never used: "SetPlayerTeamFromClass"
(245) : warning 203: symbol is never used: "SetPlayerToTeamColor"
Please Help.
Reply
#2

You need to call SetPlayerTeamFromClass and SetPlayerToTeamColor

right now its just code sitting there
Reply
#3

Your warnings means that you haven't used the fuctions yet.

Put this at onplayerspawn
pawn Код:
if (classid == 0)
    {
        gTeam[playerid] = TEAM_TERRORISTS;
    }
if (classid == 1)
    {
        gTeam[playerid] = TEAM_COUNTERTERORISTS;
    }
Reply
#4

And add the following line to OnPlayerSpawn:
pawn Код:
SetPlayerTeamFromClass(playerid, classid);
SetPlayerToTeamColor(playerid);
If you do it this way, you dont need to do it bartje01's way

Edit:

actually i think
Код:
SetPlayerTeamFromClass(playerid, classid);
goes under "OnPlayerRequestClass"
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)