AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Change bomb model! (cstrike) (https://forums.alliedmods.net/showthread.php?t=9873)

TotalNoobScripter 02-01-2005 23:58

Change bomb model! (cstrike)
 
How would you change the bomb model? I mean the model when its planted, not the view model or the weaponmodel, i know how to do that :D

TotalNoobScripter 02-02-2005 00:22

better yet... whats the entity name / classname of a planted / dropped bomb

BAILOPAN 02-02-2005 00:44

it's a weaponbox containing a weapon_c4, like all other weapons in CS.

search for a weapon_c4, the owner will be the weaponbox whose model you need to change.

I think that's how it works at least :)

TotalNoobScripter 02-02-2005 23:20

because of my noobness... how would you search all the entities if it contained a model? I only know how to get a entity string if the entity is specififed or like pfn_touch.

Peli 02-03-2005 00:07

I think it's :
Code:
entity_get_string()

Johnny got his gun 02-03-2005 04:53

Actually a planted bomb is a "grenade". And its EV_SZ_model is "models/w_c4.mdl".

entity_set_model() probably works to change its model.

Or you could try to hook FM_SetModel and when it says "models/m_c4.mdl", you just replace that with your new model. Probably a nice way to do it if you intend to change the model at all times.

Votorx 02-03-2005 07:21

Or you can just run through the entities looking for the classname "weapon_c4" and once its found just change the model with entity_set_string().

TotalNoobScripter 02-03-2005 20:23

Quote:

Originally Posted by Johnny got his gun
Actually a planted bomb is a "grenade". And its EV_SZ_model is "models/w_c4.mdl".

entity_set_model() probably works to change its model.

Or you could try to hook FM_SetModel and when it says "models/m_c4.mdl", you just replace that with your new model. Probably a nice way to do it if you intend to change the model at all times.

can u give me an example how to use FM_SetModel ?. I've never used FakeMeta before.

XxAvalanchexX 02-03-2005 21:53

http://www.amxmodx.org/funcwiki.php?go=func&id=615

TotalNoobScripter 02-03-2005 23:28

Code:
 register_forward ( FM_SetModel, changetoipod, 1 ) public changetoipod() {    dabomb = forward_return ( FMV_String, "EV_SZ_model" )    if (equali(dabomb,"models/w_c4.mdl") == 1 ) {       // the function to get the entity name and dispatch the new model name which i believe can be doen with entity_get_classname and entity_set_model?? return PLUGIN_CONTINUE } return PLUGIN_CONTINUE }

?


All times are GMT -4. The time now is 19:27.

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