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

Subplugin Submission [ZP43|ZP50] Addon: Frags & Ammopacks Leader.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 03-25-2015 , 14:27   [ZP43|ZP50] Addon: Frags & Ammopacks Leader.
Reply With Quote #1

I see many people need this kind of plugin, so i write a plugin for it.

What does this plugin do?
Ok on round end a color chat message will appear to inform you who are leading the frags and ammopacks.

Screenshots:


ZP Version:
- All ZP43 & ZP50.

Credits:

Kiske -- for his original idea.

Changes Log:
Spoiler
Attached Files
File Type: sma Get Plugin or Get Source (zp_frag_pack_leaders.sma - 1107 views - 2.2 KB)

Last edited by yokomo; 04-10-2015 at 12:26. Reason: Update to version 0.0.3
yokomo is offline
wicho
Veteran Member
Join Date: Feb 2012
Location: GuateAmala
Old 04-02-2015 , 19:13   Re: [ZP43] Addon: Frags & Ammopacks Leader.
Reply With Quote #2

Not bad, I dont think this has problem for 5.0 but just in case..

PHP Code:
#include <amxmodx>
#include <zp50_ammopacks>

const TASK_LEADER 37032
new iMaxClientsiMsgSayText

public plugin_init()
{
    
register_plugin("Frags & Packs Leaders""0.0.1""wbyokomo")
    
iMaxClients get_maxplayers()
    
iMsgSayText get_user_msgid("SayText")
}

public 
zp_round_ended()
{
    
remove_task(TASK_LEADER)
    
set_task(random_float(1.0,1.5), "TaskShowLeader"TASK_LEADER)
}

public 
TaskShowLeader()
{
    new 
topfragtoppacktopftoppszName[32]
    
GetMostFrags(topfragtoppacktopftopp)
    
    if(
is_user_connected(topfrag))
    {
        
get_user_name(topfragszName31)
        
UTIL_ColorChat(0"^x04%s^x01 lead the frag with^x04 %d^x01 frags!"szNametopf)
    }

    if(
is_user_connected(toppack))
    {
        
get_user_name(toppackszName31)
        
UTIL_ColorChat(0"^x04%s^x01 lead the pack with^x04 %d^x01 packs!"szNametopp)
    }
}

GetMostFrags(&topfrag, &toppack, &topf, &topp)
{
    new 
fragpackj
    topfrag 
0
    toppack 
0
    topf 
= -1
    topp 
= -1
    
    
for(j=1;j<=iMaxClients;j++)
    {
        if(!
is_user_connected(j)) continue;
        
        
frag get_user_frags(j)
        if(
frag topf)
        {
            
topf frag
            topfrag 
j
        
}
        
        
pack zp_ammopacks_get(j)
        if(
pack topp)
        {
            
topp pack
            toppack 
j
        
}
    }
}

UTIL_ColorChat(id, const szText[], any:...)
{
    new 
szBuffer[512]
    
    if(!
id)
    {
        new 
iPlayers[32], iNumyid2
        get_players
(iPlayersiNum"ch")
        for(
y=0;y<iNum;y++)
        {
            
id2 iPlayers[y]
            if(!
is_user_connected(id2)) continue;
            
            
vformat(szBuffercharsmax(szBuffer), szText3)
            
message_begin(MSG_ONE_UNRELIABLEiMsgSayText_id2)
            
write_byte(id2)
            
write_string(szBuffer)
            
message_end()
        }
    }
    else
    {
        
vformat(szBuffercharsmax(szBuffer), szText3)
        
message_begin(MSG_ONEiMsgSayText_id)
        
write_byte(id)
        
write_string(szBuffer)
        
message_end()
    }


Last edited by wicho; 04-02-2015 at 19:23.
wicho 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 13:49.


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