Junior Member
Join Date: Apr 2021
Location: brazil
|
04-23-2021
, 17:39
Re: Deagle plugin
|
#6
|
Quote:
Originally Posted by Nutu_
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(PLUGIN, VERSION, AUTHOR)
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(id, CSW_DEAGLE,35);
}
else if (get_user_team(id) == CS_TEAM_T)
{
if (user_has_weapon(id, CSW_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(id, CSW_DEAGLE,35);
if (HasC4[id])
{
give_item(id, "weapon_c4");
cs_set_user_plant( id );
}
}
}
stock cs_drop_user_weapon(const id, const szWeaponName[]="", const bStrip=0)
{
new wEnt = -1 , WeaponId = get_weaponid( szWeaponName );
const NadeBits = ( ( 1 << CSW_HEGRENADE ) | ( 1 << CSW_FLASHBANG ) | ( 1 << CSW_SMOKEGRENADE ) );
if( ( 0 < WeaponId < 30 ) && is_user_alive( id ) && user_has_weapon( id, WeaponId ) )
{
if( bStrip > 0 )
{
while( ( wEnt = engfunc( EngFunc_FindEntityByString , wEnt , "classname" , szWeaponName ) ) && pev( wEnt , pev_owner ) != id ) {}
if( !wEnt )
return -1;
ExecuteHamB( Ham_Weapon_RetireWeapon , wEnt);
if( !ExecuteHamB( Ham_RemovePlayerItem , id , wEnt ) )
return -1;
ExecuteHamB( Ham_Item_Kill , wEnt );
// this is for 'Grenades'.
if( WeaponId == CSW_C4 )
{
cs_set_user_plant( id , 0 , 0 );
cs_set_user_bpammo( id , CSW_C4 , 0 );
}
else if ( NadeBits & ( 1 << WeaponId ) )
cs_set_user_bpammo(id,WeaponId,0);
}
else
engclient_cmd( id, "drop", szWeaponName );
// thanks to Connor here:
user_has_weapon( id, WeaponId, 0 );
}
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
|
|