Anti-TDM? - 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: Anti-TDM? (
/showthread.php?tid=232031)
Anti-TDM? -
101 - 26.02.2011
Well, what I need is pretty basic I think but I'm kinda stupid >.<
How to make anti-tdm? lets say i got
TEAM_SF and TEAM_BL
TEAM_SF cant attack others that are TEAM_SF, but they can attack TEAM_BL.
How to do that?
Re: Anti-TDM? -
Libra_PL - 26.02.2011
SetPlayerTeam.
To TEAM_SF, OnPlayerSpawn add SetPlayerTeam(playerid,0); , in TEAM_BL add SetPlayerTeam(playerid,1); Using this, you cannot kill players in your team.
Re: Anti-TDM? -
MadeMan - 26.02.2011
https://sampwiki.blast.hk/wiki/SetPlayerTeam
Re: Anti-TDM? -
101 - 27.02.2011
Yeah but wont that only set the team to player id 0? and 1?
Re: Anti-TDM? -
marinov - 27.02.2011
Quote:
Originally Posted by 101
Yeah but wont that only set the team to player id 0? and 1?
|
ofc not
Re: Anti-TDM? -
zSuYaNw - 27.02.2011
pawn Код:
// In OnPlayerDeath(...)
if(killerid == playerid) SendClientMessage(playerid, Color,"No Permissed Killing is here!"), Kick(playerid);
Re: Anti-TDM? -
Memoryz - 27.02.2011
Set everyone in one team, to team 1, and the other, to team 2, do it when they spawn
Re: Anti-TDM? -
101 - 27.02.2011
I'm kind of confused now >.<
Re: Anti-TDM? -
Master_Gangster - 27.02.2011
Quote:
Originally Posted by 101
I'm kind of confused now >.<
|
Код:
public OnPlayerSpawn(playerid)
{
// Set a player's team to 4 when they spawn
SetPlayerTeam(playerid, 4);
return 1;
}
and if you want to set the team numbers to a limit, let's say 18 do this:
Код:
public OnGameModeInit( )
{
// We use 18 teams in this use Team-Deathmatch mode, define it;
SetTeamCount( 18 );
return 1;
}
Quote:
Note: Players on the same team can not kill each other unless they use a knife.
|
Re: Anti-TDM? -
101 - 27.02.2011
Yes but
SetPlayerTeam(playerid, 4);
I don't want to do this, because it will only set them to the team ID 4, isnt there a global thing?