AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   [REQ] Command Help (https://forums.alliedmods.net/showthread.php?t=192569)

Ax3l 08-11-2012 16:22

[REQ] Command Help
 
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 .

Torge 08-11-2012 16:51

Re: [REQ] Command Help
 
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))
        }



fysiks 08-11-2012 17:04

Re: [REQ] Command Help
 
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.

Ax3l 08-11-2012 17:31

Re: [REQ] Command Help
 
Better with give_item then fm_give_item ?
Thx

(i don't know what module si better , i'm sorry) :)

fysiks 08-11-2012 17:39

Re: [REQ] Command Help
 
Quote:

Originally Posted by Ax3l (Post 1769495)
Better with give_item then fm_give_item ?

Yes.

Ax3l 08-12-2012 07:32

Re: [REQ] Command Help
 
So ... about what i asked ... anyone :( ?

fysiks 08-12-2012 17:58

Re: [REQ] Command Help
 
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?


All times are GMT -4. The time now is 22:10.

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