Don't let the health change if player from the same team how to do that???
#1

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

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

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

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

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

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

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?
Reply
#8

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)