Is this possible?
#1

Including from a post i saw
Quote:

ANTI-BETRAY SYSTEM! Is this possible?

Would it be possible to pretty much when a team kills another team member it kills them? for an example, Red kills red, the killer dies. Is that possible?
Reply
#2

you would need to do

OnPlayerShootPlayer

which can be downloaded

Then check the side there on and check which side they killed

then if they killed a team mate you can kill them by setting health to 0

Edit
PS: if you'd like help with the code post your team varibles and stuff here no the system just the varibles you have to find a team

EDIT https://sampforum.blast.hk/showthread.php?tid=195439 this should help you
Reply
#3

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(playerid != killerid && killerid != INVALID_PLAYER_ID && GetPlayerTeam(playerid) == GetPlayerTeam(killerid))
    SetPlayerHealth(killerid,0.0);
}
Reply
#4

Quote:
Originally Posted by PGTips
Посмотреть сообщение
you would need to do

OnPlayerShootPlayer

which can be downloaded

Then check the side there on and check which side they killed

then if they killed a team mate you can kill them by setting health to 0

PS: if you'd like help with the code post your team varibles and stuff here no the system just the varibles you have to find a team
He said kills, meaning OnPlayerDeath would be suitable.

Yes, you can do this - record what gang zone the player is fighting for and in OnPlayerDeath, check if killerid is for the same gang zone then use SetPlayerHealth() to set the player's health to 0.
Reply
#5

Quote:
Originally Posted by Calg00ne
Посмотреть сообщение
He said kills, meaning OnPlayerDeath would be suitable.

Yes, you can do this - record what gang zone the player is fighting for and in OnPlayerDeath, check if killerid is for the same gang zone then use SetPlayerHealth() to set the player's health to 0.
Oh sorry i though he like wanted it so like the betrayer dies for shooting somone ill read carfully next time
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)