Raised This Month: $ Target: $400
 0% 

Bonuses when kill enemy


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mentors
Member
Join Date: Dec 2009
Old 01-07-2014 , 09:14   Bonuses when kill enemy
Reply With Quote #1

Hello guys, i need help.

I want to create a plug-in, which gives a bonus when you have killed the enemy. But to give a bonus to work random

Example:

I am killing the enemy and give me +5 hp, the next time I give around +15ap, but the next, not give anything.

Sorry for writing and grammar mistake.
Mentors is offline
BlueGaming
BANNED
Join Date: Nov 2013
Old 01-07-2014 , 10:46   Re: Bonuses when kill enemy
Reply With Quote #2

try this (untested) but should work

PHP Code:
#include <amxmodx>
#include <fun>
#include <cstrike>

public plugin_init()
{
    
register_plugin("Random Bonus","1.0","BG");
    
register_event("DeathMsg""HkDie""a");
}

public 
HkDie()
{
    new 
vct read_data);
    new 
atk read_data);

    if(!
atk || atk == vct || !is_user_alive(atk))
        return 
PLUGIN_HANDLED

    
new dede;
    
dede random(5);

    switch(
dede)
    {
        case 
1:
        {
            
set_user_health(atkget_user_health(atk) + 100);
            return 
PLUGIN_HANDLED
        
}

        case 
2:
        {
            
set_user_health(atkget_user_health(atk) + 30);
            return 
PLUGIN_HANDLED
        
}

        case 
3:
        {
            
set_user_health(atkget_user_health(atk) + 5);
            return 
PLUGIN_HANDLED
        
}

        case 
4:
        {
            
set_user_health(atkget_user_health(atk) + 15);
            return 
PLUGIN_HANDLED
        
}

        case 
5:
        {
            
set_user_health(atkget_user_health(atk) + 70);
            return 
PLUGIN_HANDLED
        
}
       
        default: return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_CONTINUE


Last edited by BlueGaming; 01-08-2014 at 06:24.
BlueGaming is offline
ANTICHRISTUS
kingdom of weird stuff
Join Date: Jun 2010
Location: My kingdom is not in thi
Old 01-07-2014 , 11:29   Re: Bonuses when kill enemy
Reply With Quote #3

nice to search an existing plugin in the unapproved section, title: Vampire.
__________________
ANTICHRISTUS is offline
BlueGaming
BANNED
Join Date: Nov 2013
Old 01-07-2014 , 11:37   Re: Bonuses when kill enemy
Reply With Quote #4

Quote:
Originally Posted by ANTICHRISTUS View Post
nice to search an existing plugin in the unapproved section, title: Vampire.

i have no idea about what the hell you talking i made this plugin in five minutes imediatly , before make an acuzation please post some proves !
BlueGaming is offline
xxxperts
Senior Member
Join Date: Oct 2013
Location: India
Old 01-07-2014 , 11:59   Re: Bonuses when kill enemy
Reply With Quote #5

wht is mean by "dede" are u indian bluegaming becoz i m indian and in india "dede" means give give..
__________________
All my work is here

Last edited by xxxperts; 01-07-2014 at 11:59.
xxxperts is offline
ANTICHRISTUS
kingdom of weird stuff
Join Date: Jun 2010
Location: My kingdom is not in thi
Old 01-07-2014 , 12:42   Re: Bonuses when kill enemy
Reply With Quote #6

Quote:
Originally Posted by BlueGaming View Post
.. before make an acuzation please post some proves !
what ?! OMG .. LOL.
I just posted a thread's title for the OP or anyone reading this request, it was not a reply for your code .
__________________
ANTICHRISTUS is offline
Erdener
Senior Member
Join Date: Apr 2010
Location: Turkey
Old 01-07-2014 , 12:57   Re: Bonuses when kill enemy
Reply With Quote #7

LOL.

i'm from Turkey and in Turkey say "dede" => grandfather ^^!
__________________
Erdener is offline
xxxperts
Senior Member
Join Date: Oct 2013
Location: India
Old 01-07-2014 , 23:09   Re: Bonuses when kill enemy
Reply With Quote #8

Good Erdener "Grandfather"
__________________
All my work is here
xxxperts is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 01-08-2014 , 05:47   Re: Bonuses when kill enemy
Reply With Quote #9

Quote:
Originally Posted by BlueGaming View Post
try this (untested) but should work
I think he wants a plugin which gives the Killer Random Amount of Health, and not Random Prizes.
__________________
Kia is offline
BlueGaming
BANNED
Join Date: Nov 2013
Old 01-08-2014 , 06:22   Re: Bonuses when kill enemy
Reply With Quote #10

Quote:
Originally Posted by ANTICHRISTUS View Post
what ?! OMG .. LOL.
I just posted a thread's title for the OP or anyone reading this request, it was not a reply for your code .
lol , then sorry )),



@kia's : will be fixed!


@ertner: No , im POLISH

and dede is a random variabile

Last edited by BlueGaming; 01-08-2014 at 06:25.
BlueGaming 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 05:12.


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