Thread: [ZR] Leader
View Single Post
Elitcky
AlliedModders Donor
Join Date: Jun 2016
Location: Antofagasta, Chile
Old 11-07-2017 , 03:54   Re: [ZR] Leader
Reply With Quote #2

Cool! Going to try it

Edit: All working!

Defend (spanish sv)


Follow me (spanish sv)


Bugs: If you are an admin, the plugin doesn't care if you are zombie or not... Please set than just "HUMAN ADMINS" can use the !leader because "ZOMBIE ADMINS" can type !leader and they get the leader being zombie...

i know i said the bug at the top but well i fixed it in my sv making it this way :v
PHP Code:
public Action Leader(int clientint args)
{
    if(
CheckCommandAccess(client"sm_admin"ADMFLAG_GENERICfalse) && !ZR_IsClientZombie(client))
    {
        if(
args == 1)
        {
            
char arg1[65];
            
GetCmdArg(1arg1sizeof(arg1));
            
int target FindTarget(clientarg1falsefalse);
            if (
target == -1)
            {
                return 
Plugin_Handled;
            }

            if(
target == leaderClient)
            {
                
LeaderMenu(target);
            }
            else
            {
                if(
IsPlayerAlive(target))
                {
                    
SetLeader(target);
                    
PrintToChatAll("[SM] %N is the new leader!"target);
                    
PrintToChat(target"[SM] You are now the leader! Type !leader to open up the leader menu.");
                    
LeaderMenu(target);
                }
                else
                {
                    
ReplyToCommand(client"[SM] The target has to be alive!");
                }
            }
        }
        else if(
args == 0)
        {
            if(
client == leaderClient)
            {
                
LeaderMenu(client);
                return 
Plugin_Handled;
            }
            if(
IsPlayerAlive(client))
            {
                
SetLeader(client);
                
PrintToChatAll("[SM] %N is the new leader!"client);
                
PrintToChat(client"[SM] You are now the leader! Type !leader to open up the leader menu.");
                
LeaderMenu(client);
            }
            else
            {
                
ReplyToCommand(client"[SM] The target has to be alive!");
            }
        }
        else
        {
            
ReplyToCommand(client"[SM] Usage: sm_leader <optional: client|#userid>");
        }
    }
    else if(
CheckCommandAccess(client"sm_admin"ADMFLAG_GENERICfalse) && ZR_IsClientZombie(client))
    {
        
PrintToChat(client"[SM] You are admin but you are not human, do not try to abuse.");
    }
    
    if(
client == leaderClient)
    {
        
LeaderMenu(client);
    }
    return 
Plugin_Handled;

__________________

Last edited by Elitcky; 11-07-2017 at 06:01. Reason: hmm
Elitcky is offline