Can fake player entities be given weapons?
I tried to give_item() a weapon to the fake player entity I created and it ended up causing odd results: the entity fell through the floor slowly and never did have the weapon, or at least it wasn't wielded.
Anyone know of sma source I could look at to accomplish this (assuming its possible) or if not does anyone have any suggestions? Also, if give_item() doesn't cause an entity to wield the weapon, what would be the followup command to do that? Thanks for any assistance! Mugwump |
give_item is a weird command that actually is kind of hackish.
It creates an entity, then forces it to touch the target. If it still exists after touching, it's deleted. So the only reason you "see" an entity is that it's a temporary marker. If your entity is not a player that registers touching like that, nothing will happen. After all, only valid players can use weapons. |
If i'm not mistaken, you can get/set what weapon a player model (even if it's fake) is holding using.
Code:
I believe it goes by p_weaponname.mdl but i'm not sure. I am almost postive that you can achieve this, if not with EV_SZ_weaponmodel, then one of the other string entity variables. |
Hmm, so there is no way for a fake player entity to wield a weapon? If so that doesn't explain how bots can wield weapons unless they are actually interfaced to be _real_ players as far as the server understands ... In any event this is disappointing . :(
Mugwump |
1] Bots ARE real players...
2] Ryan just gave you code to strap weapon models on, does it work? |
Sorry, when I posted earlier I hadnt seen your post Ryan, will be checking into it and will post.
Thanks Mugwump |
I was not able to get the weaponmodel string to work. I tried the following to copy my weaponmodel to the entity:
Code:
new szWeaponModel[64];I then tried: Code:
entity_set_string(dEnt, EV_SZ_weaponmodel,"models/p_knife.mdl")If that setting has any effect I don't see it. :( Mugwump |
hmmm
speaking of which, that gave me an idea, is it possible to give hostages a gun? (like they just hold it to look pretty, they dont shoot nor drop it when dead :P)
if it is possible, would it be done the same way as mentioned above (if it works) or some other way, and if it is possible by the way mentioned above, how do you get the id or whatever of the hostages (Im guessing theres one for each) |
i dont think so. I think the player models are coded with properties to accept the weapon attachments, whereas the hostage models are probably not.
|
hmmm
hmmm, ill check if they can hold a gun or not...
|
| All times are GMT -4. The time now is 14:53. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.