AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   need MP5 added to plugin on start (https://forums.alliedmods.net/showthread.php?t=108138)

drumzplaya13 11-02-2009 01:27

need MP5 added to plugin on start
 
* 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);
    }



Doc-Holiday 11-02-2009 02:06

Re: no knife
 
Quote:

Originally Posted by drumzplaya13 (Post 978617)
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")
        }



zwfgdlc 11-02-2009 02:11

Re: no knife
 
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); 


Doc-Holiday 11-02-2009 03:23

Re: no knife
 
Quote:

Originally Posted by zwfgdlc (Post 978629)
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

drumzplaya13 11-02-2009 13:57

Re: no knife
 
can someone make an actual plugin out of what you put. I dont know how to make it, like what to include.

lazarev 11-02-2009 15:14

Re: no knife
 
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

drumzplaya13 11-02-2009 15:35

Re: no knife
 
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.

Jon 11-02-2009 16:26

Re: no knife
 
PHP Code:

#include <amxmodx>
#include <cstrike>

public plugin_init( )
{
    
cs_set_no_knives)



drumzplaya13 11-03-2009 01:27

Re: no knife
 
Quote:

Originally Posted by Jon (Post 979105)
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);
    }



izzle 11-04-2009 13:05

Re: need MP5 added to plugin on start
 
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"
    }




All times are GMT -4. The time now is 17:42.

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