Raised This Month: $51 Target: $400
 12% 

help with autorestart code


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
visar1
Member
Join Date: Nov 2009
Old 06-20-2010 , 12:48   help with autorestart code
Reply With Quote #1

I have this autorestart

Quote:
#include <amxmodx>

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]

public amx_auto_rr(id){
if (!(get_user_flags(id)&ADMIN_CFG)){
client_print(id,print_console,"[AMXX] You dont have acess!")
return PLUGIN_HANDLED
}
if (read_argc() < 2){
checkmode()
client_print(id,print_console,"[AMXX] 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,"[AMXX] Auto-Restart is now enabled!")
if (AutoHud == true){
hudstyle()
}
else {
clientstyle()
}
log_amx("amx_auto_rr: ^"%s^" enabled Auto-Restart.",get_user_name(id,username,31))
}
else {
AutoRR = false
client_print(id,print_console,"[AMXX] Auto-Restart is now disabled")
if (AutoHud == true){
hudstyle()
}
else {
clientstyle()
}
log_amx("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,"[AMXX]: Admin has %s Auto-Restart!",onoff)
set_hudmessage(0, 100, 200, 0.05, 0.65, 2, 0.02, 6.0, 0.01, 0.1, 3)
show_hudmessage(0,message)
return PLUGIN_CONTINUE
}

public clientstyle() {
new message[128]
checkmode()
format(message,127,"[AMXX]: Admin %s Auto-Restart",onoff)
client_print(0,print_chat,message)
return PLUGIN_CONTINUE
}

public restart_time(){
if (get_cvar_num("amx_auto_rr_time")==0){
AutoRR=false
checkmode()
// return PLUGIN_HANDLED
}
if (AutoRR==true){
client_print(0,print_chat,"[AMXX] Game Has Been Restart %d sec.",get_cvar_num("amx_auto_rr_time"))
set_task (float(get_cvar_num("amx_auto_rr_time")),"res tart_map",0)
// return PLUGIN_CONTINUE
}
}

public restart_map() {
if (AutoRR==true && (get_cvar_num("amx_auto_rr_time")>0)){
set_hudmessage(0, 100, 200, 0.05, 0.65, 2, 0.02, 6.0, 0.01, 0.1, 3)
show_hudmessage(0,"[AMXX] Automatic Round-Restart!")
set_cvar_float("sv_restart",2.0)
// return PLUGIN_HANDLED
}
else {
client_print(0,print_chat,"[AMXX] Autorestart plugin is disabled. No restart will be done!")
// return PLUGIN_HANDLED
}
}

public plugin_init() {
register_plugin("Auto-Restart","1.0","Visar1")
register_event("TextMsg","restart_time","a"," 2&#Game_C")
register_cvar("amx_auto_rr_time","25")
register_clcmd("amx_auto_rr","amx_auto_rr",AD MIN_CFG,"amx_auto_rr : < 0 | 1> Turns ability to Auto-Restart (Game Commencing) on and off")
}
who to edit command to exec lo3 file after 25 sec -=- lo3 in configs folder :S

Sorry for my english
visar1 is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 06-20-2010 , 13:12   Re: help with autorestart code
Reply With Quote #2

PHP Code:
server_cmd("exec lo3.cfg");
server_exec(); 
lo3.cfg in cstrike.
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
visar1
Member
Join Date: Nov 2009
Old 06-20-2010 , 13:20   Re: help with autorestart code
Reply With Quote #3

Quote:
Originally Posted by Alucard^ View Post
PHP Code:
server_cmd("exec lo3.cfg");
server_exec(); 
lo3.cfg in cstrike.
I cant understand :S

can you show me full tutorial p.s go here put this :S
visar1 is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 06-20-2010 , 16:27   Re: help with autorestart code
Reply With Quote #4

PHP Code:
register_plugin("Auto-Restart","1.0","Visar1"
You did it the plugin but you don't know where can you put the code that i gave you? o.O

Put in restart_map( )
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
visar1
Member
Join Date: Nov 2009
Old 06-24-2010 , 10:06   Re: help with autorestart code
Reply With Quote #5

ok thnx I Have fix plugin
visar1 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 11:32.


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