AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Replace weapon entity with other (https://forums.alliedmods.net/showthread.php?t=101184)

Sn!ff3r 08-21-2009 15:39

Replace weapon entity with other
 
Hi.

I want to replace default weapons spawned by map to other, example weapon_m4a1 to weapon_m3. How?

I saw plugin like this once, but cant find anymore.

xPaw 08-21-2009 15:43

Re: Replace weapon entity with other
 
http://forums.alliedmods.net/showthread.php?p=129751

Arkshine 08-21-2009 15:51

Re: Replace weapon entity with other
 
Hook "armoury_entity" (Ham_Spawn), and use cs_[get|set]_armoury_type() to get/set the weapon type and I think you would need to change pev_model too to show the new weapon model.

Sn!ff3r 08-21-2009 16:47

Re: Replace weapon entity with other
 
Quote:

Hook "armoury_entity" (Ham_Spawn)
Uhh.

PHP Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>

#define PLUGIN "Nowy Plugin"
#define VERSION "1.0"
#define AUTHOR "Sn!ff3r"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam(Ham_Spawn"armoury_entity""armoury_spawn"/*, 1*/)
}

public 
armoury_spawn(ent)
{    
    
server_print("spawned armoury entity")        


never prints.

xPaw 08-21-2009 16:48

Re: Replace weapon entity with other
 
plugin_precache

Sn!ff3r 08-21-2009 16:58

Re: Replace weapon entity with other
 
o_O this is strange!

I tried with fm_setmodel, not works. I tried with plugin_precache (and find_ent_by_class) - nothing found.

Wtf o.O

Arkshine 08-21-2009 17:09

Re: Replace weapon entity with other
 
Use Ham_Spawn in plugin_precache()

Sn!ff3r 08-21-2009 17:16

Re: Replace weapon entity with other
 
@up - oh, thanks. I nevermind about that. Now works!


All times are GMT -4. The time now is 15:13.

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