View Single Post
mlibre
Veteran Member
Join Date: Nov 2015
Location: return PLUGIN_CONTINUE
Old 03-19-2024 , 15:28   Re: Weapon Plugin and Removal at the Beginning of the Round
Reply With Quote #4

add this in plugin_init

PHP Code:
RegisterHam(Ham_Spawn"player""Ham_SpawnPlayer_Post"true
and try...

PHP Code:
public Ham_SpawnPlayer_Post(iPlayer)
{
    if(
zp_get_user_survivor(iPlayer) || !is_user_alive(iPlayer))
        return 
HAM_IGNORED
    
    engclient_cmd
(iPlayerWEAPON_REFERANCE)
    
    new 
iActiveItem get_pdata_cbase(iPlayerm_pActiveItemextra_offset_player)

    if(
IsValidPev(iActiveItem) && IsCustomItem(iActiveItem))
    {
        
ExecuteHamB(Ham_RemovePlayerItemiPlayeriActiveItem)
        
        
engclient_cmd(iPlayer"lastinv")
        
        
client_print(iPlayer3"Sorry, the %s is only for the survivor"ZP_ITEM_NAME)
    }
    
    return 
HAM_IGNORED

__________________
mlibre is offline