Quote:
Originally Posted by hornet
For starters, you really need to use a better method than CurWeapon to restrict the player's weapons, such as stripping them upon game start.
When you give the player a deagle you can do something like this:
Code:
cs_set_weapon_ammo( give_item( iGuard, "weapon_deagle" ), 1 );
And if you wanted to restrict the Guard from shooting ( and allow the Prisoner to shoot first ), you could extend this to:
Code:
const XO_WEAPON = &n bsp; 4; const m_flNextPrimaryAttack = 46; // new iEnt; cs_set_weapon_ammo( iEnt = give_item( iGuard, "weapon_deagle" ), 1 ); set_pdata_float( iEnt, m_flNextPrimaryAttack, 9999.0, XO_WEAPON );
Also, not sure what's made you want to use FM Utility, but I assure you that it would be more efficient to use the natives from the Fun module. I would only recommend FM Utility for learning purposes.
|
i read your Posts and did everything but still dont working
that give 7 bullet to Prisoner and Guard = but 0 ammo
that code just part from my code..for test
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
new const XO_WEAPON = 4;
new const m_flNextPrimaryAttack = 46;
new iEnt;
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
// Add your code here...
}
......CmdStartGame( iPrisoner, iGuard, iGame )
{
// Shot4Shot Duels
//////////////////
case LR_S4S_DEAGLE:
{
fm_give_item( iPrisoner, "weapon_deagle" );
fm_give_item( iGuard, "weapon_deagle" );
cs_set_weapon_ammo( iEnt = give_item( iPrisoner, "weapon_deagle" ), 1 );
cs_set_weapon_ammo( iEnt = give_item( iGuard, "weapon_deagle" ), 1 );
set_pdata_float( iEnt, m_flNextPrimaryAttack, 9999.0, XO_WEAPON );
}
}
}