Raised This Month: $ Target: $400
 0% 

need MP5 added to plugin on start


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
drumzplaya13
Senior Member
Join Date: Feb 2008
Location: TEXAS
Old 11-02-2009 , 01:27   need MP5 added to plugin on start
Reply With Quote #1

* Could someone add something to this plugin, where it would give an MP5 with full ammo to all players on every round, if there be one person in the server or a lot, thinking of it being on a death match server.


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

public plugin_init()
{
    
register_plugin("hello""1.0""Stewie!");
    
RegisterHam(Ham_Spawn"player""player_spawn"1);
}

public 
player_spawn(id)
{
    if(
is_user_alive(id))
    {
        
strip_user_weapons(id);
    }

__________________
Think Positive - Stay Positive

Last edited by drumzplaya13; 11-03-2009 at 12:15.
drumzplaya13 is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 11-02-2009 , 02:06   Re: no knife
Reply With Quote #2

Quote:
Originally Posted by drumzplaya13 View Post
is there a way i can use one of these strings to create a plugin which doesnt allow a player to have a knife? I am new with coding period so this would get me a good start to it i guess. thanks.

ham_strip_weapon or fm_strip_user_gun are the commands i found, not sure which one would be more suited or which one is more out of date.

and I actually am looking for the plugin which doesnt have a knife, not just replacing the models. I dont want anyone to be able to access or start out with a knife at all.
PHP Code:

RegisterHam
(Ham_SpawnplayerPlayerSpawn)

public 
PlayerSpawn(id)
{
       if(
is_user_alive(id) && is_user_connected(id)
       {
             
ham_strip_weapon(id"weapon_knife")
        }

Doc-Holiday is offline
zwfgdlc
Senior Member
Join Date: May 2006
Old 11-02-2009 , 02:11   Re: no knife
Reply With Quote #3

try this.
PHP Code:
/* Returns 1 if no knives mode is enabled, else 0.
 */
native cs_get_no_knives();

/* Enabled no knives mode by calling this with value 1. Disabled with 0.
 * No knives mode means that player will not be given a knife when spawning.
 * You can still give knives (ie through fun's give_item).
 */
native cs_set_no_knives(noknives 0); 
zwfgdlc is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 11-02-2009 , 03:23   Re: no knife
Reply With Quote #4

Quote:
Originally Posted by zwfgdlc View Post
try this.
PHP Code:
/* Returns 1 if no knives mode is enabled, else 0.
 */
native cs_get_no_knives();

/* Enabled no knives mode by calling this with value 1. Disabled with 0.
 * No knives mode means that player will not be given a knife when spawning.
 * You can still give knives (ie through fun's give_item).
 */
native cs_set_no_knives(noknives 0); 

yeah just saw that...

if that dont work just strip it.

like on plugin start or map start
cs_set_no_knives(1)
i believe thats how its done
Doc-Holiday is offline
drumzplaya13
Senior Member
Join Date: Feb 2008
Location: TEXAS
Old 11-02-2009 , 13:57   Re: no knife
Reply With Quote #5

can someone make an actual plugin out of what you put. I dont know how to make it, like what to include.
__________________
Think Positive - Stay Positive
drumzplaya13 is offline
lazarev
Veteran Member
Join Date: Sep 2008
Old 11-02-2009 , 15:14   Re: no knife
Reply With Quote #6

try this:
PHP Code:
#include < amxmodx >
#include < engine >
#include < fakemeta >
#include < hamsandwich >

const m_pPlayer 41;
const 
m_flNextPrimaryAttack 46;
const 
m_flNextSecondaryAttack 47;
const 
LINUX_OFFSET_WEAPONS 4;

public 
plugin_init() {
    
register_plugin"No knife""1.0""Juice" );

    
RegisterHamHam_Item_Deploy"weapon_knife""FwdKnifeDeployPost");
}

// Credits to: Jon & Exolent[jNr]
public FwdKnifeDeployPostiEnt ) {
    new 
iClient get_pdata_cbaseiEntm_pPlayer );
    
entity_set_stringiClientEV_SZ_viewmodel"" );
    
entity_set_stringiClientEV_SZ_weaponmodel"" );
    
set_pdata_floatiEntm_flNextPrimaryAttack9999.0LINUX_OFFSET_WEAPONS );
    
set_pdata_floatiEntm_flNextSecondaryAttack9999.0LINUX_OFFSET_WEAPONS );

tested, you have a knife as item, but you can't attack and you haven't got knife model
lazarev is offline
drumzplaya13
Senior Member
Join Date: Feb 2008
Location: TEXAS
Old 11-02-2009 , 15:35   Re: no knife
Reply With Quote #7

Is there anyway you can do it where they cant even choose the knife, not that it just doesnt have the model but it makes them stay with only the primary guns... i dont want them to be able to switch to any knife or anything else just primary weapons and thats it. so i figured without having a knife or being able to choose it, i would use the plugin which your able to specify what gun everyone gets on start of round or on joining of server.
__________________
Think Positive - Stay Positive
drumzplaya13 is offline
Jon
Veteran Member
Join Date: Dec 2007
Old 11-02-2009 , 16:26   Re: no knife
Reply With Quote #8

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

public plugin_init( )
{
    
cs_set_no_knives)

Jon is offline
drumzplaya13
Senior Member
Join Date: Feb 2008
Location: TEXAS
Old 11-03-2009 , 01:27   Re: no knife
Reply With Quote #9

Quote:
Originally Posted by Jon View Post
PHP Code:
#include <amxmodx>
#include <cstrike>

public plugin_init( )
{
    
cs_set_no_knives)

That works great thanks Jon.

Could someone add something to this plugin, where it would give an MP5 with full ammo to all players on every round, if there be one person in the server or a lot, thinking of it being on a death match server.

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

public plugin_init()
{
    
register_plugin("hello""1.0""Stewie!");
    
RegisterHam(Ham_Spawn"player""player_spawn"1);
}

public 
player_spawn(id)
{
    if(
is_user_alive(id))
    {
        
strip_user_weapons(id);
    }

__________________
Think Positive - Stay Positive

Last edited by drumzplaya13; 11-03-2009 at 12:07.
drumzplaya13 is offline
izzle
Senior Member
Join Date: Aug 2009
Old 11-04-2009 , 13:05   Re: need MP5 added to plugin on start
Reply With Quote #10

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

public plugin_init()
{
    
register_plugin("hello""1.0""Stewie!");
    
RegisterHam(Ham_Spawn"player""player_spawn"1);
}

public 
player_spawn(id)
{
    if(
is_user_alive(id))
    {
        
strip_user_weapons(id);
    
give_item(id,"weapon_mp5navy")
    
give_item(id,"ammo_9mm"
    
give_item(id,"ammo_9mm"
    
give_item(id,"ammo_9mm"
    
give_item(id,"ammo_9mm"
    }

izzle is offline
Reply


Thread Tools
Display Modes

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:42.


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