DM lil help - 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: DM lil help (
/showthread.php?tid=237520)
DM lil help -
tanush - 09.03.2011
how i make players cant shoot their team?? im using gTeam
Re: DM lil help - rjjj - 09.03.2011
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
Re: DM lil help -
tanush - 09.03.2011
how can i make the playerid not lose health while killer(same gang)shoots. i dont want the killer to die
Re: DM lil help -
Ricop522 - 09.03.2011
pawn Код:
public OnPlayerShootPlayer(shooter,target,Float:damage)
{
if(gTeam[shooter] == gTeam[target])
{
SendClientMessage(shooter,0xFFFFFFAA,"Don't shoot your friend ! xD");
}
return 1;
}
Re: DM lil help -
tanush - 09.03.2011
playeers in my taem could shoot. i want my team to not lose health! the target
AW: Re: DM lil help -
Nero_3D - 09.03.2011
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
Re: DM lil help -
admantis - 09.03.2011
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);
}
}
Re: DM lil help -
tanush - 09.03.2011
Dude listen lol. Imagine admantis is in my team and i shoot him. how do i make him NOT LOSE HEALTH!!!!
Re: DM lil help -
Snipa - 10.03.2011
You do what admantis said. Setting the team prevents team-kill
Re: DM lil help -
tanush - 10.03.2011
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.