TeamKill error
#1

When a team has a player and I shoot with me not to go to his?
Reply
#2

I don't understand. You want a teamkiller to switch to the opposite team?
Reply
#3

When I shoot a team mate of his life if he does not go
Reply
#4

You want anti team kill,i got it.

Here is:

Code:
forward SettingPlayerTeam();
OnPlayerConnect

Code:
 SetTimerEx("SettingPlayerTeam",10,1,"i",playerid);
Add this where u want. (Just like any public).

Code:
public SettingPlayerTeam()
{
  for(new playerid; playerid < 200; playerid++)
  SetPlayerTeam(playerid, gTeam[playerid]);
  return 1;
}
This works ONLY with gTeam.
Reply
#5

But that it should not go to his team mates
Reply
#6

What?I dont understand what u are saying...
Reply
#7

Quote:
Originally Posted by buzifej
View Post
But that it should not go to his team mates
SetPlayerTeam(playerid, teamID);

Wiki: https://sampwiki.blast.hk/wiki/SetPlayerTeam
Note: Players on the same team can not kill each other

Quote:
Originally Posted by Logitech90
View Post
What?I dont understand what u are saying...
He means that it shouldn't go to their team mates
Reply
#8

if(gTeam[killerid] == gTeam[playerid])
{
TeamKills[killerid]++;
SendClientMessage(killerid, COLOR_RED, "Next is jail!");
GivePlayerMoney(killerid, -1000);
SetPlayerScore(killerid, GetPlayerScore(killerid) - 1);
SetPlayerHealth(killerid,0.0);
GameTextForPlayer(killerid,"~r~Don't team kill",5000,3);
Reply
#9

pawn Code:
public OnPlayerDeath(playerid, killerid, reason)
{
    if( gTeam[ playerid ] == gTeam[ killerid ] )
    {
        SetPlayerDrunkLevel(playerid, 0);
        GivePlayerMoney(killerid, -1000);
        SetPlayerScore(killerid,GetPlayerScore(killerid)-2);
        SendClientMessage(killerid, COLOR_BRIGHTRED, "You have teamkilled, you lost $1000 and 2 score");
    }
    else
    {
        new string[128];
        GetPlayerName(playerid,string,sizeof(string));
        format(string,sizeof(string),"You have killed %s and you gained 1000$ and 1 score",string);
        SendClientMessage(killerid, COLOR_GREEN, string);
        SetPlayerDrunkLevel(playerid, 0);
        GivePlayerMoney(killerid,1000);
        SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
    }
    return 1;
}
Your english suxs, (no offense)
Reply
#10

What is wrong?
public SettingPlayerTeam(killerid,playerid)
{
if(gTeam[killerid] == gTeam[playerid])
{
for(new playerid; playerid < 200; playerid++)
}
}
}


return 1;
}
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)