Raised This Month: $ Target: $400
 0% 

Need Help with Menu and get_user_ammo


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Silencer123
Veteran Member
Join Date: Jul 2006
Old 07-15-2006 , 17:41   Need Help with Menu and get_user_ammo
Reply With Quote #1

Question 1:
How do I make a second Menu Column?
Like this:
Code:
1.  Option 1          $100
2.  Option 2          $150
3.  Option 3          $300
Using this:
Code:
format(menuBody, 511, "Buy Ammo - Your Money: $%i^n^n 1.  Six 357 Rounds^n 2.  Twelve Shotgun Buckshots^n 3.  Five Sniper Rifle Bullets^n 4.  Five Crossbow Arrows^n 5.  20 Energy Cells^n 6.  Two RPG Rockets^n 7.  Two AR Grenades^n 8.  17 9mm Bullets^n 9.  100 Minigun Rounds^n^n 0.  Close",g_money[id])


Question 2:
How do I use get_user_ammo correctly? What to "#include"?
Code:
if(get_user_ammo(id, 3, 0, 36)
On compile it says that the 3rd argument is a mismatch
and how can I know what weapon has the ID "3"?
Is there a list?




Thanks in advance! I also will give Karma!
This are the last two problems on my way to the working plugin!
__________________
EAT YOUR VEGGIES
Silencer123 is offline
Shurik3n
Member
Join Date: Feb 2006
Old 07-15-2006 , 17:50   Re: Need Help with Menu and get_user_ammo
Reply With Quote #2

Ok well just add the prices to your format
Code:
format(menuBody, 511, "Buy Ammo - Your Money: $%i^n^n 1.  Six 357 Rounds $100^n 2.  Twelve Shotgun Buckshots $150...
__________________
+Karma if I helped.
Shurik3n is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 07-15-2006 , 19:13   Re: Need Help with Menu and get_user_ammo
Reply With Quote #3

Quote:
How do I make a second Menu Column?
Like this
Use "\R" control caracter in front of the clumn's text, example: "\RThis is a righ-aligned menu text"

Quote:
How do I use get_user_ammo correctly?
Here is an example of how to get USP's clip and ammo with a client command "test", no additional includes required:

Code:
#include <amxmodx>   public plugin_init() {    register_clcmd("test", "func") }   public func(id) {    new clip, ammo    get_user_ammo(id, CSW_USP, clip, ammo)    server_print("Clip: %d, Ammo: %d", clip, ammo)      return PLUGIN_HANDLED }
Quote:
and how can I know what weapon has the ID "3"?
Is there a list?
Yes, here: http://www.amxmodx.org/funcwiki.php?...d=4#const_cswp

Quote:
how I make the Plugin wait for a specific time, then do something
Use set_task: http://www.amxmodx.org/funcwiki.php?...task&go=search

Last edited by VEN; 07-15-2006 at 19:21.
VEN is offline
Silencer123
Veteran Member
Join Date: Jul 2006
Old 07-15-2006 , 18:57   Re: Need Help with Menu and get_user_ammo
Reply With Quote #4

That is an option, but it does not look that ordinary...
:p

And as this makes me megalomaniacal, I want to know how I make the Plugin wait for a specific time, then do something. I got the idea to send a Message to a player, 60 Seconds after this Player connected.
__________________
EAT YOUR VEGGIES
Silencer123 is offline
Silencer123
Veteran Member
Join Date: Jul 2006
Old 07-15-2006 , 19:40   Re: Need Help with Menu and get_user_ammo
Reply With Quote #5

so i have
1. 357 Ammo\R123$^n2. Sniper Ammo\R321$^n
and so on?


well, the list is for counter strike, not for sven cooperative, thanks anyways, if I ever script for cs ^^

and set_task does not look like i need to ask something :p
__________________
EAT YOUR VEGGIES

Last edited by Silencer123; 07-16-2006 at 10:39.
Silencer123 is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 07-15-2006 , 20:20   Re: Need Help with Menu and get_user_ammo
Reply With Quote #6

Well, "\R" probably will not work for SvenCoop.
VEN is offline
Silencer123
Veteran Member
Join Date: Jul 2006
Old 07-16-2006 , 10:40   Re: Need Help with Menu and get_user_ammo
Reply With Quote #7

I actually asked if \R works in the way I posted it:
1. 357 Ammo\R123$^n2. Sniper Ammo\R321$^n
and so on

and if i write:
Code:
new 357_clips, 357_rnds
get_user_ammo(id, 3, 357_clips, 357_rnds)
IT says this:
error 020: invalid symbol name ""
error 029: invalid expression, assumed zero
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
and those all go for the first line in mentioned code

EDIT: Fixed the kind of senceless bug: symbol must not start with a number -.-
changed 357_clips to a357_clips and 357_rnds to a357_rnds

EDIT: get_user_ammo(id, 3, a357_clips, a357_rnds)
does a357_rnds include the ammo in the current clip?
weapon_357 has 6 rounds per clip and you can carry 6 clips with the clip
in the weapon. so if my hud says (6|36), will a357_rnds be 36, or 42 (6 + 36)?
__________________
EAT YOUR VEGGIES

Last edited by Silencer123; 07-16-2006 at 15:29.
Silencer123 is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 07-16-2006 , 15:50   Re: Need Help with Menu and get_user_ammo
Reply With Quote #8

Quote:
how can I know what weapon has the ID "3"?
Here is an example:
Code:
new wid = 3 new weapon[32] get_weaponname(wid, weapon, 31) server_print("WeaponID is ^"%d^", WeaponName is ^"%s^"", wid, weapon)


Quote:
so i have
1. 357 Ammo\R123$^n2. Sniper Ammo\R321$^n
and so on?
Yes.

Quote:
does a357_rnds include the ammo in the current clip?
No.

Quote:
will a357_rnds be 36
Yes, it should be 36.

Last edited by VEN; 07-16-2006 at 15:53.
VEN is offline
Silencer123
Veteran Member
Join Date: Jul 2006
Old 07-16-2006 , 18:03   Re: Need Help with Menu and get_user_ammo
Reply With Quote #9

Thanks! I built a little script and got all IDs!
For who ever else needs this:


SC Sven Coop Sven Cooperative Weapon Constants Weapons Constants ID IDs
(Some similar repeating so you can find this with search)

WeaponID is 1, WeaponName is weapon_crowbar
WeaponID is 2, WeaponName is weapon_9mmhandgun
WeaponID is 3, WeaponName is weapon_357
WeaponID is 4, WeaponName is weapon_9mmAR
WeaponID is 5, WeaponName is
WeaponID is 6, WeaponName is weapon_crossbow
WeaponID is 7, WeaponName is weapon_shotgun
WeaponID is 8, WeaponName is weapon_rpg
WeaponID is 9, WeaponName is weapon_gauss
WeaponID is 10, WeaponName is weapon_egon
WeaponID is 11, WeaponName is weapon_hornetgun
WeaponID is 12, WeaponName is weapon_handgrenade
WeaponID is 13, WeaponName is weapon_tripmine
WeaponID is 14, WeaponName is weapon_satchel
WeaponID is 15, WeaponName is weapon_snark
WeaponID is 16, WeaponName is weapon_uziakimbo
WeaponID is 17, WeaponName is weapon_uzi
WeaponID is 18, WeaponName is weapon_medkit
WeaponID is 19, WeaponName is
WeaponID is 20, WeaponName is weapon_pipewrench
WeaponID is 21, WeaponName is weapon_minigun
WeaponID is 22, WeaponName is weapon_grapple
WeaponID is 23, WeaponName is weapon_sniperrifle
WeaponID is 24, WeaponName is
WeaponID is 25, WeaponName is
WeaponID is 26, WeaponName is
WeaponID is 27, WeaponName is
WeaponID is 28, WeaponName is
WeaponID is 29, WeaponName is
WeaponID is 30, WeaponName is

An ID where no weapon is shown does not have a weapon assigned (Do not use these IDs)


One Problem remains:
\R does not work. In the Menu I can read \R, it does not TAB or something.
Sven Cooperatives fault? Any other way?


EDIT: One weapon uses two ammo types, how can i get the amount of the second ammo type? (ammo_ARgrenades)
I tried to use ID 5 as a weapon ID, because it is right after weapon_9mmAR, but it is the same.


and a 3rd problem! client_spawn does not work:


Code:
 
public client_spawn(id)
{
 player_kits[id] = g_kits
 client_print(id,print_chat,"[SC STUFF PLUGIN] You spawned with %i Healthkits in your Backpack!",g_kits)
 return PLUGIN_HANDLED
}
EDIT: Just seeing that client_spawn is for ns
but what to use then?
__________________
EAT YOUR VEGGIES

Last edited by Silencer123; 07-17-2006 at 18:16.
Silencer123 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 08:04.


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