A little help. - 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)
+--- Thread: A little help. (
/showthread.php?tid=365059)
A little help. -
TaLhA XIV - 01.08.2012
Hello,
I wanted to ask that how to set a player's team,like if there are teams like medical,security,and then a I type a command /faccept and it set the player team to medical or secrurity.
Re: A little help. -
Roko_foko - 01.08.2012
You can with
SetPlayerTeam or using variables( what I see as better way because SetPlayerTeam don't allow teamkill)
Re: A little help. -
XStormiest - 01.08.2012
lol is the wrong thing i ever heard:
in top of script
pawn Код:
#define TEAM_RED 0
#define TEAM_BLUE 1
new dTeam[MAX_PLAYERS];
for setting the team
dTeam[playerid] = value // exaple dTeam[playerid] = TEAM_BLUE/RED or your team this think with red/blue was an ideea
for veffy is is in that team
if(dTeam[playerid] != TEAM_RED) return 0; //so if team is not = with red => will not return the value , so nothing will be happened...
you will must/can replace RED/ Blue with your team name this was only an example
and now you can do the rest and for anti team kill
pawn Код:
if(dTeam[killerid] == dTeam[playerid] )
{
SetPlayerHealth(killerid,0);
SendClientMessage(killerid,-1,"Kill team-mates is not allowed!");
return 1;
}