Raised This Month: $ Target: $400
 0% 

[ZP] Help with ammo packs reward


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MaT'
Junior Member
Join Date: Apr 2010
Old 07-06-2010 , 12:36   [ZP] Help with ammo packs reward
Reply With Quote #1

My inglish is very bad :S

I need that the admins get and double ammo packs that players, i try with

PHP Code:
while (g_damagedealt[attacker] > get_pcvar_num(cvar_ammodamage))
{

    if(
get_user_flags(attacker) & ADMIN_KICK)
    {
        
g_ammopacks[attacker] += 2
    
}
    else
    {
    
g_ammopacks[attacker]++
    }
    
g_damagedealt[attacker] -= get_pcvar_num(cvar_ammodamage)

and work very well, but with this code the ammo add 2 and i want to add 1 but with a different cvar ej.: cvar_ADMammodamage to put the half of value

What would the code with that while?
MaT' is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 07-06-2010 , 12:57   Re: [ZP] Help with ammo packs reward
Reply With Quote #2

if i understand it right you want an admin to have 2 times as many packs as a player. And you want to have the amount of packs registered in a cvar?

EDIT:
This should do it i think. Make a cvar for the amount.
PHP Code:
while(g_damagedealt[attacker] > get_pcvar_num(cvar_ammodamage))
{
    new 
amount get_pcvar_num(cvar_packs_reward)
    
    if(
get_user_flags(attacker) & ADMIN_KICK)
    {
        
g_ammopacks[attacker] += amount 2
    
}
    else
    {
        
g_ammopacks[attacker] += amount
    
}
    
g_damagedealt[attacker] -= get_pcvar_num(cvar_ammodamage)

__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.

Last edited by drekes; 07-06-2010 at 13:00.
drekes is offline
Send a message via MSN to drekes
MaT'
Junior Member
Join Date: Apr 2010
Old 07-06-2010 , 13:29   Re: [ZP] Help with ammo packs reward
Reply With Quote #3

This is i want, but i don't know that it's ok

PHP Code:
if (get_user_flags(attacker) & ADMIN_LEVEL_B)
{
    while (
g_damagedealt[attacker] > get_pcvar_num(cvar_ADMammodamage)) //cvar_ADMammodamage = 250
    
{
        
g_ammopacks[attacker]++
        
g_damagedealt[attacker] -= get_pcvar_num(cvar_ADMammodamage)
    }
}
else
{
    while (
g_damagedealt[attacker] > get_pcvar_num(cvar_ADMammodamage)) //cvar_ammodamage = 500
    
{

        
g_ammopacks[attacker]++
        
g_damagedealt[attacker] -= get_pcvar_num(cvar_ammodamage)
    }


Last edited by MaT'; 07-06-2010 at 13:56.
MaT' is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 07-06-2010 , 14:29   Re: [ZP] Help with ammo packs reward
Reply With Quote #4

Quote:
Originally Posted by MaT' View Post
This is i want, but i don't know that it's ok

PHP Code:
if (get_user_flags(attacker) & ADMIN_LEVEL_B)
{
    while (
g_damagedealt[attacker] > get_pcvar_num(cvar_ADMammodamage)) //cvar_ADMammodamage = 250
    
{
        
g_ammopacks[attacker]++
        
g_damagedealt[attacker] -= get_pcvar_num(cvar_ADMammodamage)
    }
}
else
{
    while (
g_damagedealt[attacker] > get_pcvar_num(cvar_ADMammodamage)) //cvar_ammodamage = 500
    
{

        
g_ammopacks[attacker]++
        
g_damagedealt[attacker] -= get_pcvar_num(cvar_ammodamage)
    }

That adds 1 pack regardless if it's an admin or not. Try to rephrase exactly what you want and i'll make it for you
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
MaT'
Junior Member
Join Date: Apr 2010
Old 07-06-2010 , 15:12   Re: [ZP] Help with ammo packs reward
Reply With Quote #5

it's simple, i need that the admins get ammo packs more easily than players, but add 1 for 1 (20 - 21 - 22 ), no like the code that i put at the bigining where add 2 (20 - 22 - 24)
MaT' is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 07-06-2010 , 15:17   Re: [ZP] Help with ammo packs reward
Reply With Quote #6

Quote:
Originally Posted by MaT' View Post
it's simple, i need that the admins get ammo packs more easily than players, but add 1 for 1 (20 - 21 - 22 ), no like the code that i put at the bigining where add 2 (20 - 22 - 24)
And how do players get ammo packs then?
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
MaT'
Junior Member
Join Date: Apr 2010
Old 07-06-2010 , 15:25   Re: [ZP] Help with ammo packs reward
Reply With Quote #7

when the players will draw 500 zombie HP, give 1 ammo pack
when the admins will draw 250 zombie HP, give 1 ammo pack

Last edited by MaT'; 07-06-2010 at 15:32.
MaT' is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 07-06-2010 , 15:36   Re: [ZP] Help with ammo packs reward
Reply With Quote #8

and cvar_ADMammodamage == 250?
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
AfteR.
Veteran Member
Join Date: Dec 2008
Location: λ
Old 07-06-2010 , 15:55   Re: [ZP] Help with ammo packs reward
Reply With Quote #9

...

PHP Code:
while (g_damagedealt[attacker] > get_pcvar_num(cvar_ammodamage))
{
        new 
amount get_pcvar_num(cvar_packs_reward)

        
g_ammopacks[attacker] += amount * (is_user_admin(attacker) ? 1)
        
g_damagedealt[attacker] -= get_pcvar_num(cvar_ammodamage)

Damagedealt is the same for all, but admins will get 2 AP.
AfteR. is offline
MaT'
Junior Member
Join Date: Apr 2010
Old 07-06-2010 , 19:24   Re: [ZP] Help with ammo packs reward
Reply With Quote #10

Quote:
Originally Posted by AfteR. View Post
...

PHP Code:
while (g_damagedealt[attacker] > get_pcvar_num(cvar_ammodamage))
{
        new 
amount get_pcvar_num(cvar_packs_reward)

        
g_ammopacks[attacker] += amount * (is_user_admin(attacker) ? 1)
        
g_damagedealt[attacker] -= get_pcvar_num(cvar_ammodamage)

Damagedealt is the same for all, but admins will get 2 AP.

In this case the admin gets 2 ammo pack, i need that the admin gets 1 but more easily that a player.

Normal Plugin:
THE PLAYER MUST HIT TO ZOMBIE WITH 500 HP TO GET A AP

I Want:
THE PLAYER MUST HIT TO ZOMBIE WITH 500 HP TO GET A AP AND THE ADMIN MUST HIT TO ZOMBIE WITH 250 HP TO GET A AP

-------------------------

I try with:

PHP Code:
if (get_user_flags(attacker) & ADMIN_LEVEL_B)
{
    while (
g_damagedealt[attacker] > 250)
    {
        
g_ammopacks[attacker]++
        
g_damagedealt[attacker] -= 250
    
}
}
else
{
    while (
g_damagedealt[attacker] > 500)
    {

        
g_ammopacks[attacker]++
        
g_damagedealt[attacker] -= 500
    
}

but nothing gets an ap, i don't know why :S

Last edited by MaT'; 07-06-2010 at 19:27.
MaT' 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 07:12.


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