TEAM_x commands
#1

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

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

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

Quote:
Originally Posted by SumX
Посмотреть сообщение
I was thinking to use this with gteam https://sampwiki.blast.hk/wiki/PAWN_tutorial
Yes, you'll have to use this if you aren't using SetPlayerTeam to set teams, but no need if you do.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)