Raised This Month: $ Target: $400
 0% 

ConnorMcLeods Start Weapons Plugin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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