Raised This Month: $ Target: $400
 0% 

By time


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
LostSkill
Senior Member
Join Date: Jun 2008
Location: Monuhuelo Island
Old 08-28-2008 , 15:28   By time
Reply With Quote #1

Hello all how i can do somethink like this if 23:00 run map de_dust2 if 00:00 run de_inferno??
__________________
MY ENGLISH IS BAD.....

Last edited by LostSkill; 08-28-2008 at 15:33.
LostSkill is offline
Send a message via MSN to LostSkill
Silencer123
Veteran Member
Join Date: Jul 2006
Old 08-28-2008 , 16:14   Re: By time
Reply With Quote #2

The command you are looking for is get_time.
Check the time every 50 seconds or so using set_task.
__________________
EAT YOUR VEGGIES
Silencer123 is offline
LostSkill
Senior Member
Join Date: Jun 2008
Location: Monuhuelo Island
Old 08-28-2008 , 16:36   Re: By time
Reply With Quote #3

I need more info about this so it must look somethink like this
PHP Code:
public task(id) {
set_task(60.0 "mapc",id,_,_,"a")
}
public 
mapc() {
 new 
CurrentTime[9
 
get_time("%H:%M:%S",CurrentTime,8) {
  if(
time 12hour,00minute,00second){
   
changelevel de_dust2
  
}
  else if(
time 13hours:00minute:00second){
   
changelevel de_inferno
  
}
 }

__________________
MY ENGLISH IS BAD.....
LostSkill is offline
Send a message via MSN to LostSkill
LostSkill
Senior Member
Join Date: Jun 2008
Location: Monuhuelo Island
Old 09-07-2008 , 15:29   Re: By time
Reply With Quote #4

Somebody? ;/
__________________
MY ENGLISH IS BAD.....
LostSkill is offline
Send a message via MSN to LostSkill
Iwon
BANNED
Join Date: Jul 2008
Old 09-07-2008 , 18:36   Re: By time
Reply With Quote #5

PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Changemap on time"
#define VERSION "1.0"
#define AUTHOR "LostSkill/Iwon"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
set_task(0.5"task"0""0"b"
}

public 
task(id) {
    
set_task(60.0 "mapc",id,_,_,"a")
}
public 
mapc() {
    new 
CurrentTime[9]
    
get_time("%H:%M:%S",CurrentTime,8)
    
    if(
time 12:00:00) {
        
server_cmd("amx_map de_dust2")
    }
    
    else if(
time 13:00:00) {
        
server_cmd("amx_map de_inferno")
    }

Fixed

Last edited by Iwon; 09-07-2008 at 18:46.
Iwon is offline
EvolDay
Senior Member
Join Date: Apr 2008
Location: Canada
Old 09-07-2008 , 18:54   Re: By time
Reply With Quote #6

would this work if the set_task checks at like (time 12:00:10)
__________________
EvolDay is offline
LostSkill
Senior Member
Join Date: Jun 2008
Location: Monuhuelo Island
Old 09-08-2008 , 02:03   Re: By time
Reply With Quote #7

Quote:
Originally Posted by Iwon View Post
PHP Code:
#include <amxmodx>
#include <amxmisc>
 
#define PLUGIN "Changemap on time"
#define VERSION "1.0"
#define AUTHOR "LostSkill/Iwon"
 
 
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
 
    
set_task(0.5"task"0""0"b"
}
 
public 
task(id) {
    
set_task(60.0 "mapc",id,_,_,"a")
}
public 
mapc() {
    new 
CurrentTime[9]
    
get_time("%H:%M:%S",CurrentTime,8)
 
    if(
time 12:00:00) {
        
server_cmd("amx_map de_dust2")
    }
 
    else if(
time 13:00:00) {
        
server_cmd("amx_map de_inferno")
    }

Fixed
I get error on 22 line
PHP Code:
if(time 12:00:00
and i dunno how to fix it
__________________
MY ENGLISH IS BAD.....
LostSkill is offline
Send a message via MSN to LostSkill
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 09-08-2008 , 02:32   Re: By time
Reply With Quote #8

What the fuck ?

Code:
#include <amxmodx>   #define PLUGIN "New Plugin" #define VERSION "1.0" #define AUTHOR "Alka" public plugin_init() {    register_plugin(PLUGIN, VERSION, AUTHOR);    set_task(1.0, "taskCheckTime", 0, "", 0, "b", 0); }   public taskCheckTime() {  static szTime[10];  get_time("%H:%M:%S", szTime, sizeof szTime - 1);    static szTemp[3][2];  str_piece(szTime, szTemp, sizeof szTemp, sizeof szTemp[] - 1, ':');    if((str_to_num(szTemp[0]) == 12) && !str_to_num(szTemp[1]) && !str_to_num(szTemp[2]))  {   //The time is 12:0:0  }  else if((str_to_num(szTemp[0]) == 13) && !str_to_num(szTemp[1]) && !str_to_num(szTemp[2]))  {   //The time is 13:0:0  } }   stock str_piece(const input[], output[][], outputsize, piecelen, token = '|') {  new i = -1, pieces, len = -1 ;    while ( input[++i] != 0 )  {   if ( input[i] != token )   {    if ( ++len < piecelen )     output[pieces][len] = input[i] ;   }   else   {    output[pieces++][++len] = 0 ;    len = -1 ;        if ( pieces == outputsize )     return pieces ;   }  }  return pieces + 1; }
Alka is offline
LostSkill
Senior Member
Join Date: Jun 2008
Location: Monuhuelo Island
Old 09-09-2008 , 11:04   Re: By time
Reply With Quote #9

It not works Alka maybe becouse i did more then 2 maps i mean and 14:00 i add'ed ofc i change "szTemp [0] == 13 to 14)" but no luck and i add'ed 140 so i did 14.5 and no luck whats wrong?
__________________
MY ENGLISH IS BAD.....
LostSkill is offline
Send a message via MSN to LostSkill
Old 09-09-2008, 11:46
xPaw
This message has been deleted by xPaw. Reason: lol code
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 09-09-2008 , 15:58   Re: By time
Reply With Quote #10

Replace
Code:
static szTemp[3][2];
->
Code:
static szTemp[3][6];
Then will work, i just tested it.
Alka is offline
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 14:24.


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