Raised This Month: $ Target: $400
 0% 

ROUND-START


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ProIcons
Senior Member
Join Date: Jan 2009
Location: Greece - Salonica
Old 12-25-2009 , 03:36   ROUND-START
Reply With Quote #1

PHP Code:

register_logevent
("RSZ",2,"1=Round_Start")  



public 
remove_bomb()
{
        new 
g_MaxClients get_maxplayers ();
    
        for ( new 
1<= g_MaxClients; ++)
        {
            
engclient_cmd(i"drop""weapon_c4")
        }

        new 
weapboxbomb fm_find_ent_by_class(-1"weapon_c4")
        if (
bomb && (weapbox pev(bombpev_owner)) > get_maxplayers()) {
(
187)            dllfunc(DLLFunc_Thinkweapbox// will remove weaponbox + weapon_c4 entity pair
            // remove blinking red bomb mark on the radar
            
message_begin(MSG_ALLget_user_msgid("BombPickup"))
            
message_end()
        }    
}  
public 
RSZ() 
{
   if (
get_cvar_num("respawn") == 1)   
   {
(
197)      remove_bomb()
      new 
players[32], pnum
      get_players
(playerspnum);
      for( new 
ii<pnumi++ )
      {
          
give_item(players[i],"weapon_m4a1")
          
give_item(players[i],"weapon_awp"
          
give_item(players[i],"weapon_m4a1"
          
give_item(players[i],"weapon_ak47"
          
give_item(players[i],"weapon_deagle"
          
give_item(players[i],"weapon_flashbang"
          
give_item(players[i],"weapon_flashbang")
          
give_item(players[i],"weapon_flashbang")
          
give_item(players[i],"weapon_flashbang")
          
give_item(players[i],"weapon_hegrenade")
          
give_item(players[i],"weapon_smokegrenade")
          
give_item(players[i],"item_kevlar")
          
give_item(players[i],"ammo_338magnum")
          
give_item(players[i],"ammo_556nato")
          
give_item(players[i],"ammo_762nato")
          
give_item(players[i],"ammo_50ae")
          
give_item(players[i],"ammo_338magnum")
          
give_item(players[i],"ammo_556nato")
          
give_item(players[i],"ammo_762nato")
          
give_item(players[i],"ammo_50ae")
          
give_item(players[i],"ammo_338magnum")
          
give_item(players[i],"ammo_556nato")
          
give_item(players[i],"ammo_762nato")
          
give_item(players[i],"ammo_50ae")
          
give_item(players[i],"ammo_45acp")
          
give_item(players[i],"ammo_45acp")
          
give_item(players[i],"ammo_45acp")
          
give_item(players[i],"ammo_45acp")
          
give_item(players[i],"ammo_9mm")
          
give_item(players[i],"ammo_9mm")
          
give_item(players[i],"ammo_9mm")
          
give_item(players[i],"ammo_9mm")
          
set_user_health (players[i],500
          
AmmoMaster[players[i]]=true 
      
}
   }
   return 
PLUGIN_CONTINUE

I Have this code, but it has a problem, Sometimes is working and sometimes is not:
Code:
L 12/25/2009 - 02:20:11: [FAKEMETA] Invalid entity
L 12/25/2009 - 02:20:11: [AMXX] Displaying debug trace (plugin "gather.amxx")
L 12/25/2009 - 02:20:11: [AMXX] Run time error 10: native error (native "dllfunc")
L 12/25/2009 - 02:20:11: [AMXX]    [0] Gather.sma::remove_bomb (line 187)
L 12/25/2009 - 02:20:11: [AMXX]    [1] Gather.sma::RSZ (line 197)
__________________
function rb return $regsubex($$1-,/(.)/g,$+($chr(2) $+ $chr(3),$r(2,15),$chr(2),\1))
ProIcons is offline
ProIcons
Senior Member
Join Date: Jan 2009
Location: Greece - Salonica
Old 12-26-2009 , 04:13   Re: ROUND-START
Reply With Quote #2

(187) dllfunc(DLLFunc_Think, weapbox) // will remove weaponbox + weapon_c4 entity pair

Probably this is the wrong but whY?
__________________
function rb return $regsubex($$1-,/(.)/g,$+($chr(2) $+ $chr(3),$r(2,15),$chr(2),\1))
ProIcons is offline
Hasler
BANNED
Join Date: Jul 2009
Location: Argentina, Rosario
Old 12-26-2009 , 04:16   Re: ROUND-START
Reply With Quote #3

You can leave all the code?
Hasler is offline
ProIcons
Senior Member
Join Date: Jan 2009
Location: Greece - Salonica
Old 12-26-2009 , 04:25   Re: ROUND-START
Reply With Quote #4

Quote:
Originally Posted by Hasler View Post
You can leave all the code?
What?:S
my code is on top of the page
__________________
function rb return $regsubex($$1-,/(.)/g,$+($chr(2) $+ $chr(3),$r(2,15),$chr(2),\1))
ProIcons is offline
Hasler
BANNED
Join Date: Jul 2009
Location: Argentina, Rosario
Old 12-26-2009 , 04:44   Re: ROUND-START
Reply With Quote #5

Quote:
Originally Posted by ProIcons View Post
(187) dllfunc(DLLFunc_Think, weapbox) // will remove weaponbox + weapon_c4 entity pair

Probably this is the wrong but whY?

yes, the error is that, i remove (187) and my server shutingdown
Hasler is offline
ProIcons
Senior Member
Join Date: Jan 2009
Location: Greece - Salonica
Old 12-26-2009 , 04:51   Re: ROUND-START
Reply With Quote #6

Omg... i added the 187 to see the line

Code:
L 12/25/2009 - 02:20:11: [FAKEMETA] Invalid entity
L 12/25/2009 - 02:20:11: [AMXX] Displaying debug trace (plugin "gather.amxx")
L 12/25/2009 - 02:20:11: [AMXX] Run time error 10: native error (native "dllfunc")
L 12/25/2009 - 02:20:11: [AMXX]    [0] Gather.sma::remove_bomb (line 187)
L 12/25/2009 - 02:20:11: [AMXX] [1] Gather.sma::RSZ (line 197)
__________________
function rb return $regsubex($$1-,/(.)/g,$+($chr(2) $+ $chr(3),$r(2,15),$chr(2),\1))
ProIcons is offline
ProIcons
Senior Member
Join Date: Jan 2009
Location: Greece - Salonica
Old 04-24-2011 , 11:31   Re: ROUND-START
Reply With Quote #7

bump
__________________
function rb return $regsubex($$1-,/(.)/g,$+($chr(2) $+ $chr(3),$r(2,15),$chr(2),\1))
ProIcons is offline
Old 04-24-2011, 11:57
vato loco [GE-S]
This message has been deleted by vato loco [GE-S]. Reason: ...code not workin :D
Old 04-24-2011, 11:58
drekes
This message has been deleted by drekes.
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-24-2011 , 12:10   Re: ROUND-START
Reply With Quote #8

vato loco, your code looked like it would work except you forgot to register the forward for SetModel. Here is your code with a couple modifications for efficiency.
PHP Code:
#include <amxmodx>
#include <fakemeta>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "ned"

new g_iMaxPlayers
new bool:g_bDroppingBomb;

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_logevent("ev_RoundStart",2,"1=Round_Start")
    
register_forwardFM_SetModel "SetModel" );
    
    
g_iMaxPlayers get_maxplayers()
}

public 
ev_RoundStart()
{
    new 
id
    
for(id 1id <= g_iMaxPlayersid++)
    {
        if(
is_user_alive(id) && user_has_weapon(idCSW_C4))
        {
            
g_bDroppingBomb true;
            
engclient_cmd(id"drop""weapon_c4")
            break;
        }
    }
}

public 
SetModel(iEntModel[])
{
    if( !
g_bDroppingBomb || !Model] || !pev_validiEnt ) )
        return 
FMRES_IGNORED
    
    
static szClassName32];
    
peviEnt pev_classname szClassName charsmaxszClassName ) )
    
    if(
equalszClassName "weaponbox" ) && equalModel "models/w_backpack.mdl" ) )
    {
        
set_peviEnt pev_flags FL_KILLME )
        
dllfuncDLLFunc_Think iEnt )
        
g_bDroppingBomb false;
    }
    
    return 
FMRES_IGNORED

__________________

Last edited by Bugsy; 04-24-2011 at 12:13.
Bugsy is offline
vato loco [GE-S]
Veteran Member
Join Date: Oct 2006
Location: Germany
Old 04-24-2011 , 12:27   Re: ROUND-START
Reply With Quote #9

hehe you are right Bugsy
thx for making the code more efficient
add Bombpickup msg to remove Bomb form radar

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

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "ned"

new g_iMaxPlayers
new bool:g_bDroppingBomb;

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_logevent("ev_RoundStart",2,"1=Round_Start")
    
register_forwardFM_SetModel "SetModel" );
    
    
g_iMaxPlayers get_maxplayers()
}

public 
ev_RoundStart()
{
    new 
id
    
for(id 1id <= g_iMaxPlayersid++)
    {
        if(
is_user_alive(id) && user_has_weapon(idCSW_C4))
        {
            
g_bDroppingBomb true;
            
engclient_cmd(id"drop""weapon_c4")
            break;
        }
    }
}

public 
SetModel(iEntModel[])
{
    if( !
g_bDroppingBomb || !Model] || !pev_validiEnt ) )
        return 
FMRES_IGNORED
    
    
static szClassName32];
    
peviEnt pev_classname szClassName charsmaxszClassName ) )
    
    if(
equalszClassName "weaponbox" ) && equalModel "models/w_backpack.mdl" ) )
    {
        
set_peviEnt pev_flags FL_KILLME )
        
dllfuncDLLFunc_Think iEnt )
        
message_begin(MSG_ALLget_user_msgid("BombPickup"))
        
message_end()
        
g_bDroppingBomb false;
    }
    
    return 
FMRES_IGNORED

__________________

Last edited by vato loco [GE-S]; 04-24-2011 at 12:40.
vato loco [GE-S] is offline
ProIcons
Senior Member
Join Date: Jan 2009
Location: Greece - Salonica
Old 04-24-2011 , 12:34   Re: ROUND-START
Reply With Quote #10

thx
__________________
function rb return $regsubex($$1-,/(.)/g,$+($chr(2) $+ $chr(3),$r(2,15),$chr(2),\1))
ProIcons 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 04:16.


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