Faction Command - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Faction Command (
/showthread.php?tid=113822)
Faction Command -
TheNotorius - 16.12.2009
Hey Guys, umm i need some help.
I got some factions and i need to know how i can set it so only the faction members can use the commands ive set up.
ive been struggling with it for days
help Would be much appreciated =]
Re: Faction Command -
TheNotorius - 16.12.2009
Bump.
Re: Faction Command -
Donny_k - 16.12.2009
pawn Код:
//the command
if ( myFaction == some_faction )
{
//allow
}
else
{
//tell them they aren't allowed etc
}
Anything like factions, groups etc is just a variable value, it's not native so look where you created the faction to get the correct array (gFactions or something) then use that.
Re: Faction Command -
Mike Garber - 16.12.2009
pawn Код:
// Put this inside the command
if(gteam[playerid] == Team_TEAMNAME){ // If you have gTeams put the teamname here.
// Action
}else{
SendClientMessage(playerid,0xDEEE20FF, "You are not authorized to use this command.");
return 1;
}
// Example
// TOP of your script
#define Team_Admin 0
// Under OnPlayerCmdText
if (strcmp(cmdtext, "/kill", true) == 0){
if(gteam[playerid] == Team_Admin){
SetPlayerHealth(playerid, 0);
}else{
SendClientMessage(playerid, 0xDEEE20FF, "You are not authorized to use this command");
return 1;
}} // Might have forgot one bracket ( }) so If It gives you an error when you try It, add another or remove one.
I'm not at home so I cannot try It.