Raised This Month: $ Target: $400
 0% 

Gives to everyone


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
edga85
BANNED
Join Date: Jan 2009
Old 10-14-2009 , 13:56   Gives to everyone
Reply With Quote #1

Why it gives ammo packs to everyone if have to give only admins with ADMIN_LEVEL_H when human kills zombie?
Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <zombieplague>
 
new g_kill_ammo
new attacker
 
public plugin_init(){
register_plugin("Give Ammo Packs", "1.0", "aaarnas")
g_kill_ammo = register_cvar("zpvip_kill_ammo", "2")
 
register_event("DeathMsg","death_msg","a")
}
 
public death_msg(){ 
if(get_user_flags ( attacker ) & ADMIN_LEVEL_H ) 
{ 
new attacker = read_data(1)
zp_set_user_ammo_packs(attacker, zp_get_user_ammo_packs(attacker) + get_pcvar_num(g_kill_ammo)); 
} 
}
edga85 is offline
Send a message via Skype™ to edga85
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 10-14-2009 , 14:12   Re: Gives to everyone
Reply With Quote #2

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

new g_pKillAmmo;
 
public 
plugin_init( ) {
    
register_plugin"Give Ammo Packs""1.0""aaarnas" );
    
    
g_pKillAmmo register_cvar"zpvip_kill_ammo""2" );
    
    
register_event"DeathMsg""death_msg""a" );
}
 
public 
death_msg( ) {
    new 
iAttacker read_data);
    
    if( 
get_user_flagsiAttacker ) & ADMIN_LEVEL_H )
        
zp_set_user_ammo_packsiAttackerzp_get_user_ammo_packsiAttacker ) + get_pcvar_numg_pKillAmmo ) );

__________________
xPaw is offline
edga85
BANNED
Join Date: Jan 2009
Old 10-14-2009 , 14:26   Re: Gives to everyone
Reply With Quote #3

Thanks
edga85 is offline
Send a message via Skype™ to edga85
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 22:39.


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