Raised This Month: $ Target: $400
 0% 

Percentage Chance


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 05-22-2010 , 19:44   Re: Percentage Chance
Reply With Quote #3

PHP Code:
#include <amxmodx>
 
#define chance(%1) ( %1 > random(100) ) // %1 = probability
 
new g_Textg_Chance;
 
public 
plugin_init()
{
        
register_plugin("End Round Message""1.1""hleV");
 
        
g_Text register_cvar("erm_text""Default Text");
        
g_Chance register_cvar("erm_chance""35");
 
        
register_logevent("RoundEnd"2"1=Round_End");
}
 
public 
RoundEnd()
{
        if (
chance(get_pcvar_num(g_Chance)))
                return;
 
        new 
Text[128];
        
get_pcvar_string(g_TextText127);
 
        
client_print(0print_chatText);

__________________

Last edited by hleV; 05-23-2010 at 17:30.
hleV is offline
 



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:23.


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