Anti Team Kill
#1

How can you create a Anti Team Kill+where do i need to place it
Reply
#2

Please take a look at this function

https://sampwiki.blast.hk/wiki/SetPlayerTeam

and here you have a few tutorials and questions already made here where you can find some answers

Click me
Reply
#3

Quote:
Originally Posted by iJumbo
Посмотреть сообщение
Please take a look at this function

https://sampwiki.blast.hk/wiki/SetPlayerTeam

and here you have a few tutorials and questions already made here where you can find some answers

Click me
Well i use this one, But some gang cant kill each other (Like: Grove street cant kill cops)
Reply
#4

Maybe you are wrong in some part of your code
Reply
#5

Nope i just use the wiki thing
Reply
#6

Show that code
Reply
#7

Simple as:

pawn Код:
public OnPlayerUpdate(playerid)
{
    new targetplayer = GetPlayerTargetPlayer(playerid); // Store the ID
    if(GetPlayerTeam(targetplayer) == GetPlayerTeam(playerid) && targetplayer != INVALID_PLAYER_ID)
    {
        GameTextForPlayer(playerid, "~R~do not shoot at team-mates!", 5000, 3);
    }
}
and

pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
    new string[128], Float:hp;
    GetPlayerHealth(damagedid, hp);
    SetPlayerHealth(damagedid, hp+amount);
    GameTextForPlayer(playerid, "Don't shoot at team mates!", 3000, 5);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)