Raised This Month: $ Target: $400
 0% 

[CSSTATS] Rank calculation.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ex3cuTioN
Member
Join Date: May 2010
Old 02-20-2013 , 07:12   [CSSTATS] Rank calculation.
Reply With Quote #1

PHP Code:
public get_score(stats[11], body[8]) {
    new 
Float:fstats[11];
    
    for (new 
011i++)
        
fstats[i] = float(stats[i]);
    
    return     ((
fstats[0] - fstats[1]) + fstats[2]) / 2//line 78

Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team

Warning: Tag mismatch on line 78
Header size: 156 bytes
Code size: 500 bytes
Data size: 0 bytes
Stack/heap size: 16384 bytes; estimated max. usage=41 cells (164 bytes)
Total requirements: 17040 bytes

1 Warning.
Done.

Why that warning? And it's not working...anyway. (and yes i've put the file in data, the .amxx one)

Last edited by Ex3cuTioN; 02-20-2013 at 07:13.
Ex3cuTioN is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 02-20-2013 , 07:17   Re: [CSSTATS] Rank calculation.
Reply With Quote #2

You are returning a Float and the compiler is not expecting a Float
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Ex3cuTioN
Member
Join Date: May 2010
Old 02-20-2013 , 07:19   Re: [CSSTATS] Rank calculation.
Reply With Quote #3

well....the original code was stats[0] - stats[1] , obviously int - int equals int, but (int-int)/2 it can equal a real number...

How can i use that formula?
Ex3cuTioN is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 02-20-2013 , 08:17   Re: [CSSTATS] Rank calculation.
Reply With Quote #4

floatround() the return value.
__________________
hleV is offline
Ex3cuTioN
Member
Join Date: May 2010
Old 02-20-2013 , 11:08   Re: [CSSTATS] Rank calculation.
Reply With Quote #5

Thanks a lot . IT WORKS.
Ex3cuTioN 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 21:36.


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