Change team problem
#1

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?
Reply
#2

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

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?
Reply
#4

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
}
Reply
#5

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);
}
Reply
#6

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


Forum Jump:


Users browsing this thread: 1 Guest(s)