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

Ammo display


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tomes11
Member
Join Date: Apr 2010
Old 01-25-2013 , 10:07   Ammo display
Reply With Quote #1

Hi

There is a problem with the ammo show, cuz it dont go above 254. Soo i wanted to add a current BP ammo hud but whats the command for it? to know my current bp ammo?

edit1:found the ammo code, but now how to make that the game check it? So whenever i use +reload it re calculate it.

Last edited by tomes11; 01-26-2013 at 02:16.
tomes11 is offline
tomes11
Member
Join Date: Apr 2010
Old 01-26-2013 , 08:26   Re: Ammo display
Reply With Quote #2

help???
tomes11 is offline
tomes11
Member
Join Date: Apr 2010
Old 01-27-2013 , 06:26   Re: Ammo display
Reply With Quote #3

Hud is now look like this:

PHP Code:
show_hudmessage(0BP ammo: [%i] , cs_get_user_bpammo(id)) 
But not wroking. Whats the correct mode of using bp ammo??
tomes11 is offline
gogicaa
Veteran Member
Join Date: Aug 2011
Location: //
Old 01-27-2013 , 14:17   Re: Ammo display
Reply With Quote #4

PHP Code:
"BP ammo: [%i]" 
gogicaa is offline
gpower
Member
Join Date: Sep 2012
Old 01-27-2013 , 16:39   Re: Ammo display
Reply With Quote #5

Deleted
__________________

Last edited by gpower; 01-27-2013 at 18:02.
gpower is offline
Send a message via Skype™ to gpower
gogicaa
Veteran Member
Join Date: Aug 2011
Location: //
Old 01-27-2013 , 17:05   Re: Ammo display
Reply With Quote #6

cs_get_user_bpammo(index, weapon)
gogicaa is offline
tomes11
Member
Join Date: Apr 2010
Old 01-28-2013 , 08:42   Re: Ammo display
Reply With Quote #7

Now it can compile it but didn't show anything :S

PHP Code:
public HUDUpdate(idindexweapon)
{
    if(
is_user_connected(id))
    {
        
set_hudmessage(get_cvar_num("zphud_rcolor"),get_cvar_num("zphud_gcolor"),get_cvar_num("zphud_bcolor"), -1.00.0500.50.5)
        
show_hudmessage(0"BP ammo: [%i]" cs_get_user_bpammo(indexweapon))
    }

of course its not the full code, jsut the hud.
tomes11 is offline
gpower
Member
Join Date: Sep 2012
Old 01-28-2013 , 08:55   Re: Ammo display
Reply With Quote #8

Can you show me your plugin ?
gpower is offline
Send a message via Skype™ to gpower
tomes11
Member
Join Date: Apr 2010
Old 01-28-2013 , 08:58   Re: Ammo display
Reply With Quote #9

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <zombieplague>
#include <dhudmessage>
#include <fun>
#include <cstrike>
#include <fakemeta>
#include <csx>

#define TASK_SHOWHUD 100
#define ID_SHOWHUD (taskid - TASK_SHOWHUD)

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
set_task(0.5,"HUDUpdate"0,"",0,"b")
    
    
/* CVARS */
    
    
register_cvar("zphud_rcolor","0"// RED
    
register_cvar("zphud_gcolor","255"// GREEN
    
register_cvar("zphud_bcolor","0"// BLUE
    
    
}

public 
client_putinserver(id)
{
    if (!
is_user_bot(id))
    {
        
// Set the custom HUD display task
        
set_task(1.0"HUDUpdate"id+TASK_SHOWHUD__"b")
    }
    
}


public 
HUDUpdate(idindexweapon)
{
    if(
is_user_connected(id))
    {
        
set_hudmessage(get_cvar_num("zphud_rcolor"),get_cvar_num("zphud_gcolor"),get_cvar_num("zphud_bcolor"), -1.00.0500.50.5)
        
show_hudmessage(0"BP ammo: [%i]" cs_get_user_bpammo(indexweapon))
    }
}

/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1038\\ f0\\ fs16 \n\\ par }
*/ 
tomes11 is offline
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 01-28-2013 , 19:16   Re: Ammo display
Reply With Quote #10

Try.
PHP Code:
// Includes.
#include < amxmodx >
#include < cstrike >
#include < dhudmessage >

// Plugin Name, Author,Version.
#define _PLUGIN    "[ZP] Show Ammo Hud"
#define _AUTHOR       "H.RED.ZONE"
#define _VERSION          "1.0"

// Cvars.
new _pCvarRedColor
    
,_pCvarGreenColor
    
,_pCvarBlueColor

// Task.
#define TASK_SHOWHUD 121
#define ID_SHOWHUD (taskid - TASK_SHOWHUD)    
    
// Called When Map Loads.
public plugin_init( ) { 
    
    
// Register Plugin.
    
register_plugin_PLUGIN_VERSION_AUTHOR )
    
    
// Cvars.
    
_pCvarRedColor register_cvar"zphud_rcolor","0" // Red
    
_pCvarGreenColor register_cvar"zphud_gcolor","255" // Green
    
_pCvarBlueColor register_cvar"zphud_bcolor","0" // Blue
}

// Client Put In Server.
public client_putinserverplr ){
    
    
// If user Is Not Bot.
    
if ( !is_user_bot(plr) ) {
        
        
// Set Task Show Hud.
        
set_task1.0"ShowHUD"plr+TASK_SHOWHUD__"b" )
    }
}

// Show Hud.
public ShowHUD(plr) {
    
    
// If User Is Alive.
    
if(is_user_alive(plr)) {
        
        
// Hud Message.
        
set_hudmessageget_pcvar_num(_pCvarRedColor),get_pcvar_num(_pCvarGreenColor),get_pcvar_num(_pCvarBlueColor), -1.00.0500.50.5 )
        
show_hudmessageplr"BP ammo: [ %d ]" cs_get_weapon_ammo(plr) )
    }

__________________
H.RED.ZONE 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 01:06.


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