Raised This Month: $ Target: $400
 0% 

JB Shot4Shot


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 01-21-2014 , 12:04   Re: JB Shot4Shot
Reply With Quote #1

Quote:
Originally Posted by hornet View Post
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(PLUGINVERSIONAUTHOR)
    
    
// Add your code here...
}

......
CmdStartGameiPrisoneriGuardiGame )
{
            
// Shot4Shot Duels
        //////////////////
        
case LR_S4S_DEAGLE:
        {
            
fm_give_itemiPrisoner"weapon_deagle" );
            
            
fm_give_itemiGuard"weapon_deagle" );
            
            
cs_set_weapon_ammoiEnt give_itemiPrisoner"weapon_deagle" ), );
            
            
cs_set_weapon_ammoiEnt give_itemiGuard"weapon_deagle" ), );
            
            
set_pdata_floatiEntm_flNextPrimaryAttack9999.0XO_WEAPON );
        }
    }


Last edited by Fuck For Fun; 01-21-2014 at 12:04.
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
Battousai-sama
Veteran Member
Join Date: Jul 2007
Old 01-21-2014 , 23:39   Re: JB Shot4Shot
Reply With Quote #2

PHP Code:
public WeaponChange(id)
{
    new 
weapon read_data(2);
    if( 
is_user_alive(id) && (iGuard==id || iPrisoner==id) && weapon ){
        new 
clip read_data(3);
        if( 
gLRType == LR_PISTOL && weapon == CSW_DEAGLE ){
            if( 
clip ){
                new 
wpn[32], iWPNidx = -1;
                
get_weaponname(weaponwpn31);
                while( (
iWPNidx fm_find_ent_by_class(iWPNidxwpn)) != ){
                    if( 
pev(iWPNidxpev_owner) == id ){
                        
cs_set_weapon_ammo(iWPNidx1);
                    }
                }
            }
            
cs_set_user_bpammo(idweapon1);
        }if( 
gLRType == LR_PISTOL && weapon != CSW_DEAGLE ){
            new 
wpn[32];
            
get_weaponname(weaponwpn31);
            
engclient_cmd(id"drop"wpn);
            
client_cmd(id"weapon_deagle");
        }
    }

something like that?

add it to the s4s pistol fight part
__________________

Last edited by Battousai-sama; 01-21-2014 at 23:43.
Battousai-sama is offline
Send a message via MSN to Battousai-sama
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 10:15.


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