Raised This Month: $51 Target: $400
 12% 

fake_touch doesn't work for a weaponbox in the air


Post New Thread Reply   
 
Thread Tools Display Modes
sekac
Senior Member
Join Date: Nov 2016
Old 07-08-2018 , 07:47   Re: fake_touch doesn't work for a weaponbox in the air
Reply With Quote #11

I'm trying to revive a player where someone else has died and trying to use fake_touch in order to get that person's weapons.

I tried this, but failed.

PHP Code:
new ent find_ent_by_owner(-1"weaponbox"iSpecPlayer)
while(
ent 0) {
    if(
pev(entpev_flags) & FL_ONGROUND)
        
fake_touch(entid)

This function is called once.
sekac is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-08-2018 , 07:55   Re: fake_touch doesn't work for a weaponbox in the air
Reply With Quote #12

You can hook touch with worldspawn to know when weaponbox is on ground, then simply call fake_touch.
__________________

Last edited by HamletEagle; 07-08-2018 at 07:55.
HamletEagle is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 07-08-2018 , 10:01   Re: fake_touch doesn't work for a weaponbox in the air
Reply With Quote #13

You can change flags and then call touch
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM
Ghosted is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-08-2018 , 10:21   Re: fake_touch doesn't work for a weaponbox in the air
Reply With Quote #14

Quote:
Originally Posted by Ghosted View Post
You can change flags and then call touch
Not a very good idea. If you change them too early then the player will instantly pickup the weaponbox.
__________________
HamletEagle is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 07-08-2018 , 10:45   Re: fake_touch doesn't work for a weaponbox in the air
Reply With Quote #15

Quote:
Originally Posted by HamletEagle View Post
Not a very good idea. If you change them too early then the player will instantly pickup the weaponbox.
And what he wants?
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM
Ghosted is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-08-2018 , 12:07   Re: fake_touch doesn't work for a weaponbox in the air
Reply With Quote #16

Quote:
Originally Posted by Ghosted View Post
And what he wants?
You do not understand. If you change flags right when the weaponbox is created it will instantly collide with the player that dropped the weapon and it will be instantly picked up, meaning there will be no weapon dropped.
__________________
HamletEagle is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 07-08-2018 , 13:13   Re: fake_touch doesn't work for a weaponbox in the air
Reply With Quote #17

Quote:
Originally Posted by HamletEagle View Post
You do not understand. If you change flags right when the weaponbox is created it will instantly collide with the player that dropped the weapon and it will be instantly picked up, meaning there will be no weapon dropped.
Code:
new Flags = pev(ThatEntity, pev_flags);
set_pev(ThatEntity, pev_flags, Flags | FL_ONGROUND);
fake_touch(ThatEntity, Id);
set_pev(ThatEntity, pev_flags, Flags);
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM
Ghosted is offline
sekac
Senior Member
Join Date: Nov 2016
Old 07-08-2018 , 15:10   Re: fake_touch doesn't work for a weaponbox in the air
Reply With Quote #18

Alright, I have tried this:
PHP Code:
new ent find_ent_by_owner(-1"weaponbox"iSpecPlayer)
set_pev(entpev_flagspev(entpev_flags) | FL_ONGROUND
fake_touch(entid
And it didn't do anything...
sekac is offline
sekac
Senior Member
Join Date: Nov 2016
Old 07-08-2018 , 15:12   Re: fake_touch doesn't work for a weaponbox in the air
Reply With Quote #19

Quote:
Originally Posted by HamletEagle View Post
You do not understand. If you change flags right when the weaponbox is created it will instantly collide with the player that dropped the weapon and it will be instantly picked up, meaning there will be no weapon dropped.
Ah, I didn't say that I'm calling fake_touch when that player dies (that's how he is dropping the weapon) and he cannot pick it up.
sekac 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 09:56.


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