Raised This Month: $ Target: $400
 0% 

[Solved] Better method


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Lolz0r
Veteran Member
Join Date: Nov 2010
Location: Balgaria
Old 05-19-2012 , 14:01   [Solved] Better method
Reply With Quote #1

Hi, this plugins makes one cycle at start of every round - makes, drops and hides the bomb after drop. I want to ask the way its made is ot good ?

Code:
#include <amxmodx> #include <fakemeta> public plugin_init() {     register_plugin( "Round End", "1.0", "hleV/Exolent/<VeCo>" )     register_logevent( "LogeventSpawnWithBomb", 3, "2=Spawned_With_The_Bomb" )         register_forward( FM_SetModel, "SetModel" ) } //Code by hleV(CREATE BOMB) public plugin_precache() {     new iEntity = engfunc( EngFunc_CreateNamedEntity, engfunc( EngFunc_AllocString, "func_bomb_target" ) )     set_pev( iEntity, pev_solid, SOLID_NOT ) } //Code by Exolent(DROPPED BOMB) public LogeventSpawnWithBomb( iEntity ) {     engclient_cmd( 0, "drop", "weapon_c4" ) } //this code by <VeCo>(DELETE BOMB AFTER THROW) public SetModel( iEntity, const szModel[] ) {     if( !pev_valid( iEntity ) ) return         static szClassName[ 10 ]     pev( iEntity, pev_classname, szClassName, 9 )         if( !equal( szClassName, "weaponbox" ) || szModel[ 9 ] != 'b' ) return     engfunc( EngFunc_SetOrigin, iEntity, Float:{ 0.0, 0.0, 0.0 } ) }

Last edited by Lolz0r; 05-19-2012 at 17:49.
Lolz0r is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-19-2012 , 14:17   Re: [Suggestion] Better method
Reply With Quote #2

What do you want to do ?
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Lolz0r
Veteran Member
Join Date: Nov 2010
Location: Balgaria
Old 05-19-2012 , 14:28   Re: [Suggestion] Better method
Reply With Quote #3

Quote:
Originally Posted by Lolz0r View Post
Hi, this plugins makes one cycle at start of every round - makes, drops and removes the bomb after drop
Just round end for surf_ski_2 map.
Lolz0r is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-19-2012 , 14:51   Re: [Suggestion] Better method
Reply With Quote #4

Why don't you create an hostage rescue zone instead ?
Is rage module installed on your server ?
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 05-19-2012 at 14:51.
ConnorMcLeod is offline
Lolz0r
Veteran Member
Join Date: Nov 2010
Location: Balgaria
Old 05-19-2012 , 15:49   Re: [Suggestion] Better method
Reply With Quote #5

Quote:
Originally Posted by ConnorMcLeod View Post
Why don't you create an hostage rescue zone instead ?
I did that first, but there were problems with the money ct's had 0$ I think, I dont remember.

Quote:
Originally Posted by ConnorMcLeod View Post
Is rage module installed on your server ?
No, but if need ill install it.
Lolz0r is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-19-2012 , 17:01   Re: [Suggestion] Better method
Reply With Quote #6

No it is not needed.

In fact code is fine, you could just enable SetModel forward only when needed :

PHP Code:
#include <amxmodx>
#include <fakemeta>

new g_iFwdSetModel = -1

public plugin_init() 
{
    
register_plugin"Round End""1.0""hleV/Exolent/<VeCo>" )

    
register_logevent"LogeventSpawnWithBomb"3"2=Spawned_With_The_Bomb" )
}

//Code by hleV(CREATE BOMB)
public plugin_precache() 
{
    new 
iEntity engfuncEngFunc_CreateNamedEntityengfuncEngFunc_AllocString"func_bomb_target" ) )
    
set_peviEntitypev_solidSOLID_NOT )
}

//Code by Exolent(DROPPED BOMB)
public LogeventSpawnWithBombiEntity )
{
    if( 
g_iFwdSetModel != -)
    {
        
g_iFwdSetModel register_forward(FM_SetModel"SetModel" )
    }
    
engclient_cmd0"drop""weapon_c4" )
}

public 
SetModeliEntity, const szModel[] )
{
    if( 
equal(szModel"models/w_backpack.mdl") )
    {
        
unregister_forward(FM_SetModelg_iFwdSetModel)
        
g_iFwdSetModel = -1
        
        set_pev
iEntitypev_solidSOLID_NOT )
        
set_peviEntitypev_effectsEF_NODRAW)
    }

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 05-19-2012 at 17:05.
ConnorMcLeod is offline
Reply


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 00:19.


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