AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [CSSTATS] Rank calculation. (https://forums.alliedmods.net/showthread.php?t=209028)

Ex3cuTioN 02-20-2013 07:12

[CSSTATS] Rank calculation.
 
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)

YamiKaitou 02-20-2013 07:17

Re: [CSSTATS] Rank calculation.
 
You are returning a Float and the compiler is not expecting a Float

Ex3cuTioN 02-20-2013 07:19

Re: [CSSTATS] Rank calculation.
 
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?

hleV 02-20-2013 08:17

Re: [CSSTATS] Rank calculation.
 
floatround() the return value.

Ex3cuTioN 02-20-2013 11:08

Re: [CSSTATS] Rank calculation.
 
Thanks a lot :D:D . IT WORKS.


All times are GMT -4. The time now is 21:36.

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