AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Array must be indexed (https://forums.alliedmods.net/showthread.php?t=130134)

SpeeDeeR 06-20-2010 15:48

Array must be indexed
 
PHP Code:

public check()
{
    new 
itime[3]
    
get_time("%H",itime,2)
    if(
itime == 24)
    {
        
server_cmd("restart")
    }
    else
    {
        
set_task(0.1,"check")
    }


Code:

Error: Array must be indexed (variable "itime")
What does this mean and how can it be solved.

YamiKaitou 06-20-2010 15:49

Re: Array must be indexed
 
equal(itime, "24")

fysiks 06-20-2010 15:59

Re: Array must be indexed
 
get_time() will return an hour of 24? Shouldn't it be 0?

SpeeDeeR 06-22-2010 17:43

Re: Array must be indexed
 
Quote:

Originally Posted by fysiks (Post 1214665)
get_time() will return an hour of 24? Shouldn't it be 0?

Possitive.

xPaw 06-23-2010 05:50

Re: Array must be indexed
 
That script will keep restarting server till next hour :mrgreen:

SpeeDeeR 06-23-2010 07:19

Re: Array must be indexed
 
Yes, I actually though about this.So I set it for 00:00:00 :)


All times are GMT -4. The time now is 14:58.

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