Raised This Month: $ Target: $400
 0% 

Replace weapon entity with other


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sn!ff3r
Veteran Member
Join Date: Aug 2007
Location: Poland
Old 08-21-2009 , 15:39   Replace weapon entity with other
Reply With Quote #1

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.
__________________
Join US - custom Zombie Server - Custom Addons:



Sn!ff3r is offline
Send a message via Skype™ to Sn!ff3r
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 08-21-2009 , 15:43   Re: Replace weapon entity with other
Reply With Quote #2

http://forums.alliedmods.net/showthread.php?p=129751
__________________
xPaw is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-21-2009 , 15:51   Re: Replace weapon entity with other
Reply With Quote #3

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.
__________________
Arkshine is offline
Sn!ff3r
Veteran Member
Join Date: Aug 2007
Location: Poland
Old 08-21-2009 , 16:47   Re: Replace weapon entity with other
Reply With Quote #4

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.
__________________
Join US - custom Zombie Server - Custom Addons:



Sn!ff3r is offline
Send a message via Skype™ to Sn!ff3r
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 08-21-2009 , 16:48   Re: Replace weapon entity with other
Reply With Quote #5

plugin_precache
__________________
xPaw is offline
Sn!ff3r
Veteran Member
Join Date: Aug 2007
Location: Poland
Old 08-21-2009 , 16:58   Re: Replace weapon entity with other
Reply With Quote #6

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
__________________
Join US - custom Zombie Server - Custom Addons:



Sn!ff3r is offline
Send a message via Skype™ to Sn!ff3r
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-21-2009 , 17:09   Re: Replace weapon entity with other
Reply With Quote #7

Use Ham_Spawn in plugin_precache()
__________________
Arkshine is offline
Sn!ff3r
Veteran Member
Join Date: Aug 2007
Location: Poland
Old 08-21-2009 , 17:16   Re: Replace weapon entity with other
Reply With Quote #8

@up - oh, thanks. I nevermind about that. Now works!
__________________
Join US - custom Zombie Server - Custom Addons:



Sn!ff3r is offline
Send a message via Skype™ to Sn!ff3r
Reply



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:13.


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