Faction Command
#1

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 =]
Reply
#2

Bump.
Reply
#3

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

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)