AlliedModders

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

Striker 08-30-2004 08:55

Auto RoundRestart
 
Could someone convert this amxmod script to amxmod x ?
My knowlege in scripting is very poor...

Description:

Automatic Restart with defined time after map-restart. To prevent fast-connecters to get money after 1st won-round. So everybody can play pistol-round after level-change!

Code:
#include <amxmod> new onoff[8] new bool:AutoRR = true        /* Plugin is enabled default - Set to false to disable */ new bool:AutoHud = true        /* Plugin uses Hud-Messages  - Set to false to use client_say */ new username[32] new logfilename[256] public amx_auto_rr(id){      if (!(get_user_flags(id)&ADMIN_SLAY)){         client_print(id,print_console,"[AMX] You have no access to that command!")         return PLUGIN_HANDLED      }      if (read_argc() < 2){       checkmode()       client_print(id,print_console,"[AMX] Usage: amx_auto_rr < 0 | 1 >  | Currently: * %s *", onoff)         return PLUGIN_HANDLED      }      read_argv(1,onoff,2)      if (equal(onoff,"1", 1)){       AutoRR = true         client_print(id,print_console,"[AMX] Auto-Restart is now enabled!")       if (AutoHud == true){     hudstyle()       }       else {     clientstyle()       }       log_to_file(logfilename,"amx_auto_rr: ^"%s^" enabled Auto-Restart.",get_user_name(id,username,31))    }    else {         AutoRR = false       client_print(id,print_console,"[AMX] Auto-Restart is now disabled")         if (AutoHud == true){     hudstyle()       }       else {     clientstyle()       }       log_to_file(logfilename,"amx_auto_rr: ^"%s^" disabled Auto-Restart.",get_user_name(id,username,31))    }      return PLUGIN_HANDLED   }   public checkmode() {   if(AutoRR == true){       copy(onoff, 8, "enabled")     }   else {       copy(onoff, 8, "disabled")     }     return PLUGIN_CONTINUE } public hudstyle() {   new message[128]   checkmode()   format(message,127,"[AMX]: Admin has %s Auto-Restart!",onoff)   set_hudmessage(0, 100, 200, 0.05, 0.65, 2, 0.02, 6.0, 0.01, 0.1, 2)       show_hudmessage(0,message)   return PLUGIN_CONTINUE } public clientstyle() {   new message[128]   checkmode()   format(message,127,"[AMX]: Admin %s Auto-Restart",onoff)   client_print(0,print_chat,message) } public restart_time()      set_task (get_cvar_float("amx_auto_rr_time"),"restart_map",0)   public restart_map() {        if (AutoRR==true){         set_hudmessage(0, 100, 200, 0.05, 0.65, 2, 0.02, 6.0, 0.01, 0.1, 2)           show_hudmessage(0,"[AMX] Automatic Round-Restart!")           set_cvar_float("sv_restart",2.0)      }      else {         client_print(0,print_chat,"[AMX] Autorestart plugin is disabled. No restart will be done!")          }   }   public plugin_init() {      register_plugin("Auto-Restart","0.9.2","ToT | V!PER")      register_event("TextMsg","restart_time","a","2&#Game_C")      register_cvar("amx_auto_rr_time","25.0")    register_clcmd("amx_auto_rr","amx_auto_rr",ADMIN_SLAY,"amx_auto_rr :  < 0 | 1>   Turns ability to Auto-Restart (Game Commencing) on and off")      get_time("addons/amx/logs/admin%m%d.log",logfilename,255)    return PLUGIN_CONTINUE     }

ToT | V!PER 01-07-2005 06:07

http://forums.alliedmods.net/showthr...?p=80503#83927

Even it is real old thread, check this out if you still need it ;-)


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

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