SA-MP Forums Archive
Don't let the health change if player from the same team how to do that??? - 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: Don't let the health change if player from the same team how to do that??? (/showthread.php?tid=89218)



Don't let the health change if player from the same team how to do that??? - RyDeR` - 31.07.2009

Hello, I'm making a mod there are 2 teams but if anyone shoot anyone from the same team I don't want that the health changes, anybody know how to do that?? Thank you..


Re: Don't let the health change if player from the same team how to do that??? - MadeMan - 31.07.2009

You have to set up the SAMP native teams with SetPlayerTeam or AddPlayerClassEx then the anti-teamkill is on.

https://sampwiki.blast.hk/wiki/SetPlayerTeam
https://sampwiki.blast.hk/wiki/AddPlayerClassEx


Re: Don't let the health change if player from the same team how to do that??? - RyDeR` - 31.07.2009

Quote:
Originally Posted by MadeMan
You have to set up the SAMP native teams with SetPlayerTeam or AddPlayerClassEx then the anti-teamkill is on.

https://sampwiki.blast.hk/wiki/SetPlayerTeam
https://sampwiki.blast.hk/wiki/AddPlayerClassEx
Can you make one or example someting? I can't


Re: Don't let the health change if player from the same team how to do that??? - James_Alex - 31.07.2009

juste freeze the player health when a player in the same team attack you
set a timer, and set the health the same in the timer


Re: Don't let the health change if player from the same team how to do that??? - MadeMan - 31.07.2009

Quote:
Originally Posted by ► James_Alex
juste freeze the player health when a player in the same team attack you
set a timer, and set the health the same in the timer
How does he know who shot the player?


Re: Don't let the health change if player from the same team how to do that??? - Correlli - 31.07.2009

Quote:
Originally Posted by ► James_Alex
juste freeze the player health when a player in the same team attack you
set a timer, and set the health the same in the timer
You can't detect when someone is shooting/attacking you.


Re: Don't let the health change if player from the same team how to do that??? - RyDeR` - 01.08.2009

Quote:
Originally Posted by Don Correlli
Quote:
Originally Posted by ► James_Alex
juste freeze the player health when a player in the same team attack you
set a timer, and set the health the same in the timer
You can't detect when someone is shooting/attacking you.
Yes you can, In the MM server you can't shoot each other the health don't change, I want sometinh like that but I don't have an idea how :S Someone who know how?


Re: Don't let the health change if player from the same team how to do that??? - SpiderPork - 01.08.2009

NOTE: I did not make this:

pawn Код:
// Forwards
forward SettingPlayerTeam();

// OnGameModeInit
SetTimer("SettingPlayerTeam", 10, 1);

// On the end of your script
public SettingPlayerTeam()
{
   for(new i; i< MAX_PLAYERS; i++) SetPlayerTeam(i, gTeam[i]);
   return 1;
}
You need gTeam though.
But you can easily just use SetPlayerTeam under OnPlayerSpawn.


Re: Don't let the health change if player from the same team how to do that??? - RyDeR` - 01.08.2009

Quote:
Originally Posted by SpiderPork
NOTE: I did not make this:

pawn Код:
// Forwards
forward SettingPlayerTeam();

// OnGameModeInit
SetTimer("SettingPlayerTeam", 10, 1);

// On the end of your script
public SettingPlayerTeam()
{
  for(new i; i< MAX_PLAYERS; i++) SetPlayerTeam(i, gTeam[i]);
  return 1;
}
You need gTeam though.
But you can easily just use SetPlayerTeam under OnPlayerSpawn.
Thanks mate but I don't want set a team, I want if anybody shoot a player in the same team the health don't let change .


Re: Don't let the health change if player from the same team how to do that??? - MadeMan - 01.08.2009

You don't have to do more than just set teams. Do you understand this?