Raised This Month: $ Target: $400
 0% 

Adding bpammo for each weapon differently


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Fawkes37
Senior Member
Join Date: Jul 2008
Old 08-21-2008 , 07:08   Adding bpammo for each weapon differently
Reply With Quote #1

hello

in the beginning i would say im a newb and havent even learned Pawn or any other codings because im more into mapping and other stuff, but i need this plugin to get done for my server.
ok, im using biohazard and a plugin which would set different bpammo for every weapon would be very nice. so i searched, found some code and tried to do something of my own. but failed misrably.

1) when compiling it says
error 088: number of arguement does not match definition (line 15)
2) heck, i dont even know if it would work.

so thats why i would ask your help again. here's my code (im just trying to set deagle's bpammo at first, and then adding all the others if it works):

Code:
#include <amxmodx>
#include <cstrike>
#include <engine>
public plugin_init()
{
 register_plugin("Bio_bpammo", "0.1", "fawk3s");
 register_event("CurWeapon", "event_currentweapon", "be", "1=1");
}
public event_currentweapon(id)
{
 if(get_user_weapon(id) == CSW_DEAGLE)
 {
  cs_set_user_bpammo(id, 200);
 }
}

Last edited by Fawkes37; 08-21-2008 at 07:11.
Fawkes37 is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 08-21-2008 , 07:26   Re: Adding bpammo for each weapon differently
Reply With Quote #2

to call a function, you need to follow the prototype
cs_set_user_bpammo ( index, weapon, amount )
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
Fawkes37
Senior Member
Join Date: Jul 2008
Old 08-21-2008 , 07:39   Re: Adding bpammo for each weapon differently
Reply With Quote #3

Quote:
Originally Posted by jim_yang View Post
to call a function, you need to follow the prototype
cs_set_user_bpammo ( index, weapon, amount )
ok i made it
cs_set_user_bpammo (id, CSW_DEAGLE, 200) //was that what i was supposed to do?

since it compiled now, is there a chance it will work or there isnt a point in trying ?

sorry for my noobish coding, thanks in advance

Last edited by Fawkes37; 08-21-2008 at 07:41.
Fawkes37 is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 08-21-2008 , 07:41   Re: Adding bpammo for each weapon differently
Reply With Quote #4

weapon should be the weaponid stuff begin CSW_
cs_set_user_bpammo(id, CSW_AK47, 90)
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
Fawkes37
Senior Member
Join Date: Jul 2008
Old 08-21-2008 , 07:43   Re: Adding bpammo for each weapon differently
Reply With Quote #5

Quote:
Originally Posted by jim_yang View Post
weapon should be the weaponid stuff begin CSW_
cs_set_user_bpammo(id, CSW_AK47, 90)
heh seems like i edited too late
my idiotic brain figured it out
so would it work or there isnt a point in trying ?

thx in advance

EDIT: is there a difference between

Code:
public event_currentweapon(id)
{
 if(get_user_weapon(id) == CSW_DEAGLE)
 {
  cs_set_user_bpammo(id, CSW_DEAGLE, 200);
 }
}
and

Code:
public event_currentweapon(id)
{
 cs_set_user_bpammo(id, CSW_DEAGLE, 200);
}

Last edited by Fawkes37; 08-21-2008 at 07:50.
Fawkes37 is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 08-21-2008 , 07:54   Re: Adding bpammo for each weapon differently
Reply With Quote #6

you don't need to check the current weapon to set its bpammo
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
Fawkes37
Senior Member
Join Date: Jul 2008
Old 08-21-2008 , 08:56   Re: Adding bpammo for each weapon differently
Reply With Quote #7

Quote:
Originally Posted by jim_yang View Post
you don't need to check the current weapon to set its bpammo
well now i tried, it sets the ammo, but it doesnt do what i want it to do:
whenever i reload, the ammo needed to reload has to go off the bpammo.
but this plugin sets it to whatever i want to and keeps it that way. how to fix it?
Fawkes37 is offline
Reply


Thread Tools
Display Modes

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 03:13.


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