Ant-Teamkill doesn't work all the time..
#1

Hey, I'm using "SetPlayerTeam" and people can still teamkill sometimes...

Here's my code.

pawn Код:
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;
}
Why doesn't it work sometimes..?
Reply
#2

read this and you'll understand

http://www.sa-mpbugs.com/viewissue.php?issue_no=33
Reply
#3

Quote:
Originally Posted by Flo_White
So I cant fix it..?
Reply
#4

This was in the usefull snipets section and was posted by Seif who is a well known memeber of this community,it works great for me

Код:
// top of your gamemode
forward SettingPlayerTeam();
//OnPlayerConnect
SetTimerEx("SettingPlayerTeam",10,1,"d",playerid);
//Bottom of your script
public SettingPlayerTeam()
{
  for(new playerid; playerid < 200; playerid++)
    SetPlayerTeam(playerid, gTeam[playerid]);
  return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)