Raised This Month: $ Target: $400
 0% 

Random Function


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
sibox
Member
Join Date: Apr 2009
Location: Bulgaria
Old 11-21-2010 , 13:58   Re: Random Function
Reply With Quote #3

Again not working. My all code is
Code:
new players;
new randompl;



public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_logevent("StartRound",2,"1=Round_Start") 
    randompl = random_num(1,players)
    players = get_playersnum();
}

public StartRound()
{
    if(players >= 1) {
        new cName[32]
        get_user_name(randompl, cName, 31)
        set_hudmessage(255, 0, 0, -1.0, 0.01)
        show_hudmessage(0, "%s is the Choosen One!", cName)
        set_task(5.0, "RandomFunc")
    }
}



Deagle( const id )
{
    new deagle = give_item(id, "weapon_deagle");
    cs_set_weapon_ammo(deagle, 1)
    client_print(id, print_chat, "You Recieve Deagle")
}

AWP( const id )
{
    new awp = give_item(id, "weapon_awp");
    cs_set_weapon_ammo(awp, 1)
    client_print(id, print_chat, "You Recieve AWP")
}

Health( const id )
{
    set_user_health(id, 150)
    client_print(id, print_chat, "You Recieve Health")
    
}

public RandomFunc( )
{
    switch( random_num( 1, 3 ) )
    {
        case 1:
        {
            Deagle( randompl );
        }
        case 2:
        {
            AWP( randompl );
        }
        case 3:
        {
            Health( randompl );
        }
    }
}
Where is my mistake
sibox is offline
Send a message via Skype™ to sibox
 



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 11:19.


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