Raised This Month: $ Target: $400
 0% 

[Solved] Better method


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-19-2012 , 17:01   Re: [Suggestion] Better method
Reply With Quote #1

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
Lolz0r
Veteran Member
Join Date: Nov 2010
Location: Balgaria
Old 05-19-2012 , 17:24   Re: [Suggestion] Better method
Reply With Quote #2

What's the diffrence between <VeCo>'s code and yours (SetModel), because you edited it twice. And now the bomb doesn't hide when it drops.

Last edited by Lolz0r; 05-20-2012 at 08:08.
Lolz0r is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-20-2012 , 09:59   Re: [Suggestion] Better method
Reply With Quote #3

More efficient code :

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

#define VERSION "0.0.1"
#define PLUGIN ""

new gmsgBombPickup

public plugin_init()
{
    
register_plugin(PLUGINVERSION"ConnorMcLeod")

    
register_logevent"LogEvent_Got_Bomb"3"2=Spawned_With_The_Bomb" )
    
register_logevent"LogEvent_Got_Bomb"3"2=Got_The_Bomb" )

    
gmsgBombPickup get_user_msgid("BombPickup")
}

public 
plugin_precache()
{
    
create_entity("func_bomb_target")
}

public 
LogEvent_Got_Bomb( )
{
    new 
iFwd register_forward(FM_SetModel"SetModel"1)
    
engclient_cmd(0"drop""weapon_c4")
    
unregister_forward(FM_SetModeliFwd1)
}

public 
SetModelentmodel[] )
{
    if( 
equal(model"models/w_backpack.mdl") )
    {
        
call_think(ent)
        
message_begin(MSG_ALLgmsgBombPickup)
        
message_end()
    }

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 05-20-2012 at 10:00.
ConnorMcLeod is offline
Lolz0r
Veteran Member
Join Date: Nov 2010
Location: Balgaria
Old 05-20-2012 , 16:24   Re: [Suggestion] Better method
Reply With Quote #4

Yes, this one really looks better and doens't shows every time that the bomb is dropped (and she is), which is very good.

Actually I think this method (with bomb) has some prons, and he is that at round end terrorirst's don't get any money compared to ct's. And till I tested, I was thinking for method, which will be more for fairness everyone: after round end from both teams (every player) to be taken 200$ for example, but this isn't the place for me to want it, this is "scripting help". Im just saying it like idea.

Thank for this!
Lolz0r is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-20-2012 , 17:12   Re: [Suggestion] Better method
Reply With Quote #5

Could alternate T win and CT win, but would need to use Rage module, or maybe arkshine round terminator can do such a thing, dunno, try it.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Lolz0r
Veteran Member
Join Date: Nov 2010
Location: Balgaria
Old 05-26-2012 , 11:27   Re: [Suggestion] Better method
Reply With Quote #6

Quote:
Originally Posted by ConnorMcLeod View Post
Could alternate T win and CT win, but would need to use Rage module, or maybe arkshine round terminator can do such a thing, dunno, try it.
Why they aren't alternating? Isn't it possible to make it like i described in my last post?

I don't know very much about scripting, especially from Rage and Round Terminator, but if you desire with arkshine to make something similar it will be good, although for the moment from #8 post works for me.
Lolz0r 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 00:19.


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