gteam help. - 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: gteam help. (
/showthread.php?tid=218312)
gteam help. -
ThePwherer - 29.01.2011
Код:
#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.
Re: gteam help. -
[DK]Dark_Knight - 29.01.2011
You need to call SetPlayerTeamFromClass and SetPlayerToTeamColor
right now its just code sitting there
Re: gteam help. -
bartje01 - 29.01.2011
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;
}
Re: gteam help. -
[DK]Dark_Knight - 29.01.2011
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"