View Single Post
kileedyg
BANNED
Join Date: Dec 2008
Location: Lithuania
Old 05-07-2012 , 01:16   Re: Very simple,constructive request
Reply With Quote #2

UP,also

PHP Code:
chance(plrmaxcountpercentsClass[], CSW_type=0sName[]="") {
    if( !
maxcount || !percent ) {
    return 
0;
    }
    new 
count;
    for( new 
0maxcounti++ ) {
    if( 
random_num(1100) <= percent )
    {
    if( 
count == )
    {
    
fm_give_item(plrsClass);
    }
    
count++;
    }
    }
    if( 
count && CSW_type )
    {
    if( 
percent 100 )
    {
    
client_print(plr,print_chat"You received %i %s%s! (%i%% chance)"countsName, (count == 1) ? g_sBlank g_sSpercent);
    }
    
cs_set_user_bpammo(plrCSW_typecount);
    }
 
 return 
1;
}
chance(plrget_pcvar_num(hns_grenades[team]), get_pcvar_num(hns_grenades_percent[team]),"weapon_hegrenade"CSW_HEGRENADE"HE Grenade");
chance(plrget_pcvar_num(hns_flashbangs[team]), get_pcvar_num(hns_flashbangs_percent[team]), "weapon_flashbang"CSW_FLASHBANG"Flashbang");
chance(plrget_pcvar_num(hns_smokegren[team]), get_pcvar_num(hns_smokegren_percent[team]), "weapon_smokegrenade"CSW_SMOKEGRENADE"Smoke Grenade"); 
kileedyg is offline
Send a message via Skype™ to kileedyg