AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   floatround() working? (https://forums.alliedmods.net/showthread.php?t=28673)

cheshire- 05-20-2006 07:19

floatround() working?
 
Code:
#include <amxmodx> #include <engine> public plugin_init() {     register_plugin("Uptime","1.0","cheshire-")     register_clcmd("say uptime","do_uptime") } public do_uptime(id) {     new Float:uptime = floatround(halflife_time())     client_print(id,print_chat,"- This server has been up for about %f seconds.",uptime) }
Warning 213: Tag mismatch on line 12.

But this compiles without error...
Code:
new Float:uptime = halflife_time()     client_print(id,print_chat,"- This server has been up for about %f seconds.",uptime)

So if the upper example is not a float, then what is it?

Basic-Master 05-20-2006 07:33

an int.

cheshire- 05-20-2006 07:38

so would I still need to declare uptime as a float?

EDIT: No.

Hawk552 05-20-2006 08:13

floatround converts a float -> int.

I think the native you really want is float()


All times are GMT -4. The time now is 16:19.

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