Raised This Month: $51 Target: $400
 12% 

Help with floats?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
ILUSION
Senior Member
Join Date: Oct 2006
Location: Argentina
Old 01-01-2010 , 14:03   Help with floats?
Reply With Quote #1

Hi I need a little help with my code... I want transfer a player to terrorist team when there're 1 ct each 4 tts.

I try make this with averages but I fail because I can't set correctly the float.

PHP Code:
public eTeamInfo()
{
    if (!
get_pcvar_num(pcvar[0]))
        return 
0
        
    
new id read_data(1)
    
    new 
countTcountCT
        
    
for (new 0get_maxplayers(); i++)
    {
        if (
get_user_team(i) == 1)
            
countT++
        
        if (
get_user_team(i) == 2)
            
countCT++
    }
    
    new 
Float:average = (countT countCT) / 4
    
    
if (average 1.5)
        
cs_set_user_team(idCS_TEAM_T)
    
    return 
0

Thanks, and happy new year

Last edited by ILUSION; 01-01-2010 at 14:19.
ILUSION 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 07:34.


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