AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to get the unique ID of weapon (https://forums.alliedmods.net/showthread.php?t=176277)

wwzw 01-15-2012 23:29

How to get the unique ID of weapon
 
In game:
1) Players get (buy or admin give) a weapon.
2) When the weapon is thrown away.
3) The other players pick up this weapon.
How can I get this weapon the same ID?

ot_207 01-16-2012 04:23

Re: How to get the unique ID of weapon
 
http://www.amxmodx.org/funcwiki.php?...n_id&go=search

wwzw 01-17-2012 06:36

Re: How to get the unique ID of weapon
 
cs_get_weapon_id ( index )
What is the index?
When a palyer have this weapon : new hid = cs_get_weapon_id ( index )
When this weapon has droped on ground : new gid = cs_get_weapon_id ( index )
When this has pick up by other palyer: new pid = cs_get_weapon_id ( index )

I need:
hid == gid == pid

I'm sorry for my bad English .

Devil259 01-17-2012 06:37

Re: How to get the unique ID of weapon
 
Quote:

Notes:

index is the entity index of the weapon

wwzw 01-17-2012 07:05

Re: How to get the unique ID of weapon
 
But it still can not achieve my goal.
Or:
When I pick up a weapon, how can I know who is falling for this weapon?

wwzw 01-17-2012 07:52

Re: How to get the unique ID of weapon
 
Like:
new oid;
pev(ent, pev_owner, oid);
But it is error .
Please help me .

Devil259 01-17-2012 11:28

Re: How to get the unique ID of weapon
 
To detect weapon pickup, hook Ham_Touch on pre with "armoury_entity" and "weaponbox" entities.


All times are GMT -4. The time now is 00:21.

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