Raised This Month: $ Target: $400
 0% 

floatround() working?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
cheshire-
Junior Member
Join Date: Jul 2005
Old 05-20-2006 , 07:19   floatround() working?
Reply With Quote #1

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?
__________________
cheshire- is offline
Basic-Master
Veteran Member
Join Date: Apr 2005
Location: hello pm
Old 05-20-2006 , 07:33  
Reply With Quote #2

an int.
Basic-Master is offline
Send a message via ICQ to Basic-Master Send a message via MSN to Basic-Master
cheshire-
Junior Member
Join Date: Jul 2005
Old 05-20-2006 , 07:38  
Reply With Quote #3

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

EDIT: No.
__________________
cheshire- is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 05-20-2006 , 08:13  
Reply With Quote #4

floatround converts a float -> int.

I think the native you really want is float()
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
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 16:19.


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