DM lil help
#1

how i make players cant shoot their team?? im using gTeam
Reply
#2

Using the OnPlayerShootPlayer include: https://sampforum.blast.hk/showthread.php?tid=195439

Make the code like this :

pawn Код:
public OnPlayerShootPlayer(shooter,target,Float:damage)
{
     if(gTeam[shooter] == gTeam[target])
     {
        SendClientMessage(shooter,0xFFFFFFAA,"Don't shoot your friend ! xD");
        SetPlayerHealth(shooter, 0.0);
     }
     return 1;
}
I hope that i have helped
Reply
#3

how can i make the playerid not lose health while killer(same gang)shoots. i dont want the killer to die
Reply
#4

pawn Код:
public OnPlayerShootPlayer(shooter,target,Float:damage)
{
     if(gTeam[shooter] == gTeam[target])
     {
        SendClientMessage(shooter,0xFFFFFFAA,"Don't shoot your friend ! xD");
     }
     return 1;
}
Reply
#5

playeers in my taem could shoot. i want my team to not lose health! the target
Reply
#6

Quote:
Originally Posted by tanush
Посмотреть сообщение
playeers in my taem could shoot. i want my team to not lose health! the target
you could try to use a translater...

do you mean friendly fire (so the teammates can shoot each other without loosing health) ?
Than you need to use the native team functions
Reply
#7

You can implement this
pawn Код:
public OnPlayerSpawn(playerid)
{
    switch gTeam[playerid]
    {
        case TEAM_1: SetPlayerTeam(playerid, TEAM_1);
        case TEAM_2: SetPlayerTeam(playerid, TEAM_2);
    }
}
Reply
#8

Dude listen lol. Imagine admantis is in my team and i shoot him. how do i make him NOT LOSE HEALTH!!!!
Reply
#9

You do what admantis said. Setting the team prevents team-kill
Reply
#10

D:\Users\Tanush\Desktop\samp dm\gamemodes\DM.pwn(286) : error 001: expected token: "do", but found "{"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)