AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] the name of a weaponbox? (https://forums.alliedmods.net/showthread.php?t=168850)

keyblade 10-04-2011 23:32

[HELP] the name of a weaponbox?
 
for example:
i dropped a m4,so it is on the ground now(it's a weaponbox entity)
does the weaponbox has the name about m4?(like CSW_M4A1,weapon_m4a1,models/w_m4a1.mdl...)
if so, how can i get the name?

and how can i get the clip ammo in it?

thank you for your help

jim_yang 10-05-2011 01:14

Re: [HELP] the name of a weaponbox?
 
http://wiki.alliedmods.net/CWeaponBox_(CS)
http://forums.alliedmods.net/showthread.php?p=761924
You can always get your answers by searching

keyblade 10-05-2011 22:00

Re: [HELP] the name of a weaponbox?
 
Quote:

Originally Posted by jim_yang (Post 1568665)

i found this in it:
PHP Code:

WeaponBox_PackAmmo(iWeaponBoxiAmmoIdiCount)
{
 new 
iMaxCarry g_iMaxAmmo[iAmmoId]
 if( 
iCount iMaxCarry )
 {
  
iCount iMaxCarry
 
}
 
set_pdata_int(iWeaponBoxm_rgiszAmmo_Slot0g_iszAmmoNames[iAmmoId], XTRA_OFS_WEAPONBOX)    //set the weaponbox ammo type?
 
set_pdata_int(iWeaponBoxm_rgAmmo_Slot0iCountXTRA_OFS_WEAPONBOX)    //set the weaponbox ammo number?


but when i tried this:
PHP Code:

register_forward(FM_Touch"Touch_Func")
 
public 
Touch_Func(entpid)
    ...
    new 
ammotype get_pdata_int(ent414//ent is a weaponbox index
    
new ammonum get_pdata_int(ent734)
    
client_print(pidprint_chat"yoooooooooo  %d %d"ammotypeammonum//pid is a player index 

and when i touched a weaponbox in the game,it often prints "yoooooooooo 0 0" to me

where is wrong?

ConnorMcLeod 10-06-2011 01:13

Re: [HELP] the name of a weaponbox?
 
All code you need is here, you have ti understand it first and then you can try to convert it to pawn (it's already made for some parts in my plugin) :

http://svn.alliedmods.net/viewvc.cgi...dx&view=markup
( weaponbox code is at the end of the page )

keyblade 10-06-2011 09:42

Re: [HELP] the name of a weaponbox?
 
Quote:

Originally Posted by ConnorMcLeod (Post 1569251)
All code you need is here, you have ti understand it first and then you can try to convert it to pawn (it's already made for some parts in my plugin) :

http://svn.alliedmods.net/viewvc.cgi...dx&view=markup
( weaponbox code is at the end of the page )

thank you.i will learn it...


All times are GMT -4. The time now is 19:41.

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