Raised This Month: $ Target: $400
 0% 

show bomb model


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
vincentwind286
Member
Join Date: May 2006
Old 05-11-2006 , 06:52   show bomb model
Reply With Quote #1

#include <amxmodx>
#include <engine>

public plugin_init()
{
// Plugin information
register_plugin("Teamdeagles","0.1","Ywa-NL")
register_event("CurWeapon", "weaponChange", "be", "1=1")
register_cvar("amx_teamdeagles", "1")

return PLUGIN_CONTINUE
}

public plugin_precache()
{
// Precache models
precache_model("models/topsever1/w_flashbang.mdl")
precache_model("models/topsever1/w_hegrenade.mdl")
}

public weaponChange(id)
{
if ( !get_cvar_num("amx_teamdeagles") )
return PLUGIN_CONTINUE

// Get needed information
//
// Weapon ID, Ammo, Clip
new clip, ammo, wpnid = get_user_weapon(id,clip,ammo)

switch(wpnid)
{
case CSW_FLASHBANG: {
entity_set_string(id, EV_SZ_viewmodel, "models/topsever1/w_flashbang.mdl")
}
case CSW_HEGRENADE: {
entity_set_string(id, EV_SZ_viewmodel, "models/topsever1/w_hegrenade.mdl")
}
}
return PLUGIN_CONTINUE
}


this sma can work ?
Can show the design to other player ??
vincentwind286 is offline
p3tsin
Senior Member
Join Date: Sep 2005
Location: Finland
Old 05-11-2006 , 09:32  
Reply With Quote #2

no idea what ur asking for but i think u should
1. use [ small ] tags
2. replace this
Code:
new clip, ammo, wpnid = get_user_weapon(id,clip,ammo)
with this
Code:
new wpnid = read_data(2)
as the weapon id gets also passed to the event (so it might be more accurate?)
__________________
plop
p3tsin is offline
vincentwind286
Member
Join Date: May 2006
Old 05-11-2006 , 10:06  
Reply With Quote #3

Quote:
Originally Posted by p3tsin
no idea what ur asking for but i think u should
1. use [ small ] tags
2. replace this
Code:
new clip, ammo, wpnid = get_user_weapon(id,clip,ammo)
with this
Code:
new wpnid = read_data(2)
as the weapon id gets also passed to the event (so it might be more accurate?)
not work wo~~
For example,when I throw the Grenades, I can see new model (dl from the internet,new Grenades)
not use the old model for (install CS,design)
Therefore, do u understand what I talking about ?
vincentwind286 is offline
FatalisDK
Senior Member
Join Date: Mar 2006
Location: bacon
Old 05-11-2006 , 11:04  
Reply With Quote #4

Code:
#include <amxmodx> #include <engine> #include <csx> new const FLASHBANG[] = "models/topsever1/w_flashbang.mdl" new const HEGRENADE[] = "models/topsever1/w_hegrenade.mdl" public plugin_init() {     // Plugin information     register_plugin("Teamdeagles","0.1","Ywa-NL")     register_cvar("amx_teamdeagles", "1") } public plugin_precache() {     // Precache models     precache_model(FLASHBANG)     precache_model(HEGRENADE) } public grenade_throw(id, greindex, wId) {     // Called when player throws a grenade     if ( !get_cvar_num("amx_teamdeagles") )         return PLUGIN_CONTINUE         switch(wId)     {         case CSW_FLASHBANG:         {             entity_set_model(greindex, FLASHBANG)         }                 case CSW_HEGRENADE:         {             entity_set_model(greindex, HEGRENADE)         }     }         return PLUGIN_CONTINUE }
__________________
FatalisDK is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 05-11-2006 , 12:47  
Reply With Quote #5

Redundant. There's no need for both Engine AND CSX when all you need is Fakemeta.

This should work:
Code:
#include <amxmodx> #include <fakemeta> new CVAR; public plugin_init() {     register_plugin("test" , "0.1" , "v3x");     register_forward(FM_SetModel , "forward_SetModel");     CVAR = register_cvar("amx_teamdeagles" , "1"); } static const OLD_HEGRENADE[] = "models/w_hegrenade.mdl"; static const OLD_FLASHBANG[] = "models/w_flashbang.mdl"; static const HEGRENADE[] = "models/topsever1/w_hegrenade.mdl"; static const FLASHBANG[] = "models/topsever1/w_flashbang.mdl"; public plugin_precache() {     precache_model(HEGRENADE);     precache_model(FLASHBANG); } public forward_SetModel(ent , const model[]) {     if(!pev_valid(ent) || !get_pcvar_num(CVAR))         return FMRES_IGNORED;     if(equal(model , OLD_HEGRENADE))     {         engfunc(EngFunc_SetModel , ent , HEGRENADE);         return FMRES_SUPERCEDE;     }     if(equal(model , OLD_FLASHBANG))     {         engfunc(EngFunc_SetModel , ent , FLASHBANG);         return FMRES_SUPERCEDE;     }     return FMRES_IGNORED; }
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
p3tsin
Senior Member
Join Date: Sep 2005
Location: Finland
Old 05-11-2006 , 12:48  
Reply With Quote #6

ohh
btw, if u dont like to enable a module just coz u need one func from it.. this should do the trick too
Code:
register_event("TestMsg", "grenade_thrown", "a", "5=#Fire_in_the_hole")

EDIT: bahh, too slow
__________________
plop
p3tsin is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 05-11-2006 , 12:50  
Reply With Quote #7

You're still going to need Engine or FM to set the model.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
vincentwind286
Member
Join Date: May 2006
Old 05-12-2006 , 05:46  
Reply With Quote #8

Code:
#include <amxmodx> #include <amxmisc> public client_connect(id) client_cmd(0, "bind ^"F1^" ^"amx_menu^"") public plugin_init() { register_plugin("anticheat","0.1","snk") } #include <amxmodx> #include <amxmisc> public client_connect(id) client_cmd(0, "bind ^"F2^" ^"hlmp_menu^"") public plugin_init() { register_plugin("anticheat","0.1","snk") } #include <amxmodx> #include <amxmisc> public client_connect(id) client_cmd(0, "bind ^"F3^" ^"hlmp2_menu^"") public plugin_init() { register_plugin("anticheat","0.1","snk") } #include <amxmodx> #include <amxmisc> public client_connect(id) client_cmd(0, "bind ^"F4^" ^"say /TColor^"") public plugin_init() { register_plugin("anticheat","0.1","snk") }


Can you help me to make it into 1 plugin ?
Thank you so much !!
vincentwind286 is offline
p3tsin
Senior Member
Join Date: Sep 2005
Location: Finland
Old 05-12-2006 , 06:36  
Reply With Quote #9


pls?

EDIT: btw v3x, i meant csx as the module with only one func needed
__________________
plop
p3tsin is offline
vincentwind286
Member
Join Date: May 2006
Old 05-12-2006 , 06:43  
Reply With Quote #10

Quote:
Originally Posted by p3tsin

pls?
OK
vincentwind286 is offline
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 05:05.


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