Raised This Month: $ Target: $400
 0% 

[REQ] Command Help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ax3l
Member
Join Date: Nov 2009
Old 08-11-2012 , 16:22   [REQ] Command Help
Reply With Quote #1

Hy guys , i need some stuff , so ... if you can help me , please

Code:
public plugin_init( )
{
       register_clcmd( "say /Weapon" , "CmdWeapon" );
}

public CmdWeapon( iPlayer )
{
	fm_give_item( iPlayer , "weapon_m4a1" );
	fm_give_item( iPlayer , "ammo_556nato" , 3 );
	
	return PLUGIN_HANDLED;
}
I want :
1 : When i type /Weapon , that m4a1 must have duble damage ( 2x )
2 : Infinite bullets ( no ammo )

Thx .
__________________
Ax3l is offline
Torge
Veteran Member
Join Date: Oct 2011
Old 08-11-2012 , 16:51   Re: [REQ] Command Help
Reply With Quote #2

Try it, it's for double damage:

PHP Code:
#include <amxmodx>
#include <hamsandwich>

new cvar_dmg;

public 
plugin_init()
{
         
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage");

         
cvar_dmg register_cvar("zp_dmg""2");
}

public 
fw_TakeDamage(victiminflictorattackerFloat:damage)
{
        if (
get_user_weapon(attacker) == CSW_M4A1)
        {
            
SetHamParamFloat(4damage get_pcvar_float(cvar_dmg))
        }


Last edited by Torge; 08-11-2012 at 16:52.
Torge is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-11-2012 , 17:04   Re: [REQ] Command Help
Reply With Quote #3

Also, don't use fm_ functions when you can do the same with a more direct module. Aka, use give_item() from the fun module.
__________________
fysiks is offline
Ax3l
Member
Join Date: Nov 2009
Old 08-11-2012 , 17:31   Re: [REQ] Command Help
Reply With Quote #4

Better with give_item then fm_give_item ?
Thx

(i don't know what module si better , i'm sorry)
__________________
Ax3l is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-11-2012 , 17:39   Re: [REQ] Command Help
Reply With Quote #5

Quote:
Originally Posted by Ax3l View Post
Better with give_item then fm_give_item ?
Yes.
__________________
fysiks is offline
Ax3l
Member
Join Date: Nov 2009
Old 08-12-2012 , 07:32   Re: [REQ] Command Help
Reply With Quote #6

So ... about what i asked ... anyone ?
__________________
Ax3l is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-12-2012 , 17:58   Re: [REQ] Command Help
Reply With Quote #7

Search for infinite ammo. It already exists somewhere.

Regarding the code you posted, are you asking for scripting help or are you asking for someone to write a plugin for you?
__________________
fysiks 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 22:10.


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