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

Weapon Chance by Exolent


Post New Thread Reply   
 
Thread Tools Display Modes
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-06-2008 , 15:31   Re: Weapon Chance
Reply With Quote #11

Updated to v1.2!

Whats new?

Code:
Weapon Names:
-------------------
shield



Cvars:
-------------------
wc_<weapon>_team	<0|1|2>
-- team that the weapon should be give to
-- 0=EVERYONE
-- 1=TERRORIST
-- 2=COUNTER-TERRORIST
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-06-2008 , 16:42   Re: Weapon Chance
Reply With Quote #12

PHP Code:
#define PRIMARY_WEAPONS_BITSUM    ((1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90))
#define is_primary_weapon(%1)        (PRIMARY_WEAPONS_BITSUM & (1<<%1)) 
;)
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-06-2008 , 18:53   Re: Weapon Chance
Reply With Quote #13

It wasn't for primary as much as it was meant for "can it be used with shield"
But thanks for that idea, I'll use it.


EDIT: Updated to v1.3!

What's new?

Code:
Used better primary weapon detection for shield usage
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!

Last edited by Exolent[jNr]; 07-06-2008 at 19:03.
Exolent[jNr] is offline
Old 07-06-2008, 19:00
Exolent[jNr]
This message has been deleted by Exolent[jNr].
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-07-2008 , 00:19   Re: Weapon Chance
Reply With Quote #14

Code:
cs_set_weapon_ammo(ent, ammo) {     return set_pdata_int(ent, OFFSET_CLIPAMMO, ammo, __get_linux_offset()); }

I think it's better to replace __get_linux_offset() with 4. (or #define EXTRA_OFFSET_ENTITY 4 and ...)
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-07-2008 , 00:33   Re: Weapon Chance
Reply With Quote #15

Could you explain why? I'd like to know what I'm doing
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-07-2008 , 01:53   Re: Weapon Chance
Reply With Quote #16

Well, last parameter of s/get_pdata_XXX will be auto set to the value you wrote if the server is linux or to 0 if the os is windows.
By default, the native set the parameter to 5 as it's the difference for players.

Quote:
Originally Posted by http://www.amxmodx.org/funcwiki.php?search=set_pdata_int&go=search
If the server is running linux, the linuxdiff parameter is added to the offset.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-11-2008 , 14:59   Re: Weapon Chance
Reply With Quote #17

Updated to v1.4!

Whats new?

Code:
Cvars:
-------------------
wc_announce		<0|1>
-- announce to everyone when a player receives a weapon
-- 0=DONT ANNOUNCE
-- 1=ANNOUNCE
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-11-2008 , 15:04   Re: Weapon Chance
Reply With Quote #18

May be you could use macros for this :

PHP Code:
cs_set_weapon_ammo(entammo)
{
    return 
set_pdata_int(entOFFSET_CLIPAMMOammo4);

PHP Code:
#define cs_set_weapon_ammo(%1,%2) set_pdata_int(%1, OFFSET_CLIPAMMO, %2, 4) 
??


Same for cs_set_user_bpammo(plr, weapon, ammo)
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-11-2008 , 15:55   Re: Weapon Chance
Reply With Quote #19

I tried, but it gave me errors saying that the functions didn't exist.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-11-2008 , 16:24   Re: Weapon Chance
Reply With Quote #20

May be because you put some spaces in cs_set_weapon_ammo(%1,%2), macros don't allow it, please don't ask me why
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 16:52.


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