SA-MP Forums Archive
How do i put anti team kill in my GANGWAR SERVER? - 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: How do i put anti team kill in my GANGWAR SERVER? (/showthread.php?tid=133325)



How do i put anti team kill in my GANGWAR SERVER? - Arsham7 - 11.03.2010

Well okay guys im using " http://forum.sa-mp.com/index.php?topic=47099.0 " By Lethal, and i was wondering how i can make anti team kill like if a grove member attacks another grove member nothing happens... like TEAM invisibility like if im grove i cant hurt another grove, if im cop i cant hurt another cop... pretty much like that guys please HELP!

im using "gTeam" well thats what it sais in my GM


Re: How do i put anti team kill in my GANGWAR SERVER? - lameguy - 11.03.2010

You can check when player dies if killer is in same team, and them do something for the killer.
Team mates will still be able to hurt each other, but if they kill player in same team then something happends.

Код:
if(gTeam[killerid] == gTeam[playerid]) {
Do something
}



Re: How do i put anti team kill in my GANGWAR SERVER? - StreetGT - 11.03.2010

try it http://forum.sa-mp.com/index.php?topic=131835.0


Re: How do i put anti team kill in my GANGWAR SERVER? - Arsham7 - 11.03.2010

Quote:
Originally Posted by Johnson_boy
You can check when player dies if killer is in same team, and them do something for the killer.
Team mates will still be able to hurt each other, but if they kill player in same team then something happends.

Код:
if(gTeam[killerid] == gTeam[playerid]) {
Do something
}
well thanks but what do you mean by the " do something? " like can you make it for me so nothing happens.. like the health doesnt go down please


Re: How do i put anti team kill in my GANGWAR SERVER? - StreetGT - 11.03.2010

man, i can't help you so much, but try see here
https://sampwiki.blast.hk/wiki/GetPlayerTeam
https://sampwiki.blast.hk/wiki/SetPlayerTeam
https://sampwiki.blast.hk/wiki/SetTeamCount


Re: How do i put anti team kill in my GANGWAR SERVER? - StreetGT - 11.03.2010

you can use i too,
i use it

Код:
 // Under OnPlayerDeath
 if(killerid == INVALID_PLAYER_ID) {

    SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);

	} else {

    if(gTeam[killerid] != gTeam[playerid]) {

	  	// Valid kill

	  	SendDeathMessage(killerid,playerid,reason);
		SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
		GivePlayerMoney(killerid, 1000);



Re: How do i put anti team kill in my GANGWAR SERVER? - lameguy - 12.03.2010

Quote:
Originally Posted by WeeD*
Quote:
Originally Posted by Johnson_boy
You can check when player dies if killer is in same team, and them do something for the killer.
Team mates will still be able to hurt each other, but if they kill player in same team then something happends.

Код:
if(gTeam[killerid] == gTeam[playerid]) {
Do something
}
well thanks but what do you mean by the " do something? " like can you make it for me so nothing happens.. like the health doesnt go down please
With do something i mean like you could get 1 score off from killer, kill the killer, jail the killer, etc...





Quote:
Originally Posted by [69
StreetGT ]
you can use i too,
i use it

Код:
 // Under OnPlayerDeath
 if(killerid == INVALID_PLAYER_ID) {

    SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);

	} else {

    if(gTeam[killerid] != gTeam[playerid]) {

	  	// Valid kill

	  	SendDeathMessage(killerid,playerid,reason);
		SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
		GivePlayerMoney(killerid, 1000);
Checking if killer is invalid playerid is not necessary in samp 0.3.
So this part is not needed:
Код:
if(killerid == INVALID_PLAYER_ID) {
  SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);
}



Re: How do i put anti team kill in my GANGWAR SERVER? - biltong - 12.03.2010

On protect the president you can't kill team mates. You can shoot them all you like, but you won't kill them. Unless you're in a car.

I think that's what he wants, but I have no idea how to do it.


Re: How do i put anti team kill in my GANGWAR SERVER? - lameguy - 12.03.2010

SetPlayerTeam.

on wiki it says: Note: Players on the same team can not kill eachother
SetPlayerTeam at wiki.samp.com