Raised This Month: $ Target: $400
 0% 

ConnorMcLeods Start Weapons Plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MrKiller2010
Senior Member
Join Date: Aug 2012
Old 08-11-2013 , 05:19   ConnorMcLeods Start Weapons Plugin
Reply With Quote #1

This plugin by ConnorMcLeod
Is working, but at some jb maps no players will get any weapon not even knife.
Could someone help me to fix it?


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

#define VERSION "0.0.1"
#define PLUGIN "Jail Start Weapons"

#define m_fHasSurvivedLastRound 113
#define m_iTeam    114
#define TEAM_CT    2

new bool:g_bNewPlayer,
    
HamHook:g_iHhAddPlayerItemPreHamHook:g_iHhCBasePlayerGiveAmmoPreHamHook:g_iHhCBasePlayerSpawnPost

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

    if( 
engfunc(EngFunc_FindEntityByStringFM_NULLENT"classname""game_player_equip") )
    {
        
pause("ac")
    }

    
RegisterHam(Ham_Spawn"player""OnCBasePlayer_Spawn"false)

    
DisableHamForwardg_iHhAddPlayerItemPre RegisterHam(Ham_AddPlayerItem"player""OnCBasePlayer_AddPlayerItem"false) )
    
DisableHamForwardg_iHhCBasePlayerGiveAmmoPre RegisterHam(Ham_GiveAmmo"player""OnCBasePlayer_GiveAmmo"false) )
    
DisableHamForwardg_iHhCBasePlayerSpawnPost RegisterHam(Ham_Spawn"player""OnCBasePlayer_Spawn_Post"true) )
}

CBasePlayer_GiveDefaultItemsid )
{
    
give_item(id"weapon_knife")

    if( 
get_pdata_int(idm_iTeam) == TEAM_CT )
    {
        
give_item(id"weapon_deagle")
        
give_item(id"weapon_m4a1")
        
ExecuteHamB(Ham_GiveAmmoid35"50ae"35)
        
ExecuteHamB(Ham_GiveAmmoid90"556nato"90)
    }
}

public 
OnCBasePlayer_Spawnid )
{
    if( !
get_pdata_int(idm_fHasSurvivedLastRound) )
    {
        
EnableHamForwardg_iHhAddPlayerItemPre )
        
EnableHamForwardg_iHhCBasePlayerGiveAmmoPre )
        
EnableHamForwardg_iHhCBasePlayerSpawnPost )
        
g_bNewPlayer true
    
}
    else if( 
is_user_aliveid ) )
    {
        
strip_user_weapons(id)
        
CBasePlayer_GiveDefaultItemsid )
    }
}

public 
OnCBasePlayer_AddPlayerItem(idiWeapon)
{
    if( 
g_bNewPlayer )
    {
        
g_bNewPlayer false
        DisableHamForward
g_iHhAddPlayerItemPre )
        
DisableHamForwardg_iHhCBasePlayerGiveAmmoPre )

        
CBasePlayer_GiveDefaultItemsid )

        
EnableHamForwardg_iHhAddPlayerItemPre )
        
EnableHamForwardg_iHhCBasePlayerGiveAmmoPre )
    }

    
set_pev(iWeaponpev_flagsFL_KILLME)
    
SetHamReturnInteger(0)

    return 
HAM_SUPERCEDE
}

public 
OnCBasePlayer_GiveAmmo()
{
    return 
HAM_SUPERCEDE
}

public 
OnCBasePlayer_Spawn_Postid )
{
    
DisableHamForwardg_iHhAddPlayerItemPre )
    
DisableHamForwardg_iHhCBasePlayerGiveAmmoPre )
    
DisableHamForwardg_iHhCBasePlayerSpawnPost )

__________________
JailBreak & HNS
MrKiller2010 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-11-2013 , 05:25   Re: ConnorMcLeods Start Weapons Plugin
Reply With Quote #2

The plugin runs only if the map doesn't have a game_player_equip entity.
__________________

Last edited by Arkshine; 08-11-2013 at 05:26.
Arkshine is offline
MrKiller2010
Senior Member
Join Date: Aug 2012
Old 08-11-2013 , 05:30   Re: ConnorMcLeods Start Weapons Plugin
Reply With Quote #3

Quote:
Originally Posted by Arkshine View Post
The plugin runs only if the map doesn't have a game_player_equip entity.
Hmm weird.
So what do suggest me to do?
__________________
JailBreak & HNS
MrKiller2010 is offline
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 08-11-2013 , 07:51   Re: ConnorMcLeods Start Weapons Plugin
Reply With Quote #4

In plugin_init remove the

if(engfunc(findentbystring))
pause()
mottzi is offline
Send a message via MSN to mottzi
MrKiller2010
Senior Member
Join Date: Aug 2012
Old 08-11-2013 , 16:27   Re: ConnorMcLeods Start Weapons Plugin
Reply With Quote #5

Quote:
Originally Posted by mottzi View Post
In plugin_init remove the

if(engfunc(findentbystring))
pause()
Then i need to remove all Ham's :S
And it doesn't work..
__________________
JailBreak & HNS
MrKiller2010 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-11-2013 , 17:30   Re: ConnorMcLeods Start Weapons Plugin
Reply With Quote #6

Quote:
Originally Posted by MrKiller2010 View Post
Then i need to remove all Ham's :S
And it doesn't work..
What???
__________________
fysiks is offline
MrKiller2010
Senior Member
Join Date: Aug 2012
Old 08-12-2013 , 03:33   Re: ConnorMcLeods Start Weapons Plugin
Reply With Quote #7

Quote:
Originally Posted by fysiks View Post
What???
When I remove the code he said.
I need to remove:
PHP Code:
DisableHamForwardg_iHhAddPlayerItemPre RegisterHam(Ham_AddPlayerItem"player""OnCBasePlayer_AddPlayerItem"false) ) 
    
DisableHamForwardg_iHhCBasePlayerGiveAmmoPre RegisterHam(Ham_GiveAmmo"player""OnCBasePlayer_GiveAmmo"false) ) 
    
DisableHamForwardg_iHhCBasePlayerSpawnPost RegisterHam(Ham_Spawn"player""OnCBasePlayer_Spawn_Post"true) ) 
In order to compile it.
__________________
JailBreak & HNS
MrKiller2010 is offline
guipatinador
SourceMod Donner Party
Join Date: Oct 2009
Location: Poortugal
Old 08-12-2013 , 03:36   Re: ConnorMcLeods Start Weapons Plugin
Reply With Quote #8

Read again.
guipatinador is offline
MrKiller2010
Senior Member
Join Date: Aug 2012
Old 08-12-2013 , 07:14   Re: ConnorMcLeods Start Weapons Plugin
Reply With Quote #9

Quote:
Originally Posted by guipatinador View Post
Read again.
Still don't get it.
__________________
JailBreak & HNS
MrKiller2010 is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 08-12-2013 , 07:55   Re: ConnorMcLeods Start Weapons Plugin
Reply With Quote #10

He told you to remove the if block in plugin_init.
__________________
hleV 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 15:53.


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