[HELP] Script for Anti-Team kill [HELP]
#1

Hiya!

I need a script for Anti-Team mate kill, so you CAN'T kill team mates.

Thanks!
Reply
#2

Just set players to the same team with SetPlayerTeam, then they cannot damage eachother.
Reply
#3

Mmm, can you help a bit? thanks btw
Reply
#4

Help with what?
There's a lot of information on the wiki.
Reply
#5

Where I need to add the script?
Reply
#6

The wiki has information on pretty much everything you'd need, but what do you need help with?
Reply
#7

Okay, that script: public OnPlayerSpawn(playerid)
{
// Set a player's team to 4 when they spawn
SetPlayerTeam(playerid, 4);
return 1;
}

Do I need to add SetPlayerTeam(playerid, 4); by OnPlayerSpawn section?
Reply
#8

SetPlayerTeam(playerid, teamid) where-ever you want to set the player's team.
Using that, will set the player's team to 4, when they spawn, as it pretty much says.
But you can just use team 0, 1, 2, 3 or anything else.
As long as the team ID of one player is the same as the other player, they cannot damage eachother, so if you want nobody to be able to damage eachother, that should work fine.
Reply
#9

You could also only use AddPlayerClassEx instead of AddPlayerClass
They do both the same just that the first has an additional team parameter
Reply
#10

EDIT: FIXED! Thanks guys
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)