Does SetPlayerTeam still not 100% work? - 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: Does SetPlayerTeam still not 100% work? (
/showthread.php?tid=141031)
Does SetPlayerTeam still not 100% work? -
_Vortex - 11.04.2010
Well, I'm still having problems with SetPlayerTeam, some people can team-kill people on their teams, wile some cant.
Does someone have an alternative or is there something I may be doing wrong?
Re: Does SetPlayerTeam still not 100% work? -
ruckfules99 - 11.04.2010
Well, Show us a bit of code your having trouble with.
Re: Does SetPlayerTeam still not 100% work? -
_Vortex - 11.04.2010
Код:
public OnPlayerSpawn(playerid)
{
if (gTeam[playerid] == TEAM_TRIAD)
{
SetPlayerTeam(playerid, TEAM_TRIAD);
SetPlayerColor(playerid, COLOR_YELLOWGREEN);
}
else if (gTeam[playerid] == TEAM_CASINO)
{
SetPlayerTeam(playerid, TEAM_CASINO);
SetPlayerColor(playerid, COLOR_DARKORANGE);
}
else if (gTeam[playerid] == TEAM_POLICE)
{
SetPlayerTeam(playerid, TEAM_POLICE);
SetPlayerColor(playerid, COLOR_NAVY);
}
else if (gTeam[playerid] == TEAM_MAFIA)
{
SetPlayerTeam(playerid, TEAM_MAFIA);
SetPlayerColor(playerid, COLOR_MAGENTA);
}
else if (gTeam[playerid] == TEAM_ARMY)
{
SetPlayerTeam(playerid, TEAM_ARMY);
SetPlayerColor(playerid, COLOR_DARKGREEN);
}
else if (gTeam[playerid] == TEAM_REDNECK)
{
SetPlayerTeam(playerid, TEAM_REDNECK);
SetPlayerColor(playerid, COLOR_DARKRED);
}
else if (gTeam[playerid] == TEAM_PILOT)
{
SetPlayerTeam(playerid, TEAM_PILOT);
SetPlayerColor(playerid, COLOR_OLIVE);
}
else if (gTeam[playerid] == TEAM_RAIL)
{
SetPlayerTeam(playerid, TEAM_RAIL);
SetPlayerColor(playerid, COLOR_DARKKHAKI);
}
return 1;
}
Even though I'm using SetPlayerTeam (which is suppose to make team-killing impossible) some people are able to team-kill, wile others are not..
Re: Does SetPlayerTeam still not 100% work? -
Dark_Kostas - 11.04.2010
I saw somewhere, that you need to have a timer, setting the teams again(im not sure if its working). You can also make a command getting the player's team, so you can debug it when someone is killing teammates.