AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Gives to everyone (https://forums.alliedmods.net/showthread.php?t=106376)

edga85 10-14-2009 13:56

Gives to everyone
 
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));
}
}


xPaw 10-14-2009 14:12

Re: Gives to everyone
 
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 ) );



edga85 10-14-2009 14:26

Re: Gives to everyone
 
Thanks


All times are GMT -4. The time now is 22:39.

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