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

Bullets Count


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Tonda
Senior Member
Join Date: Aug 2009
Old 09-08-2014 , 23:11   Bullets Count
Reply With Quote #1

Hello, i need help with plugin. How can i count bullets. I try with cmd_start but this isnt good and tcurweapon - this way is good, but only one problem is bullets count after change weapon, buy weapon ... How can fix it?

PHP Code:
#include <amxmodx>

public plugin_init()
{
  
register_event("CurWeapon""Event_CurWeapon""be""1=1""3>0""2!4""2!6""2!9""2!25""2!29");
}

new 
g_iShotsFired[33];

public 
Event_CurWeaponid )
{
  
g_iShotsFired[id]++;
  
client_print(id4"%i shots fired"g_iShotsFired[id]);

Tonda is offline
xDoctor
Member
Join Date: Jul 2013
Old 09-09-2014 , 01:05   Re: Bullets Count
Reply With Quote #2

Try This Code..

PHP Code:
#include <amxmodx> 

public plugin_init() 

    
register_event("CurWeapon""Event_CurWeapon""be""1=1" ); 


new 
g_iShotsFired33 ]; 

public 
Event_CurWeaponid 
{
    if( 
get_user_weaponid ) == CSW_KNIFE || CSW_HEGRENADE || CSW_FLASHBANG || CSW_SMOKEGRENADE )
        return 
1;
        
    new 
iWeapon read_data);
    
    new 
szWeapon21 ];
    
    
get_weaponnameidszWeaponiWeapon );
    
    
client_print(idprint_console"You are using the weapon %s and you have shot %i bullets"szWeapong_iShotsFired[id]); 
    
    
g_iShotsFiredid ] ++;
    
    return 
1;

im going to school now but if you want i can make you Each bullets for weapon...

Last edited by xDoctor; 09-09-2014 at 01:07.
xDoctor is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-09-2014 , 03:39   Re: Bullets Count
Reply With Quote #3

Try to hook TraceAttack with Hamsandwich instead.
__________________
Arkshine is offline
Tonda
Senior Member
Join Date: Aug 2009
Old 09-09-2014 , 08:45   Re: Bullets Count
Reply With Quote #4

Quote:
Originally Posted by Arkshine View Post
Try to hook TraceAttack with Hamsandwich instead.
but this hook only bullet with damage, i need all bullets (missed and attacked)

Quote:
Originally Posted by xDoctor
Try This Code..
Not work
Tonda is offline
OnePL
BANNED
Join Date: May 2012
Location: GB
Old 09-09-2014 , 10:51   Re: Bullets Count
Reply With Quote #5

weapon = read_data(2) in CurWeapon event

Check:
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

new iShots[33];

public 
plugin_init() {
    
register_plugin("Shots Count""0.1""OnePL");

    for(new 
name[24], 1<= 30i++)
        if(!((
1<<29|1<<4|1<<25|1<<9|1<<6) & 1<<i) && get_weaponname(iname23))
            
RegisterHam(Ham_Weapon_PrimaryAttackname"PrimaryAttack"1);
}

public 
PrimaryAttack(ent) {
    if(
get_pdata_int(ent51) <= || get_pdata_float(ent46) < 0.0) return;

    static 
idid pev(ent18); // owner
    
client_print(id4"%i shots fired", ++iShots[id]);


Last edited by OnePL; 09-09-2014 at 10:55.
OnePL is offline
Send a message via ICQ to OnePL Send a message via AIM to OnePL Send a message via Yahoo to OnePL Send a message via Skype™ to OnePL
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 05:47.


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