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:28   Re: [Suggestion] Better method
Reply With Quote #1

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 #2

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 #3

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 #4

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 #5

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 #6

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 #7

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
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