Raised This Month: $ Target: $400
 0% 

My Map Changing Plugin for TS.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
terrum
AlliedModders Donor
Join Date: Apr 2006
Location: United Kingdom
Old 05-30-2007 , 19:14   My Map Changing Plugin for TS.
Reply With Quote #1

this is my script i made myself. Yes it's probably stupidly wrong but it's my first plugin. I want it so it doesn't repeat the cycle more than 1 time, i only want it to do this once, how do i do this? thanks

Quote:
#include <amxmodx>
#include <engine>

//terrum_meckmapchange.sma:
// Custom plugin by Terrum. Not to be released.

new const PLUGIN[] = "Mecklenburg Map Changer"
new const VERSION[] = "1"
new const AUTHOR[] = "Terrum"
new cycler_classname[] = "whatever"

new const Float:cycler_time = 5.0 //cycler runs every so many seconds
new const cvar_name[] = "amx_mecklenburg_mapchange"
new const cvar_default[] = "1" //default cvar value. "1"=on,"0"=off

public plugin_init() {
register_plugin(PLUGIN,VERSION,AUTHOR)
register_cvar( cvar_name , cvar_default )
new entity = create_entity("info_target")
entity_set_string(entity,EV_SZ_classname,cycl er_classname)
entity_set_float(entity,EV_FL_nextthink,halfl ife_time() + cycler_time)
register_think(cycler_classname,"HandleCycler ")
} //public.plugin_init

public HandleCycler(entity) {
if ( get_cvar_num( cvar_name ) > 0 ) { //if cvar greater than zero
} //if.cvar
server_cmd("amx_map mecklenburgv5_a6")
server_cmd("amxx pause terrum_meck")
} //public.HandleCycler
EDIT: Well all i want it to do is change the map to "mecklenburgv5_a6" once after 5 seconds the server starts and have a CVAR "amx_mecklenburg_mapchange" default to 1 (1 = on. 0 = off.)
__________________
Thanks,
Terrum.



Last edited by terrum; 05-30-2007 at 19:41.
terrum is offline
Send a message via AIM to terrum Send a message via MSN to terrum Send a message via Skype™ to terrum
 


Thread Tools
Display Modes

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 10:38.


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