AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   get weapon max clip size and set cur weap ammo (https://forums.alliedmods.net/showthread.php?t=116913)

Owyn 01-27-2010 10:50

get weapon max clip size and set cur weap ammo
 
hi, i've been wondering if it possible to get users current weapon maxclip size? maybe with an offset?

Exolent[jNr] 01-27-2010 11:58

Re: get weapon max clip size and set cur weap ammo
 
http://forums.alliedmods.net/showthread.php?t=82093
Code:
getMaxClipAmmo(iWeaponID) {     if( !(0 <= iWeaponID <= CSW_P90) ) {         return -1;     }     stock const g_iDftMaxClip[CSW_P90+1] = {         -1,  13, -1, 10,  1,  7,    1, 30, 30,  1,  30,         20, 25, 30, 35, 25,   12, 20, 10, 30, 100,         8 , 30, 30, 20,  2,    7, 30, 30, -1,  50     };     return g_iDftMaxClip[iWeaponID]; }
If you are running that plugin then you would need something different.

Owyn 01-27-2010 12:04

Re: get weapon max clip size and set cur weap ammo
 
this is simular to my function giving hardcoded values depending on provided weaponid. i ment something really getting maxclip from the game, or would it be just a waste?

Exolent[jNr] 01-27-2010 12:08

Re: get weapon max clip size and set cur weap ammo
 
http://wiki.amxmodx.org/CBasePlayerAmmo_(CS)
http://wiki.amxmodx.org/CBasePlayerItem_(CS)
http://wiki.amxmodx.org/CBasePlayerWeapon_(CS)
http://wiki.amxmodx.org/CWeaponBox_(CS)

Have a look and see if you find any.

Owyn 01-27-2010 12:23

Re: get weapon max clip size and set cur weap ammo
 
m_iDefaultAmmo ?

Exolent[jNr] 01-27-2010 12:25

Re: get weapon max clip size and set cur weap ammo
 
Code:

m_iDefaultAmmo          56          60          +4          int          How much ammo you get when you pick up this weapon as placed by a level designer.
That isn't what you want.

Owyn 01-27-2010 12:27

Re: get weapon max clip size and set cur weap ammo
 
don't we get as much ammo when we pick something as we have maximum per clip?

Arkshine 01-27-2010 12:46

Re: get weapon max clip size and set cur weap ammo
 
There is no offset found yet, but with orpheu you could get the value easily.


All times are GMT -4. The time now is 07:22.

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