How to detach and attach shield entity to player?
I tried the following code but it crashed HLDS
PHP Code:
Basically my main aim is to drop the pistol attached to the player rather than the shield on engclient_cmd ( id, "drop", "weapon_<pistol>" ). so i am using engclient_cmd ( id, "drop", "weapon_shield" ) and then engclient_cmd ( id, "drop", "weapon_<pistol>" ) to detach the pistol and then I wish to reattach the shield. I am able to get the entity index of the shield but I don't know how to attach it back. |
Re: How to detach and attach shield entity to player?
Please don't suggest code snippets that work on the basis of entity model. Also I am trying to avoid using Fakemeta. Please don't ask why :P
|
Re: How to detach and attach shield entity to player?
Quote:
Anyway, to set a shield, you will need to set offsets, oh, wait, offset.. fakemeta will be needed. That's too bad. I have an idea, just make a whole module just to set a shield, you will avoid to use fakemeta. Ah well, but you will have to load another module.. Oh shit. Oh, just another awesome idea, just request this to be integrated in cstrikle module since cs_set_user_shield doesn't seem to exist. Oh shit again, I bet you don't want to use cstrike. Maybe you should actually not use AMXX because it's basically what you're trying to achieve. /troll |
Re: How to detach and attach shield entity to player?
probably fakemeta simply dont run on his non-steam server thats why.
|
Re: How to detach and attach shield entity to player?
Troll apart, here cs_set_user_shield() and cs_remove_user_shield().
PHP Code:
PHP Code:
|
Re: How to detach and attach shield entity to player?
Never thought you were even taught sarcasm :P. So, that basically means, that I should constantly try to involve all modules... ok fine then... let's talk serious... I am making an upgrade to restmenu.sma - official amxmodx plugin under cstrike addon. What would you prefer? Less module interaction or more module interaction? I wanted to talk to you personally about it, but let it be public since you are so high today :D
btw, nice work there :) Thanks for it. Sadly would need to include fakemeta. But that's kind of inevitable in front of your sarcasm :) Actually a similar thing was already coded by exolent ( https://forums.alliedmods.net/showthread.php?p=1521527 ). Anyways, I wanted to know if we could use it just like what happens in engine, when we throw a weapon down and pick it up. Instead of removing the shield from world and then recreating, why not use existing drop and pickup function? Can you provide a code for that? eg. I drop the shield and I want it to be back to me without actually moving towards the shield and touching it in-game. |
Re: How to detach and attach shield entity to player?
It doesn't mean you should try to involve all modules, it means that trying to limit your plugin to engine/fakemeta is stupid and you should use whichever does what you want better.
|
Re: How to detach and attach shield entity to player?
I think this would make sense to add these ones to cstrike module, as there is already cs_get_user_shield().
|
Re: How to detach and attach shield entity to player?
@Arkshine - It's giving me Invalid Entity error on Native : get_pdata_int under cs_set_user_shield ( ).
|
Re: How to detach and attach shield entity to player?
It works fine for me, so you better explain exactly how you used the function and what get_pdata_int you're talking about.
|
| All times are GMT -4. The time now is 09:48. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.