Is this possible? - 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: Is this possible? (
/showthread.php?tid=273156)
Is this possible? -
Shockey HD - 31.07.2011
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?
Re: Is this possible? -
PGTips - 31.07.2011
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
Re: Is this possible? -
wups - 31.07.2011
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
if(playerid != killerid && killerid != INVALID_PLAYER_ID && GetPlayerTeam(playerid) == GetPlayerTeam(killerid))
SetPlayerHealth(killerid,0.0);
}
Re: Is this possible? -
Calgon - 31.07.2011
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.
Re: Is this possible? -
PGTips - 31.07.2011
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