Raised This Month: $ Target: $400
 0% 

randomizing


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
iCap
BANNED
Join Date: Oct 2007
Old 10-09-2007 , 06:49   Re: randomizing
Reply With Quote #1

This is what i'm doing and i think it's the best way I could do it. I'm half-way finished with the other stuff in the code but this is this random part; is it correct? i just started coding so please take it easy if somethings wrong

PHP Code:
public give_award(id)
{
    if (!
get_pcvar_num(killawards))
    return 
PLUGIN_HANDLED
    
    
new attacker read_data(1)
    new 
random random_num(113)
    
    switch(
random)
    {
        case 
1:
        {
            
client_print(attackerprint_chat"*Recieved Health Award")
            
health_award(id)
        }
        case 
2:
        {
            
client_print(attackerprint_chat"*Recieved Armor Award")
            
armor_award(id)
        }
        case 
3:
        {
            
client_print(attackerprint_chat"*Recieved Ammo Award")
            
ammo_award(id)
        }
        case 
4:
        {
            
client_print(attackerprint_chat"*Recieved Speed Award")
            
speed_award(id)
        }
        case 
5:
        {
            
client_print(attackerprint_chat"*Recieved Gravity Award")
            
gravity_award(id)
        }
        case 
6:
        {
            
client_print(attackerprint_chat"*Recieved Assualt Award")
            
assault_award(id)
        }
        case 
7:
        {
            
client_print(attackerprint_chat"*Recieved Money Award")
            
money_award(id)
        }
        case 
8:
        {
            
client_print(attackerprint_chat"*Recieved Noclip Award")
            
noclip_award(id)
        }
        case 
9:
        {
            
client_print(attackerprint_chat"*Recieved Random Award")
            
random_award(id)
        }
        case 
10:
        {
            
client_print(attackerprint_chat"*Recieved Blank Award")
            
blank_award(id)
        }
        case 
11:
        {
            
client_print(attackerprint_chat"*Recieved Suit Award")
            
suit_award(id)
        }
        case 
12:
        {
            
client_print(attackerprint_chat"*Recieved HP+AP Award")
            
hpap_award(id)
        }
    }
    return 
PLUGIN_HANDLED

iCap 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 16:02.


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