How do i put anti team kill in my GANGWAR SERVER?
#1

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
Reply
#2

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
}
Reply
#3

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

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
Reply
#5

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
Reply
#6

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);
Reply
#7

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);
}
Reply
#8

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.
Reply
#9

SetPlayerTeam.

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


Forum Jump:


Users browsing this thread: 2 Guest(s)