Raised This Month: $ Target: $400
 0% 

Weapon ammo HELP


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DIREKTOR
Senior Member
Join Date: Jan 2010
Location: On server
Old 05-18-2010 , 13:52   Weapon ammo HELP
Reply With Quote #1

Hi i need help i know i can give weapons by this command
PHP Code:
give_item(players[i], "weapon_scout"
but can you help me and showme how to make that it gives 0 ammo in clip and backpak 0 BUT i Dont wanna plugin because i wanna include this in my plug
__________________
Quote:
Originally Posted by KadiR View Post
Learn the fucking server rules you idiot.
DIREKTOR is offline
Send a message via MSN to DIREKTOR
JaGareN
Senior Member
Join Date: Mar 2009
Old 05-18-2010 , 14:10   Re: Weapon ammo HELP
Reply With Quote #2

http://www.amxmodx.org/funcwiki.php?go=func&id=208

http://www.amxmodx.org/funcwiki.php?go=func&id=186
JaGareN is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 05-18-2010 , 14:13   Re: Weapon ammo HELP
Reply With Quote #3

PHP Code:
#include <cstrike>

new wpn give_item(players[i], "weapon_scout")

cs_set_weapon_ammo(wpn0)
cs_set_user_bpammo(players[i], "weapon_scout",  0
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.

Last edited by drekes; 05-18-2010 at 15:18.
drekes is offline
Send a message via MSN to drekes
DIREKTOR
Senior Member
Join Date: Jan 2010
Location: On server
Old 05-18-2010 , 14:43   Re: Weapon ammo HELP
Reply With Quote #4

but i cant compile plugin now ERRORS:
/groups/amxmodx/tmp3/textSYICoN.sma(739) : error 017: undefined symbol "set_weapon_ammo"
/groups/amxmodx/tmp3/textSYICoN.sma(740) : error 017: undefined symbol "set_user_bpammo"
__________________
Quote:
Originally Posted by KadiR View Post
Learn the fucking server rules you idiot.
DIREKTOR is offline
Send a message via MSN to DIREKTOR
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 05-18-2010 , 15:19   Re: Weapon ammo HELP
Reply With Quote #5

Quote:
Originally Posted by DIREKTOR View Post
but i cant compile plugin now ERRORS:
/groups/amxmodx/tmp3/textSYICoN.sma(739) : error 017: undefined symbol "set_weapon_ammo"
/groups/amxmodx/tmp3/textSYICoN.sma(740) : error 017: undefined symbol "set_user_bpammo"
Fixed
Wasen't paying attention.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
Hx7r
Member
Join Date: Mar 2009
Old 05-18-2010 , 14:51   Re: Weapon ammo HELP
Reply With Quote #6

cs_set_*
Hx7r is offline
SaM.ThE.MaN
Senior Member
Join Date: Jan 2010
Old 05-18-2010 , 15:52   Re: Weapon ammo HELP
Reply With Quote #7

lol -.-
SaM.ThE.MaN is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 05-18-2010 , 16:07   Re: Weapon ammo HELP
Reply With Quote #8

Quote:
Originally Posted by SaM.ThE.MaN View Post
lol -.-
What a useless post.

@OP - You don't need to create a variable if that's all you're doing with the entity. You can simply do
Code:
cs_set_weapon_ammo( give_item( id, "weapon_scout" ), 0 )
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-19-2010 , 11:34   Re: Weapon ammo HELP
Reply With Quote #9

Quote:
Originally Posted by wrecked_ View Post
@OP - You don't need to create a variable if that's all you're doing with the entity. You can simply do
Code:
cs_set_weapon_ammo( give_item( id, "weapon_scout" ), 0 )
You are wrong.
You need to create a variable, and check if it's not null before you send cs_set_weapon_ammo.

Code:
new wpn = give_item(id, "weapon_scout") if( wpn > 0 ) {  cs_set_weapon_ammo(wpn, 0) } cs_set_user_bpammo(id, CSW_SCOUT,  0)
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 05-19-2010 , 15:30   Re: Weapon ammo HELP
Reply With Quote #10

Quote:
Originally Posted by ConnorMcLeod View Post
You are wrong.
You need to create a variable, and check if it's not null before you send cs_set_weapon_ammo.

Code:
new wpn = give_item(id, "weapon_scout") if( wpn > 0 ) {  cs_set_weapon_ammo(wpn, 0) } cs_set_user_bpammo(id, CSW_SCOUT,  0)
How would it return as null? I've never had a run-time error in my plugins where I use the method demonstrated above. The only circumstances under which I see this happening is if the player isn't connected/valid or if there's some Item_CanDeploy issues. Chances are, he'll be using the connected check in that function somewhere, so he won't have to worry about that.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ 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 03:34.


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