Raised This Month: $ Target: $400
 0% 

change variable depending of time hours minutes


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
simple_user
Member
Join Date: Apr 2012
Location: Latvia, the cube
Old 05-05-2012 , 22:16   change variable depending of time hours minutes
Reply With Quote #1

I've searched this forum. Found something similar, but it doesn't make me smarter in this case. Please don't post a valid code, just tell me more than compiler does.
I commented lines, where the errors are.
Thanks.


PHP Code:
public SetConfig()
{
    new 
config[64];
    
get_configsdir(configsizeof(config) - 1);
    
add(configsizeof(config) - 1"/day.cfg");
    
    if( 
file_exists(config) )
    {
        
server_cmd("exec %s"config);
    }
}

public 
itstime()
{

    new 
hour[24]
    
get_time("%H"hour23)

    if ( 
hour >= 22 || hour <= 6   /*** array must be indexed <variable "hour"> ***/
    
|| task_exists ("SetConfig"0) )
    {
        
remove_task("SetConfig" 0)  /*** argument type mismatch ***/
    
}
    
    else 
    {
        
    if ( 
hour && hour 22 )   /*** array must be indexed <variable "hour"> ***/
    
    
{
        
set_task (1.0"SetConfig")
    }
    return 
PLUGIN_HANDLED


Last edited by simple_user; 05-07-2012 at 23:11.
simple_user is offline
Send a message via Skype™ to simple_user
 



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 00:25.


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