SA-MP Forums Archive
Change team problem - 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: Change team problem (/showthread.php?tid=155084)



Change team problem - Buwla - 16.06.2010

When you first choose team it works, all commands and that shit.
But when i try to change team, then the commands wont work.

So, how do i change/reset the players team?


Re: Change team problem - WSD - 17.06.2010

Did you try using SetPlayerTeam?
If you have try using SpawnPlayer to get the CMD's working for that team only.


Re: Change team problem - Buwla - 17.06.2010

Im using SetPlayerTeam on dialog. Snap, maybe its that what fucks up since i use gteam.
Код:
SetPlayerTeam(playerid, gTeam[playerid] == TEAM_DM);
Should that work?


Re: Change team problem - Vince - 17.06.2010

That won't work. Ever.

pawn Код:
gTeam[playerid] = TEAM_DM;
SetPlayerTeam(playerid, TEAM_DM);
SetPlayerTeam disables teamkilling.
If you don't need that feature, you can remove all Set/GetPlayerTeam and just use gTeam instead.

pawn Код:
if(gTeam[playerid] == TEAM_DM)
{
  // He's in the DM team! Execute some code here
}



Re: Change team problem - DJDhan - 17.06.2010

If you have problem changing teams,
put this under OnPlayerRequestSpawn

Код:
SetPlayerTeam(playerid,gTeam[playerid]);
And your change command should be something like this (if you have it then ignore it)
Код:
if(!strcmp(cmdtext,"/change",true,7))
{
  ForceClassSelection(playerid);
  SetPlayerHealth(playerid,0.0);
}



Re: Change team problem - Buwla - 17.06.2010

Ty, didnt really know how the whole gteam worked , works great now