Raised This Month: $ Target: $400
 0% 

Fix this script guys pls


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
mlibre
Veteran Member
Join Date: Nov 2015
Location: return PLUGIN_CONTINUE
Old 04-14-2021 , 20:41   Re: Fix this script guys pls
Reply With Quote #5

try this one that does not use reapi "optional"

PHP Code:
#include <amxmodx>
#include <engine>
#include <fun>
#include <cstrike>
#include <zombie_escape>

// Definitions
#define ADMIN_ACCESS    ADMIN_LEVEL_H

static is_player_alive[33]

// Resource
new const g_szModelM249[] = "models/vipitems/v_m249.mdl"
new const g_szModelHe[] = "models/vipitems/v_hebomb.mdl"
new const g_szModelFb[] = "models/vipitems/v_flashbomb.mdl"

public plugin_precache()
{
    
register_plugin("Features VIP""1.0""Null")
    
    
file_exists_pre(g_szModelM249)
    
file_exists_pre(g_szModelHe)
    
file_exists_pre(g_szModelFb)
    
    
RegisterHam(Ham_Item_Deploy"weapon_m249""fw_Item_Deploy_Post"1)
    
RegisterHam(Ham_Spawn"player""fw_PlayerSpawn"1)
    
RegisterHam(Ham_Killed"player""fw_PlayerKilled")
}
 
// Forward called when user humanized
public ze_user_humanized(id)
{
    
// Not Admin? Exit the function...
    
if (!(get_user_flags(id) & ADMIN_ACCESS))
        return
   
    
// Give VIP features
    
Give_Features(id)
}
 
public 
Give_Features(id)
{
    
// Give M249
    
static iwiw give_item(id"weapon_m249")
    
    if(
iw 0
    {
        
engclient_cmd(id"weapon_m249")
        
        
cs_set_user_bpammo (idCSW_M249200
    }
    
    
// Give x2 Fire Nades
    
iw give_item(id"weapon_hegrenade")
        
    if(
iw 0
    { 
        
cs_set_user_bpammo (idCSW_HEGRENADE2
    }
    
    
// Give x2 Frost Nades
    
iw give_item(id"weapon_flashbang")
        
    if(
iw 0
    { 
        
cs_set_user_bpammo (idCSW_FLASHBANG2
    }
}

public 
client_putinserver(id
{
    
is_player_alive[id] = 0
}

public 
fw_PlayerSpawn(const id
{
    if( !
is_user_alive(id) || !is_user_connected(id) ) 
        return 
HAM_IGNORED
        
    is_player_alive
[id] = 1
    
    
return HAM_IGNORED
}

public 
fw_PlayerKilled(id
{
    
is_player_alive[id] = 0
}

public 
fw_Item_Deploy_Post(x
{
    static 
idid get_pdata_cbase(x414)
    
    if( !
is_valid_ent(id) || !is_player_alive[id
    || !
is_user_connected(id) || !(get_user_flags(id) & ADMIN_ACCESS) )
        return 
HAM_IGNORED
        
    
static wpwp cs_get_weapon_id(x)
    
    switch(
wp
    {
        case 
CSW_M249entity_set_string(idEV_SZ_viewmodelg_szModelM249)
        case 
CSW_HEGRENADEentity_set_string(idEV_SZ_viewmodelg_szModelHe)
        case 
CSW_FLASHBANGentity_set_string(idEV_SZ_viewmodelg_szModelFb)
    }
    
    return 
HAM_IGNORED
}

stock file_exists_pre(const file[])
{
    if(
file_exists(file))
    {
        
precache_model(file)
    }
    else {
        
set_fail_state(file)
    }

__________________

Last edited by mlibre; 04-15-2021 at 08:58. Reason: replace includes alreadys
mlibre 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 23:24.


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