AlliedModders

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

raa 05-03-2007 14:40

de_office
 
Hey all, K so I'm trying to help this guy out. He wants cs_office converted to de_. So I figured I would look on these forums for a plugin that did it through scripting rather then have me recreate(decompile/recompile. which is a lot of work) the whole map just for a de_ conversion.

So I found this..
http://forums.alliedmods.net/showthr...ight=de_office

But it doesn't seem to work. The plugin is loading and set to run. I've looked at the script and I can't find anything obvious. First off the bomb isn't even given to a T on spawn.
Wonder if anyone sees anything?

Heres the code:

Code:
/********************************* * de_office * * 2003 - Lazy < <a href="mailto:[email protected]">[email protected]</a> > * * Gameplay change for the map cs_office, terrorists must plant the bomb * at either one of the hostage rescue points. * * New CVars: sv_de_office < 1 / 0 > * * Notes : Requires Engine module to work * * Changelog: *   1.2:        -Fixed for cz * *   1.1:    -Fixed to find_ent_by_class *               -Took out include xtrafun *               -Fixed string * *   1.0:        -First Release *********************************/ #include <amxmodx> #include <engine> public plugin_precache( )     {     if ( get_cvar_num( "sv_de_office" ) == 0 )         return PLUGIN_CONTINUE      /*  Do not precache unless the plugin is on     */         /*  Precache needed items for the bomb since it's only precached on de_ maps    */         precache_model( "models/w_c4.mdl" )         precache_sound( "weapons/c4_click.wav" )     precache_sound( "weapons/c4_disarm.wav" )     precache_sound( "weapons/c4_disarmed.wav" )     precache_sound( "weapons/c4_explode1.wav" )     precache_sound( "weapons/c4_plant.wav" )         return PLUGIN_CONTINUE } public plugin_init( )     {     register_plugin( "de_office", "1.2", "Lazy" )         register_cvar( "sv_de_office", "1", FCVAR_SERVER )         if ( get_cvar_num( "sv_de_office" ) == 1 )         {         new map[ 128 ]         get_mapname( map, 128 )                 if ( equali( map, "cs_office" ) || equali( map, "cs_office_cz" ))             {             set_cvar_num( "mp_c4timer", 30 )             SpawnMapItems( )         }         else             {             pause( "a" )         }     }         return PLUGIN_CONTINUE } public SpawnMapItems( )     {     new i = 1         while ( ( i = find_ent_by_class( i, "func_hostage_rescue" ) ) )         {         new bomb = create_entity( "func_bomb_target" )                 if ( bomb != 0 )             {               new model[ 512 ]             new Float:mins[ 3 ] = { -1024.0, -1024.0, -1024.0 }             new Float:maxs[ 3 ] = { 1024.0, 1024.0, 1024.0 }             new Float:origin[ 3 ]                         entity_get_vector( i, EV_VEC_origin, origin )                         entity_set_vector( bomb, EV_VEC_mins, mins )             entity_set_vector( bomb, EV_VEC_maxs, maxs )             entity_set_int( bomb, EV_INT_solid, 1 )                         DispatchSpawn( bomb )             entity_set_string( i, EV_SZ_model, model )             //entity_set_string( i, EV_SZ_model, "models/w_c4.mdl" )                         //entity_set_model( bomb, "models/w_c4.mdl" )             entity_set_model( bomb, model )             entity_set_origin( bomb, origin )                         remove_entity( i )         }     }         i = 1         while ( ( i = find_ent_by_class( i, "func_hostage_rescue" ) ) )         {         remove_entity( i )     }         return PLUGIN_HANDLED }

Thanks

sammy 05-06-2007 00:59

Re: de_office
 
i also tried to run this plugin and was unsuccessful. i would really like to get this plug going , so if anyone has any sugestion, i would greatly appreciate it...thank you....sammy
www.40calgames.com

Drak 05-06-2007 01:59

Re: de_office
 
This should setup the Bomb target, but i dunno about giving the bomb.
Code:
/********************************* * de_office * * 2003 - Lazy < <a href="mailto:[email protected]">[email protected]</a> > * * Gameplay change for the map cs_office, terrorists must plant the bomb * at either one of the hostage rescue points. * * New CVars: sv_de_office < 1 / 0 > * * Notes : Requires Engine module to work * * Changelog: *   1.2:        -Fixed for cz * *   1.1:    -Fixed to find_ent_by_class *               -Took out include xtrafun *               -Fixed string * *   1.0:        -First Release *********************************/ #include <amxmodx> #include <engine> public plugin_precache() {     if(!get_cvar_num("sv_de_office"))         return PLUGIN_HANDLED   /*    Do not precache unless the plugin is on  */         /*  Precache needed items for the bomb since it's only precached on de_ maps  */         precache_model( "models/w_c4.mdl" )         precache_sound( "weapons/c4_click.wav" )     precache_sound( "weapons/c4_disarm.wav" )     precache_sound( "weapons/c4_disarmed.wav" )     precache_sound( "weapons/c4_explode1.wav" )     precache_sound( "weapons/c4_plant.wav" )         return PLUGIN_CONTINUE } public plugin_init() {     register_plugin( "de_office", "1.2", "Lazy" )           register_cvar( "sv_de_office", "1", FCVAR_SERVER )         if(get_cvar_num("sv_de_office"))     {         new map[ 128 ]         get_mapname( map, 128 )                 if ( equali( map, "cs_office" ) || equali( map, "cs_office_cz" ))         {             set_cvar_num( "mp_c4timer", 30 )             SpawnMapItems( )         }         else         {             pause( "a" )         }     } } public SpawnMapItems() {     new ent;     while((ent =  find_ent_by_class(-1,"func_hostage_rescue") != 0))     {         new bomb = create_entity("func_bomb_target")                 if(bomb > 1)         {             new model[512]             new Float:mins[3] = { -1024.0, -1024.0, -1024.0 }             new Float:maxs[3] = { 1024.0, 1024.0, 1024.0 }             new Float:origin[3]                         entity_get_vector( ent, EV_VEC_origin, origin )                         entity_set_vector( bomb, EV_VEC_mins, mins )             entity_set_vector( bomb, EV_VEC_maxs, maxs )             entity_set_int( bomb, EV_INT_solid, 1 )             entity_set_vector(bomb,EV_VEC_origin,origin)                         DispatchSpawn( bomb )                         //entity_set_string( ent, EV_SZ_model, "models/w_c4.mdl" )                         remove_entity(ent);         }     }     return PLUGIN_HANDLED }

raa 05-07-2007 12:45

Re: de_office
 
sixtwin, that made the round never start. just sat at the red 0:00. You see the T getting the bomb triggers round start.

sammy 05-10-2007 14:33

Re: de_office
 
Quote:

Originally Posted by raa (Post 474344)
sixtwin, that made the round never start. just sat at the red 0:00. You see the T getting the bomb triggers round start.

bump!

deadbeat090 02-02-2008 02:34

Re: de_office
 
Using server side entities is so much more efficient you dont have to worry bout plugins.


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

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