Raised This Month: $12 Target: $400
 3% 

Deagle plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tembeluu
Member
Join Date: Jan 2019
Location: London
Old 01-29-2019 , 21:49   Deagle plugin
Reply With Quote #1

Hey, i've been today on one server, and CT, and T they have deagle, ct no usp, t no clock, on any map. i mean the guns are replaced with deagle...for everyone.
tembeluu is offline
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 01-30-2019 , 00:11   Re: Deagle plugin
Reply With Quote #2

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

#define PLUGIN "Spawn Weapons"
#define VERSION "1.0"
#define AUTHOR "nutu"

new bool:HasC4[33]

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
RegisterHam(Ham_Spawn"player""Inceput_runda"1);
}
public 
Inceput_runda(id) {
    if(
is_user_alive(id)) 
    {
        
give_item(id"weapon_knife");
        
WeaponMenu(id);
    }
}

public 
WeaponMenu(id) {
    if(
get_user_team(id) == CS_TEAM_CT
    {
        
strip_user_weapons (id)
        
give_item(id,"weapon_knife");
        
give_item(id"weapon_deagle");
        
cs_set_user_bpammo(idCSW_DEAGLE,35);
    }
    else if (
get_user_team(id) == CS_TEAM_T)
    {
        if (
user_has_weapon(idCSW_C4) && get_user_team(id) == 1)
            
HasC4[id] = true;
        else
            
HasC4[id] = false;
        
strip_user_weapons (id)
        
give_item(id,"weapon_knife");
        
give_item(id"weapon_deagle");
        
cs_set_user_bpammo(idCSW_DEAGLE,35);
        if (
HasC4[id])
        {
            
give_item(id"weapon_c4");
            
cs_set_user_plantid );
        }
    }
}

/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/ 
try, not tested
__________________
a simple act of caring creates an endless ripple.
Nutu_ is offline
tembeluu
Member
Join Date: Jan 2019
Location: London
Old 01-30-2019 , 06:28   Re: Deagle plugin
Reply With Quote #3

yap is it allright, but after some time..you can't drop anymore the weapon, u can pickup an weapon...
__________________
SarmaLe.LaLeagane.Ro - New Classic Server !
tembeluu is offline
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 01-30-2019 , 07:00   Re: Deagle plugin
Reply With Quote #4

Quote:
Originally Posted by tembeluu View Post
yap is it allright, but after some time..you can't drop anymore the weapon, u can pickup an weapon...
oh, i forgot about that, try now
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fakemeta_util> 
#include <hamsandwich>
#include <fun> 

#define PLUGIN "Spawn Weapons"
#define VERSION "1.0"
#define AUTHOR "nutu"

new bool:HasC4[33]

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
RegisterHam(Ham_Spawn"player""Inceput_runda"1);
}
public 
Inceput_runda(id
{
    if(
is_user_alive(id)) 
    {
        
give_item(id"weapon_knife");
        
WeaponMenu(id);
    }
}

public 
WeaponMenu(id) {
    if(
get_user_team(id) == CS_TEAM_CT
    {
        
cs_drop_user_weapon(id"weapon_usp"1);
        
give_item(id,"weapon_knife");
        
give_item(id"weapon_deagle");
        
cs_set_user_bpammo(idCSW_DEAGLE,35);
    }
    else if (
get_user_team(id) == CS_TEAM_T
    {
        if (
user_has_weapon(idCSW_C4) && get_user_team(id) == 1)
            
HasC4[id] = true;
        else
            
HasC4[id] = false;
        
cs_drop_user_weapon(id"weapon_glock18"1);
        
give_item(id,"weapon_knife");
        
give_item(id"weapon_deagle");
        
cs_set_user_bpammo(idCSW_DEAGLE,35);
        if (
HasC4[id])
        {
            
give_item(id"weapon_c4");
            
cs_set_user_plantid );
        }
    }
}
stock cs_drop_user_weapon(const id, const szWeaponName[]="", const bStrip=0
{    
    new 
wEnt = -WeaponId get_weaponidszWeaponName );  
    const 
NadeBits = ( ( << CSW_HEGRENADE ) | ( << CSW_FLASHBANG ) | ( << CSW_SMOKEGRENADE ) ); 
    if( ( 
WeaponId 30 ) && is_user_aliveid ) && user_has_weaponidWeaponId ) ) 
    { 
        if( 
bStrip 
        {     
            while( ( 
wEnt engfuncEngFunc_FindEntityByString wEnt "classname" szWeaponName ) ) && pevwEnt pev_owner ) != id ) {} 
            
            if( !
wEnt )  
                return -
1
            
            
ExecuteHamBHam_Weapon_RetireWeapon wEnt); 
            
            if( !
ExecuteHamBHam_RemovePlayerItem id wEnt ) )  
                return -
1
            
            
ExecuteHamBHam_Item_Kill wEnt ); 
            
            
// this is for 'Grenades'. 
            
if( WeaponId == CSW_C4 
            { 
                
cs_set_user_plantid ); 
                
cs_set_user_bpammoid CSW_C4 ); 
            } 
            
            else if ( 
NadeBits & ( << WeaponId ) ) 
                
cs_set_user_bpammo(id,WeaponId,0); 
        } 
        else 
            
engclient_cmdid"drop"szWeaponName ); 
        
// thanks to Connor here: 
        
user_has_weaponidWeaponId); 
    }         
    return 
wEnt
}  

/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/ 
__________________
a simple act of caring creates an endless ripple.
Nutu_ is offline
tembeluu
Member
Join Date: Jan 2019
Location: London
Old 02-01-2019 , 09:43   Re: Deagle plugin
Reply With Quote #5

Thank you.
__________________
SarmaLe.LaLeagane.Ro - New Classic Server !
tembeluu is offline
joaokb
Junior Member
Join Date: Apr 2021
Location: brazil
Old 04-23-2021 , 17:39   Re: Deagle plugin
Reply With Quote #6

Quote:
Originally Posted by Nutu_ View Post
oh, i forgot about that, try now
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fakemeta_util> 
#include <hamsandwich>
#include <fun> 

#define PLUGIN "Spawn Weapons"
#define VERSION "1.0"
#define AUTHOR "nutu"

new bool:HasC4[33]

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
RegisterHam(Ham_Spawn"player""Inceput_runda"1);
}
public 
Inceput_runda(id
{
    if(
is_user_alive(id)) 
    {
        
give_item(id"weapon_knife");
        
WeaponMenu(id);
    }
}

public 
WeaponMenu(id) {
    if(
get_user_team(id) == CS_TEAM_CT
    {
        
cs_drop_user_weapon(id"weapon_usp"1);
        
give_item(id,"weapon_knife");
        
give_item(id"weapon_deagle");
        
cs_set_user_bpammo(idCSW_DEAGLE,35);
    }
    else if (
get_user_team(id) == CS_TEAM_T
    {
        if (
user_has_weapon(idCSW_C4) && get_user_team(id) == 1)
            
HasC4[id] = true;
        else
            
HasC4[id] = false;
        
cs_drop_user_weapon(id"weapon_glock18"1);
        
give_item(id,"weapon_knife");
        
give_item(id"weapon_deagle");
        
cs_set_user_bpammo(idCSW_DEAGLE,35);
        if (
HasC4[id])
        {
            
give_item(id"weapon_c4");
            
cs_set_user_plantid );
        }
    }
}
stock cs_drop_user_weapon(const id, const szWeaponName[]="", const bStrip=0
{    
    new 
wEnt = -WeaponId get_weaponidszWeaponName );  
    const 
NadeBits = ( ( << CSW_HEGRENADE ) | ( << CSW_FLASHBANG ) | ( << CSW_SMOKEGRENADE ) ); 
    if( ( 
WeaponId 30 ) && is_user_aliveid ) && user_has_weaponidWeaponId ) ) 
    { 
        if( 
bStrip 
        {     
            while( ( 
wEnt engfuncEngFunc_FindEntityByString wEnt "classname" szWeaponName ) ) && pevwEnt pev_owner ) != id ) {} 
            
            if( !
wEnt )  
                return -
1
            
            
ExecuteHamBHam_Weapon_RetireWeapon wEnt); 
            
            if( !
ExecuteHamBHam_RemovePlayerItem id wEnt ) )  
                return -
1
            
            
ExecuteHamBHam_Item_Kill wEnt ); 
            
            
// this is for 'Grenades'. 
            
if( WeaponId == CSW_C4 
            { 
                
cs_set_user_plantid ); 
                
cs_set_user_bpammoid CSW_C4 ); 
            } 
            
            else if ( 
NadeBits & ( << WeaponId ) ) 
                
cs_set_user_bpammo(id,WeaponId,0); 
        } 
        else 
            
engclient_cmdid"drop"szWeaponName ); 
        
// thanks to Connor here: 
        
user_has_weaponidWeaponId); 
    }         
    return 
wEnt
}  

/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/ 

how can i do to this plugin only work in "de_" and "cs_" maps?
__________________
⠀⠀⠀⠀⠀⠀
⠀⠀kabest
joaokb is offline
tarsisd2
Veteran Member
Join Date: Feb 2016
Location: brazil
Old 04-23-2021 , 18:32   Re: Deagle plugin
Reply With Quote #7

you can do that by map config

https://wiki.alliedmods.net/Configur...ecific_Plugins
tarsisd2 is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 05-06-2021 , 18:13   Re: Deagle plugin
Reply With Quote #8

Code:
#include amxmodx #include engine #define ent create_entity("game_player_equip") public plugin_precache()DispatchKeyValue( ent, "weapon_deagle", "1" ) && DispatchSpawn(ent);
__________________
DJEarthQuake 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 16:12.


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