AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   My Own Plugin from amx ;x (https://forums.alliedmods.net/showthread.php?t=26008)

graczu 03-25-2006 11:59

My Own Plugin from amx ;x
 
hi i have a question:

Code:

#include <amxmod>

public time_status()
{
  new thetime[16]
  get_time("%H:%M",thetime,15)
  new rs_hour[16]
  get_cvar_string("amx_restart_hour", rs_hour, 15)
  if(equal(thetime,rs_hour))
  {
    client_print(0, print_chat, "[AMX] Automatyczne przeladowanie serwera")
    client_print(0, print_chat, "%i Sekund do restartu", get_cvar_num("amx_restart_rtime"))
    client_print(0, print_chat, "%i Sekund do restartu", get_cvar_num("amx_restart_rtime"))
    client_print(0, print_chat, "%i Sekund do restartu", get_cvar_num("amx_restart_rtime"))
    remove_task(112233)
    set_task(get_cvar_float("amx_restart_rtime"),"hlds_quit",0)
  }
}

public hlds_quit()
{
  client_print(0, print_chat, "[AMX] RESTART!")
  client_print(0, print_chat, "[AMX] RESTART!!")
  client_print(0, print_chat, "[AMX] RESTART!!!")
  server_cmd("quit")
}

public plugin_init()
{
  register_plugin("Server Restart","1.0","graczu_-")
  register_cvar("amx_restart_rtime","15")
  register_cvar("amx_restart_hour","11:00")
  set_task(60.0, "time_status", 112233, "", 0, "b")
}

this my plugin, its do a restart server at 11:00, but on amxx its not work sma is compile without error's....

what is wrong here ?

FatalisDK 03-25-2006 13:58

for starters..
Code:
#include <amxmodx>

v3x 03-25-2006 15:26

The code looks fine from what I can see. Are you sure it's even running ( do "amxx list" in the server console )?

SweatyBanana 03-25-2006 15:56

2 Attachment(s)
v3x...he has the wrong include...


i shall compile it for him.

graczu 03-25-2006 19:57

omg what the difference with amxmod and amxmox including amxmod.inc have including: #include <amxmodx>

...

i recompile it and i will check it, but i dont see any difference............

at 11:00 i will post anserv :)

v3x 03-25-2006 20:03

You can always change to an earlier time.

graczu 03-26-2006 08:05

i changed to #include <amxmodx> and ont working :x why i will cry :)

FatalisDK 03-26-2006 12:34

The amxx file SweatyBanana posted should work.

[ --<-@ ] Black Rose 03-26-2006 14:50

since
Code:
register_cvar("amx_restart_rtime","15")


Code:
get_cvar_float("amx_restart_rtime")
-->
Code:
get_cvar_num("amx_restart_rtime")

don't think it would make any difference though.

graczu 03-26-2006 21:36

rotfl i cant add get_cvar_num i will have misc tag think helpppppper.... i need there float :o


All times are GMT -4. The time now is 16:44.

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