Posts: 190
Threads: 36
Joined: Aug 2009
Reputation:
0
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 =]
Posts: 1,506
Threads: 69
Joined: Feb 2008
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.