Raised This Month: $ Target: $400
 0% 

Spawning weapons with no ammo


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TheeDeer
Junior Member
Join Date: Dec 2016
Old 03-18-2017 , 20:48   Spawning weapons with no ammo
Reply With Quote #1

Hello, I am i need of a little help. I am trying to spawn a Deagle at the feet of a player but that Deagle can not have any ammo, and if possible be named "Toy gun"
TheeDeer is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 03-19-2017 , 05:44   Re: Spawning weapons with no ammo
Reply With Quote #2

With 'at the feet of a player' you mean in the drop position ? And what naming are you talking about ?
Code:
#include < amxmodx > #include < cstrike > #include < fun > #include < hamsandwich > public plugin_init( ) {     register_plugin( "Toy Guns", "1.0", "DoNii" ) ;         RegisterHam( Ham_Spawn, "player", "fw_HamSpawnPost", 1 ) ; } public fw_HamSpawnPost( id ) {     if( is_user_alive( id ) ) {             give_item( id, "weapon_deagle" ) ;         cs_set_user_bpammo( id, CSW_DEAGLE, 0 ) ;         engclient_cmd( id, "drop weapon_deagle" ) ;     } }
__________________

Last edited by edon1337; 03-19-2017 at 14:46.
edon1337 is offline
Old 03-19-2017, 10:49
killerZM
This message has been deleted by killerZM. Reason: Bye haters
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-19-2017 , 10:51   Re: Spawning weapons with no ammo
Reply With Quote #4

@killerZM - What if he isn't holding the deagle?
@edon1337 - Use engclient_cmd.
__________________

Last edited by OciXCrom; 03-19-2017 at 10:51.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 03-19-2017 , 11:47   Re: Spawning weapons with no ammo
Reply With Quote #5

Even if he is not holding deagle, weapon will be dropped if the player has it.
__________________
HamletEagle is offline
Old 03-19-2017, 12:17
killerZM
This message has been deleted by killerZM. Reason: Bye haters :v
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 03-19-2017 , 12:42   Re: Spawning weapons with no ammo
Reply With Quote #7

Quote:
Originally Posted by killerZM View Post
drop is used to drop current weapon if it drop able
Please don't talk no sense, what if player changes the weapon at that moment? It will drop another weapon.
__________________

Last edited by edon1337; 03-19-2017 at 12:45.
edon1337 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 03-19-2017 , 12:57   Re: Spawning weapons with no ammo
Reply With Quote #8

If command is simply "drop", it will drop the active item. If command is "drop weapon_name" it will drop that specific weapon no matter what.
__________________
HamletEagle is offline
killerZM
Senior Member
Join Date: Sep 2016
Old 03-19-2017 , 13:23   Re: Spawning weapons with no ammo
Reply With Quote #9

use create entity for it ? create_entity(weapon_box) better
killerZM is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 03-19-2017 , 13:31   Re: Spawning weapons with no ammo
Reply With Quote #10

Just a question, why giving the deagle and drop it after? Also, is_user_alive() check should be used.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 03-19-2017 at 13:32.
EFFx 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 17:48.


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