TEAM_x commands - 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: TEAM_x commands (
/showthread.php?tid=361919)
TEAM_x commands -
SumX - 22.07.2012
Hello!
I start a new script and I add a turf system,with this tutorial
https://sampforum.blast.hk/showthread.php?tid=276352
As you see,the "factions" there are TEAM_BALLAS,TEAM_GROVE etc.How can I make some commands that only a member of one team can use them?
Ex:I chose when I log in TEAM_BALLAS.I want to make a command only for this team,the other teams cant use it.
Thank you!
Re: TEAM_x commands -
[KHK]Khalid - 22.07.2012
If you're using SetPlayerTeam to set teams, it's easy you can use
GetPlayerTeam to get a player's team, example:
pawn Код:
// in your command
if(GetPlayerTeam(playerid) != TEAM_BALLAS) // if in ballas team
{
// Code ..
return SendClientMessage(playerid, -1, "You need to be at ballas team to use this command!"); // error message
}
Re: TEAM_x commands -
SumX - 22.07.2012
Thank you,Inam browsing on my tablet now but tomorrow I will try your sugestion.
I was thinking to use this with gteam
https://sampwiki.blast.hk/wiki/PAWN_tutorial
Re: TEAM_x commands -
[KHK]Khalid - 22.07.2012
Quote:
Originally Posted by SumX
|
Yes, you'll have to use this if you aren't using SetPlayerTeam to set teams, but no need if you do.