Raised This Month: $ Target: $400
 0% 

Solved respawn weapons


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 08-01-2017 , 07:58   respawn weapons
Reply With Quote #1

Hi
in Hl1 players can pickup the weapons
my question how i can control the time of respawn ?

PHP Code:
new const weapon_ents[][] = {
    
"item_airtank""item_antidote""item_battery",
    
"item_healthkit""item_longjump""item_security",
    
"item_sodacan""item_suit""ammo_357",
    
"ammo_9mmAR""ammo_9mmbox""ammo_9mmclip",
    
"ammo_ARgrenades""ammo_buckshot""ammo_crossbow",
    
"ammo_egonclip""ammo_gaussclip""ammo_glockclip",
    
"ammo_mp5clip""ammo_mp5grenades""ammo_rpgclip",
    
"weapon_357""weapon_9mmAR""weapon_9mmhandgun",
    
"weapon_crossbow""weapon_crowbar""weapon_egon",
    
"weapon_gauss""weapon_glock""weapon_handgrenade",
    
"weapon_hornetgun""weapon_mp5""weapon_python",
    
"weapon_rpg""weapon_satchel""weapon_shotgun",
    
"weapon_snark""weapon_tripmine""weapon_quantumdestabilizer",
    
"monster_barney""monster_scientist""monster_snark",
    
"monster_tripmine""monster_satchel""weaponbox"
};
public 
plugin_init() {

    
set_task(0.1"Function",_,__"b")
}

public Function()
{
    
//client_print(0, print_chat, " spawned")
    
new ent 0; for (new 0sizeof(weapon_ents); i++) {
        while ((
ent fm_find_ent_by_class(entweapon_ents[i])) > 0) {
            if (
pev_valid(ent)) {
                
                
DispatchSpawn(ent)
            }
        }
    }
    
    

and othere simple way :
PHP Code:
public plugin_init() {

    
RegisterHam(Ham_Spawn"weapon_gauss","fw_WeaponGaussSpawn"1)
    
RegisterHam(Ham_Think"weapon_gauss","fw_WeaponGaussThink")
}

public 
fw_WeaponGaussSpawn(ent)
    
set_pev(ent,pev_nextthinkget_gametime()+1.0)

public 
fw_WeaponGaussThink(ent){
    if(
pev_valid(ent))
        return 
HAM_IGNORED
        
    DispatchSpawn
(ent)

    return 
HAM_IGNORED

__________________

Last edited by abdobiskra; 10-06-2017 at 12:12.
abdobiskra is offline
Send a message via Skype™ to abdobiskra
 



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 22:52.


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