Raised This Month: $51 Target: $400
 12% 

Model on frag leader


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dendodo1235
Member
Join Date: Feb 2015
Old 03-23-2015 , 19:12   Model on frag leader
Reply With Quote #1

here is the thing : in csdm server, frag leader would get a king hat(like king crown) on his head. If another player becomes leader the plugin would remove the previous hat and puts the hat on new score leader. Is it possible guys ??

Last edited by dendodo1235; 03-23-2015 at 19:14.
dendodo1235 is offline
Shiina.Mashiro
Senior Member
Join Date: Sep 2014
Location: Vietnam
Old 03-24-2015 , 01:47   Re: Model on frag leader
Reply With Quote #2

Yes it is. But I think we need to edit on CSDM's sma file
__________________
Shiina.Mashiro is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 03-24-2015 , 02:36   Re: Model on frag leader
Reply With Quote #3

Quote:
Originally Posted by Shiina.Mashiro View Post
Yes it is. But I think we need to edit on CSDM's sma file
Or you use get_user_frags() or you register each kill manually and hold it in a variable.
__________________
Kia is offline
dendodo1235
Member
Join Date: Feb 2015
Old 03-24-2015 , 02:56   Re: Model on frag leader
Reply With Quote #4

I'm not actually using csdm mod. Server is using advangedrespawn + specific gunmenu plugin. I dont have scripting knowlage. So im begging you make it real guys
dendodo1235 is offline
Obada
Senior Member
Join Date: Dec 2014
Location: Abu Dhabi
Old 03-24-2015 , 03:20   Re: Model on frag leader
Reply With Quote #5

Do you have the model?
Obada is offline
dendodo1235
Member
Join Date: Feb 2015
Old 03-24-2015 , 04:50   Re: Model on frag leader
Reply With Quote #6

I dont have. But it doesnt have to be a crown.
dendodo1235 is offline
Shiina.Mashiro
Senior Member
Join Date: Sep 2014
Location: Vietnam
Old 03-24-2015 , 08:26   Re: Model on frag leader
Reply With Quote #7

Didn't test it yet, but compiled fine.
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <engine>

#define PLUGIN "Leader Hats"
#define VERSION "1.0"
#define AUTHOR "S.M"

new topfragleader

new const hats_model[] = "models/leaderhats.mdl"

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_event("DeathMsg""Event_DeathMsg""a")
}
public 
plugin_precache()
{
    
precache_model(hats_model)
}
public 
Event_DeathMsg()
{
    new 
killer read_data(1)
    if(
is_user_connected(killer))
    {
        if(
get_user_frags(killer) > topfrag)
        {
            
topfrag get_user_frags(killer)
            if(
leader != 0)
                
remove_hats(leader)
            
give_hats(killer)
            
leader killer
        
}
    }
}
public 
give_hats(id)
{
    new 
ent create_entity("info_target")
    
set_pev(entpev_classname"leaderhats")
    
set_pev(entpev_movetypeMOVETYPE_FOLLOW)
    
set_pev(entpev_aimentid)
    
set_pev(entpev_ownerid)
    
engfunc(EngFunc_SetModelenthats_model)
}
public 
remove_hats(id)
{
    new 
ent = -1
    
while((ent find_ent_by_class(ent"leaderhats")))
    {
        if(
pev(entpev_owner) != id)
            continue
        if(
pev_valid(ent))
            
remove_entity(ent)
    }

__________________
Shiina.Mashiro is offline
dendodo1235
Member
Join Date: Feb 2015
Old 03-24-2015 , 09:37   Re: Model on frag leader
Reply With Quote #8

it is working awesome man thank you very much!
I used this model leadershats.zip

I havent fully tested it but when the leader disconnects leaadermodel disappears until some1 reaches disconnected leader's frag.
example:
Leader's frag: 34
2nd players frag: 20

if leader disconnects the model disappears until the 2nd player reaches 35 ?
dendodo1235 is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 03-24-2015 , 09:43   Re: Model on frag leader
Reply With Quote #9

Add this:
Code:
public client_disconnect(id) topfrag = 0
__________________
Kia is offline
dendodo1235
Member
Join Date: Feb 2015
Old 03-24-2015 , 10:59   Re: Model on frag leader
Reply With Quote #10

I will try again. Thank you very much ! This plugin is awesome.
dendodo1235 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:31.


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