SA-MP Forums Archive
Pentalty to teamkill. - 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: Pentalty to teamkill. (/showthread.php?tid=107248)



Pentalty to teamkill. - DiddyBop - 08.11.2009

How would i make it so... if you teamkill YOU die? or such. but if you kill other team u dont?

Please help.... i think i have idea how but i dont know how to put the code for either side...

Yes im new scripter laugh.


Re: Pentalty to teamkill. - miokie - 08.11.2009

If you use gTeam

OnPlayerDeath add:
pawn Код:
if(gTeam[killerid] == gTeam[playerid])
{
SetPlayerHealth(killerid,0.0);
SendClientMessage(killerid,COLOR,"Killed for teamkilling!");
}



Re: Pentalty to teamkill. - DiddyBop - 08.11.2009

well it compiled.. idk if it gonna work... cant test on myself >_> gotta wait lol


Re: Pentalty to teamkill. - AKA_Cross - 08.11.2009

pawn Код:
//Top of Script
new TeamKilling[MAX_PLAYERS];

public OnPlayerDeath(playerid, killerid, reason)
{
    if(gTeam[killerid] == gTeam[playerid])
    {
        TeamKilling[killerid]++;
        SetPlayerHealth(killerid,0.0);
        if(TeamKilling[killerid] == 4)
        {
            new name[MAX_PLAYER_NAME], string[128];
            GetPlayerName(killerid, name, sizeof(name));
            format(string, sizeof(string), "[ADMIN] %s has been kicked Reason: Consecutive Team killing", name);
            SendClientMessageToAll(0xFFFF00AA, string);
            Kick(killerid);
        }
        return SendClientMessage(killerid,0xFFFF00AA,"You were Killed for teamkilling!");
    }
    return 1;
}



Re: Pentalty to teamkill. - DiddyBop - 08.11.2009

thx venom testing now..