AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [ZR] Leader (https://forums.alliedmods.net/showthread.php?t=302677)

AntiTeal 11-07-2017 03:11

[ZR] Leader
 
3 Attachment(s)
[ZR] Leader

Description
Allows for an admin to select or for regular players to vote for a human to be the leader for the current round. The leader gets special perks, like the ability to put defend here / follow me sprites above their head, place defend markers, toggle a rainbow beacon, custom chat, custom radio commands, and maybe more in the future.

Requirements
This plugin requires Zombie:Reloaded.

Server ConVars
  • sm_leader_version - Leader Version (2.9)
  • sm_leader_allow_votes - Determines whether players can vote for leaders. (Default: "1")
  • sm_leader_defend_vmt - The defend here .vmt file (Default: "materials/sg/sgdefend.vmt")
  • sm_leader_defend_vtf - The defend here .vtf file (Default: "materials/sg/sgdefend.vtf")
  • sm_leader_follow_vmt - The follow me .vmt file (Default: "materials/sg/sgfollow.vtf")
  • sm_leader_follow_vtf - The follow me .vtf file (Default: "materials/sg/sgfollow.vtf")

Commands
  • sm_leader - Access the leader menu OR Set a player to be leader (ADMFLAG_GENERIC)
  • sm_currentleader - Shows the current leader.
  • sm_voteleader <player> - Votes for the specified player to be leader. Required votes is current player count / 10.
  • sm_removeleader (ADMFLAG_GENERIC) - Removes the current leader.

Planned Features
  • Config
  • More extensive API
  • More rainbow stuff

API
Spoiler


Screenshots


Changelog
  • 2.9 - Plugin Release

If you find any bugs, feel free to give feedback so I can fix the plugin.

Elitcky 11-07-2017 03:54

Re: [ZR] Leader
 
Cool! Going to try it :D

Edit: All working! :D

Defend (spanish sv)
https://image.prntscr.com/image/PkhL...7T-BcU61EA.png

Follow me (spanish sv)
https://image.prntscr.com/image/sq5J...VSudpzufgw.png

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;


:crab::crab::crab:

Franc1sco 11-07-2017 07:53

Re: [ZR] Leader
 
Good job! finally someone that did the zr commander project that I was pending.

Some improvements that I saw:

-About Precache things and add to download tables is enought if you keep it only OnMapStart.
-In line 150 you create a new handle on every new map and this can cause memory leak. You should close it when you finished with it.
-Is recommended to upload the plugin on github or other git plataform for a good follow-up and support.


Really you made a good contributation to the ZE community, keep up the good job :up:

Zeddy_god 11-09-2017 01:01

Re: [ZR] Leader
 
Hey antiteal, great release!
Is it possible to make the !leader menu bound to a simple key such as +use automatically? So leaders can just press e to open menu and use instead of typing commands again and again! Cheers.

Rale 11-09-2017 06:28

Re: [ZR] Leader
 
Quote:

Originally Posted by Zeddy_god (Post 2559335)
Hey antiteal, great release!
Is it possible to make the !leader menu bound to a simple key such as +use automatically? So leaders can just press e to open menu and use instead of typing commands again and again! Cheers.


Did you tried bind "e" sm_leader

Elitcky 11-09-2017 07:31

Re: [ZR] Leader
 
Quote:

Originally Posted by Rale (Post 2559368)
Did you tried bind "e" sm_leader

He can do that, but he is going to overwrite the "+use" he should do something like
Bind e "+use;say /leader"
But a bind is not very efficient if you can actually edit the plugin and make the leader menu equals to +use command. So you can still have the bind e "+use"

andrew13 02-15-2018 01:23

Re: [ZR] Leader
 
Would you be able to make it so the playermodel changes once a user is leader and removes the playermodel when they are no longer leader?

Stewart Anubis 11-24-2020 10:20

Re: [ZR] Leader
 
New Functions, edited by me, that you want to test, feel free.

https://github.com/Stewart-Anubis/Zr...Anubis-Edition

https://github.com/Stewart-Anubis/Zr...chive/main.zip


All times are GMT -4. The time now is 13:17.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.