AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Deagle plugin (https://forums.alliedmods.net/showthread.php?t=313968)

tembeluu 01-29-2019 21:49

Deagle plugin
 
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.

Nutu_ 01-30-2019 00:11

Re: Deagle plugin
 
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

tembeluu 01-30-2019 06:28

Re: Deagle plugin
 
yap is it allright, but after some time..you can't drop anymore the weapon, u can pickup an weapon...

Nutu_ 01-30-2019 07:00

Re: Deagle plugin
 
Quote:

Originally Posted by tembeluu (Post 2637231)
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 }
*/ 


tembeluu 02-01-2019 09:43

Re: Deagle plugin
 
Thank you.

joaokb 04-23-2021 17:39

Re: Deagle plugin
 
Quote:

Originally Posted by Nutu_ (Post 2637235)
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?

tarsisd2 04-23-2021 18:32

Re: Deagle plugin
 
you can do that by map config

https://wiki.alliedmods.net/Configur...ecific_Plugins

DJEarthQuake 05-06-2021 18:13

Re: Deagle plugin
 
Code:
#include amxmodx #include engine #define ent create_entity("game_player_equip") public plugin_precache()DispatchKeyValue( ent, "weapon_deagle", "1" ) && DispatchSpawn(ent);


All times are GMT -4. The time now is 10:46.

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