16.01.2014, 11:24
Need help i have defined team ids in my GM and I have a command /cmd in FS I want to make it unavailable for team id 28 how can i do it. Please post a example code to make me understan the function.
if(GetPlayerTeam(playerid) == 28) // If the player was in team id28
{
SendClientMessage(playerid, 0xFF0000FF, "The team your in cannot use this command!"); // Telling them they can't use it.
return 1;
}
#define TEAM_DM 28 //at the top
new gTeam[MAX_PLAYERS];//at the top
SetPlayerTeamFromClass(playerid, classid)
{
if(classid == 28)
{
gTeam[playerid] = TEAM_DM;
}
}
If you want to share information between your gamemode and a filterscript, you will have to use PVars.
There is loads of information available on here about PVars, but I'd recommend that you look at this tutorial: https://sampforum.blast.hk/showthread.php?tid=261584 You could also merge your FS with your gamemode and that would eliminate your main problem here. |