AlliedModders

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

Sutar 08-04-2013 07:26

error
 
Code:

// D:\...\cstrike\addons\amxmodx\scripting\plfunction.sma(89) : warning 213: tag mismatch
Code:

line 88: new hours = g_time/3600;
line 89: g_time = g_time - (floatround(hours, floatround_round)*3600);

what went wrong?
I want to know how the server is already in the network
this function, I get the number of hours

g_time = time start server (in seconds)

YamiKaitou 08-04-2013 07:27

Re: error
 
hours is not a Float, so there is nothing to round

Sutar 08-04-2013 07:40

Re: error
 
Quote:

Originally Posted by YamiKaitou (Post 2005351)
hours is not a Float, so there is nothing to round

You probably do not understand,
if the number (for example 39471)
to find out how many days 39471/3600 - the number of seconds in 1 day,
and turns 10.964166666666666666666666666667
here and you want to round up to 10
then we 39471 - (10 * 3600)
that's how me round a number 10.964166666666666666666666666667

YamiKaitou 08-04-2013 07:44

Re: error
 
There is a difference between Integer and Float division. If all numbers are Integers, then the return value is an Integer. If you want a Float, at least one of the numbers must be a Float

Sutar 08-04-2013 07:48

Re: error
 
I mean if you just 39471/3600 then I will once 10? or 11?
as it rounds?

YamiKaitou 08-04-2013 07:49

Re: error
 
39471 / 3600 = 10

Sutar 08-04-2013 08:03

Re: error
 
Quote:

Originally Posted by YamiKaitou (Post 2005360)
39471 / 3600 = 10

Thank you, now everything is working very well.


All times are GMT -4. The time now is 15:54.

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