Existing user? Sign in
Sign up
Games
Servers
Useful
User
Pass
2FA
Cerere
Go to page
Previous
1
,
2
,
3
,
4
Freakz Forum Index
->
Trash Bin
->
CS 2006-2019 (Archived)
->
Plugins - Help / Support
Author
Message
4616
destroi112
[DEV]
Status: Offline
(since 12-03-2020 22:13)
Joined: 24 May 2014
Posts: 4042
,
Topics: 119
Location:
---------
Reputation:
515.9
Votes
: 118
Posted: 22-07-2015, 15:17:59
| Translate post to:
... (
Click for more languages
)
Scoate toate pluginele pe rand sau vezi daca iti zice de la ce plugin apare eroarea.
Greseala mea nu mergea meniu daca userul era viu.
Si la VIP am uitat sa pun deagalul era 4 noaptea ce vrei si tu acum
.
Spoiler:
#include <amxmodx>
#include <fun>
#include <cstrike>
#include <hamsandwich>
new selected[33];
new const Tag[] = "[Freakz]"
new const Nume_Iteme[6][] =
{
"M249",
"M4a1",
"Ak47",
"AwP",
"250 HP|AP si Deagle",
"Invisibilitate 80%%"
}
public plugin_init() {
register_plugin("MeniuT","1.0","D3luxe");
RegisterHam(Ham_Spawn, "player", "ShowMenu", 1);
}
public ShowMenu(id)
{
selected[id] = -1;
set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha,100);
if(get_user_team(id) == 1)
tmenu(id);
}
public tmenu(id)
{
if(get_user_team(id) != 1 || !is_user_alive(id))
return PLUGIN_HANDLED
new menu = menu_create("\yDeathRun", "handled");
menu_additem(menu, "\wM249", "1", 0);
menu_additem(menu, "\wM4a1", "2", 0);
menu_additem(menu, "\wAk47", "3", 0);
menu_additem(menu, "\wAwp", "4", 0);
menu_additem(menu, "\w250 HP|AP \r+ \wDeagle", "5", 0);
menu_additem(menu, "\wInvizibilitate \r80%%", "6", 0);
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
menu_display(id, menu, 0);
return PLUGIN_HANDLED
}
public handled(id, menu, item)
{
if(item == MENU_EXIT)
random_item(id);
if(get_user_team(id) != 1 || !is_user_alive(id))
{
menu_destroy(menu);
return PLUGIN_HANDLED;
}
new data[6], iName[64];
new access, callback;
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
new key = str_to_num(data);
switch(key)
{
case 1:
{
give_item( id, "weapon_m249" );
cs_set_user_bpammo( id, CSW_M249, 250 );
selected[id] = 0;
}
case 2:
{
give_item( id, "weapon_m4a1" );
cs_set_user_bpammo( id, CSW_M4A1, 250 );
selected[id] = 1;
}
case 3:
{
give_item( id, "weapon_ak47" );
cs_set_user_bpammo( id, CSW_AK47, 250 );
selected[id] = 2;
}
case 4:
{
give_item( id, "weapon_awp" );
cs_set_user_bpammo( id, CSW_AWP, 250 );
selected[id] = 3;
}
case 5:
{
set_user_health( id, 250 );
set_user_armor(id, 250 );
give_item( id, "weapon_deagle" );
cs_set_user_bpammo(id,CSW_DEAGLE,35);
selected[id] = 4;
}
case 6:
{
set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha,20);
selected[id] = 5;
}
}
ChatColor(id,"!g%s !yAi ales !team%s.",Tag,Nume_Iteme[selected[id]]);
menu_destroy(menu);
return PLUGIN_HANDLED;
}
public random_item(id)
{
switch(random_num(1,6))
{
case 1:
{
give_item( id, "weapon_m249" );
cs_set_user_bpammo( id, CSW_M249, 250 );
selected[id] = 0;
}
case 2:
{
give_item( id, "weapon_m4a1" );
cs_set_user_bpammo( id, CSW_M4A1, 250 );
selected[id] = 1;
}
case 3:
{
give_item( id, "weapon_ak47" );
cs_set_user_bpammo( id, CSW_AK47, 250 );
selected[id] = 2;
}
case 4:
{
give_item( id, "weapon_awp" );
cs_set_user_bpammo( id, CSW_AWP, 250 );
selected[id] = 3;
}
case 5:
{
set_user_health( id, 250 );
set_user_armor(id, 250 );
give_item( id, "weapon_deagle" );
cs_set_user_bpammo(id,CSW_DEAGLE,35);
selected[id] = 4;
}
case 6:
{
set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha,20);
selected[id] = 5;
}
}
ChatColor(id,"!g%s !yAi ales !team%s.",Tag,Nume_Iteme[selected[id]]);
}
stock ChatColor(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)
replace_all(msg, 190, "!g", "^4")
replace_all(msg, 190, "!y", "^1")
replace_all(msg, 190, "!team", "^3")
if (id) players[0] = id; else get_players(players, count, "ch")
{
for (new i = 0; i < count; i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}
si VIP
Spoiler:
#include <amxmodx>
#include <fun>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta>
#include <engine>
#define ACCES ADMIN_LEVEL_H
#pragma tabsize 0
new bool:CmdUsed[33];
new selected[33];
new const Nume_Iteme[7][] =
{
"Minigun si Deagle",
"M4a1 si Deagle",
"Ak47 si Deagle",
"AwP si Deagle",
"800 HP si AP",
"Set Grenazi",
"Invisibilitate 80%% si Deagle"
}
new const Tag[] = "[Freakz]"
new const Autor[] = "oricine"
//minigun
const OFFSET_WEAPONOWNER = 41
const OFFSET_LINUX = 5
const OFFSET_LINUX_WEAPONS = 4
const WEAP_KEY = 545464464
const MAX_PLAYERS = 32
const m_flNextPrimaryAttack = 46;
const m_iClip = 51;
const m_flNextAttack = 83;
const m_flTimeWeaponIdle = 48;
const m_flStartThrow = 30;
enum ( <<=1 )
{
DROP_PRIMARY = 1,
DROP_SECONDARY
};
enum ( <<=1 )
{
v_angle = 1,
punchangle,
angles
};
const IDLE = 0 ;
const RELOAD = 1;
const DRAW = 2;
const SHOOT_1 = 3;
const SHOOT_END = 6;
const SHOOT_START = 5;
#define HoldCBaseWeapon(%0) ( get_user_weapon( %0 ) == g_iWeaponID && g_pWeaponA[ %0 ] )
#define IsValidPrivateData(%0) ( pev_valid( %0 ) == 2 )
#define PRECACHE_MODEL(%0) engfunc(EngFunc_PrecacheModel, %0)
#define PRECACHE_SOUND(%0) engfunc(EngFunc_PrecacheSound, %0)
#define PRECACHE_GENERIC(%0) engfunc(EngFunc_PrecacheGeneric, %0)
new const WEAPON_SOUND_FIRE[ ] = "weapons/m134-1.wav";
new const WEAPON_SOUND_SPINDOWN[ ] = "weapons/m134_spindown.wav";
new const WEAPON_SOUND_SPINUP[ ] = "weapons/m134_spinup.wav";
new const WEAPON_LIST[ ] = "weapon_minigun";
new const WEAPON_BASE_NAME[ ] = "weapon_m249";
const Float: RELOAD_TIME = 5.0;
const AMMO__WEAPON = 500 ;
const CLIP__WEAPON = 100 ;
const Float: WEAPON__DAMAGE = 2.0;
const Float: WEAPON__SPEED = 0.1;
const Float: SPEED_FIRE = 120.0;
const Float: SPEED_RUN = 200.0;
new V_MODEL[ ] = "models/v_minigun.mdl";
new P_MODEL[ ] = "models/p_minigun.mdl";
new W_MODEL[ ] = "models/w_minigun.mdl";
new const HUD_SPRITES[ ] [ ] =
{
"sprites/minigun/640hud26.spr",
"sprites/minigun/640hud35.spr"
};
new const TRACE_ATTACK[ ] [ ] =
{
"func_breakable" ,
"func_wall" ,
"func_door" ,
"func_plat" ,
"func_rotating" ,
"worldspawn"
};
new const GUNSHOT_DECALS[ ] = { 41, 42, 43, 44, 45 };
new g_iForwardIndex ;
new g_pWeaponA[ MAX_PLAYERS + 1 ] ;
new g_iWeaponID = 0;
new bool:g_iRun[ MAX_PLAYERS + 1 ];
const WEAPONS_PRIMARY_BITSUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90);
const WEAPONS_SECONDARY_BITSUM = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE);
//goldmember
new bool:g_bAdminNick
new bool:is_admin_connected[33]
new g_msg[512]
new g_admin_enable
new g_online_color
new g_msg_xypos
new g_SyncAdmin
new g_iAdminCount
new g_iMaxPlayers
new g_ClassName[] = "admin_msg"
public plugin_init() {
register_plugin("Plugin","1.0",Autor);
register_clcmd("say /vipmenu", "vipmenu");
register_clcmd("say /vm", "vipmenu");
register_forward( FM_SetModel, "Forward_SetModel" , false );
register_forward( FM_UpdateClientData, "Forward_UpdateClientData" , true );
register_forward( FM_PlayerPreThink , "Forward_PlayerPreThink" , false );
RegisterHam(Ham_Spawn, "player", "FwdHamSpawn_Post", 1);
RegisterHam( Ham_Item_AddToPlayer, WEAPON_BASE_NAME, "CBaseWeapon__AddToPlayer__Post" , true );
RegisterHam( Ham_Item_Deploy, WEAPON_BASE_NAME , "CBaseWeapon__Deploy__Post", true );
RegisterHam( Ham_Weapon_PrimaryAttack, WEAPON_BASE_NAME, "CBaseWeapon__PrimaryAttack__Pre" , false );
RegisterHam( Ham_Item_PostFrame, WEAPON_BASE_NAME, "CBaseWeapon__PostFrame__Pre" , false );
RegisterHam( Ham_Weapon_Reload, WEAPON_BASE_NAME, "CBaseWeapon__Reload_Pre" , false );
RegisterHam( Ham_Weapon_WeaponIdle, WEAPON_BASE_NAME, "CBaseWeapon__Idle_Pre", false );
RegisterHam( Ham_TraceAttack,"player","CBaseWeapon__TraceAttack_Pre", false );
static i;
for ( i = 0 ; i < sizeof TRACE_ATTACK ; i++ )
RegisterHam( Ham_TraceAttack, TRACE_ATTACK[ i ], "CBaseWeapon_TraceAttack_Post",.Post = true );
register_clcmd( WEAPON_LIST, "weapon_hook_an" );
g_iWeaponID = get_weaponid( WEAPON_BASE_NAME );
register_think(g_ClassName,"ForwardThink")
g_admin_enable = register_cvar("sa_plugin_on","1")
g_online_color = register_cvar("sa_online_color","0 130 0")
g_msg_xypos = register_cvar("sa_msg_xypos","0.02 0.2")
g_SyncAdmin = CreateHudSyncObj()
g_iMaxPlayers = get_maxplayers()
new iEnt = create_entity("info_target")
entity_set_string(iEnt, EV_SZ_classname, g_ClassName)
entity_set_float(iEnt, EV_FL_nextthink, get_gametime() + 2.0)
}
public plugin_precache( )
{
PRECACHE_MODEL( V_MODEL );
PRECACHE_MODEL( P_MODEL );
PRECACHE_MODEL( W_MODEL );
PRECACHE_SOUNDS_FROM_MODEL( V_MODEL );
PRECACHE_SOUND( WEAPON_SOUND_SPINDOWN );
PRECACHE_SOUND( WEAPON_SOUND_FIRE );
PRECACHE_SOUND( WEAPON_SOUND_SPINUP );
static iFile;
for( iFile = 0 ; iFile < sizeof HUD_SPRITES; iFile++ )
PRECACHE_GENERIC( HUD_SPRITES[ iFile ] );
static szFile [ 128 ];
formatex ( szFile , charsmax( szFile ) , "sprites/%s.txt" , WEAPON_LIST );
PRECACHE_GENERIC( szFile );
}
public FwdHamSpawn_Post(id)
{
selected[id] = -1;
set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha,100);
g_pWeaponA[id] = false;
CmdUsed[id] = false;
}
public vipmenu(id)
{
if(!is_user_alive(id))
{
ChatColor(id,"!g%s !yEsti mort,!teamnu poti folosi !ymeniul.",Tag)
return PLUGIN_HANDLED
}
if( !(get_user_flags(id) & ACCES))
{
ChatColor(id,"!g%s !yNu esti VIP !",Tag)
return PLUGIN_HANDLED
}
if(CmdUsed[id])
{
ChatColor(id,"!g%s Poti folosi meniul !teamodata !ype runda.",Tag);
return PLUGIN_HANDLED;
}
new menu = menu_create("\yVipMenu \DeathRun", "meniuvip");
menu_additem(menu, "\wMinigun\r+ \wDeagle", "1", 0);
menu_additem(menu, "\wM4a1\r+ \wDeagle", "2", 0);
menu_additem(menu, "\wAk47\r+ \wDeagle", "3", 0);
menu_additem(menu, "\wAwp\r+ \wDeagle","4", 0);
menu_additem(menu, "\w800 Hp \r| \wAp", "5", 0);
menu_additem(menu, "\wSet Grenazi", "6", 0);
menu_additem(menu, "\wInvizibilitate 80%% \r+ \wDeagle", "7", 0);
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
menu_display(id, menu, 0);
return PLUGIN_HANDLED
}
public meniuvip(id, menu, item)
{
if(item == MENU_EXIT || !is_user_alive(id))
{
menu_destroy(menu);
return PLUGIN_HANDLED;
}
new data[6], iName[64];
new access, callback;
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
new key = str_to_num(data);
switch(key)
{
case 1:
{
give_minigun(id);
give_item( id, "weapon_deagle" );
cs_set_user_bpammo( id, CSW_DEAGLE, 200 );
selected[id] = 0;
CmdUsed[id] = true;
}
case 2:
{
give_item( id, "weapon_m4a1" );
cs_set_user_bpammo( id, CSW_M4A1, 200 );
give_item( id, "weapon_deagle" );
cs_set_user_bpammo( id, CSW_DEAGLE, 200 );
selected[id] = 1;
CmdUsed[id] = true;
}
case 3:
{
give_item( id, "weapon_ak47" );
cs_set_user_bpammo( id, CSW_AK47, 200 );
give_item( id, "weapon_deagle" );
cs_set_user_bpammo( id, CSW_DEAGLE, 200 );
selected[id] = 2;
CmdUsed[id] = true;
}
case 4:
{
give_item( id, "weapon_awp" );
cs_set_user_bpammo( id, CSW_AWP, 200 );
give_item( id, "weapon_deagle" );
cs_set_user_bpammo( id, CSW_DEAGLE, 200 );
selected[id] = 3;
CmdUsed[id] = true;
}
case 5:
{
set_user_health( id, 800 );
set_user_armor(id, 800 );
selected[id] = 4;
CmdUsed[id] = true;
}
case 6:
{
give_item( id, "weapon_hegrenade" );
give_item( id, "weapon_flashbang" );
give_item( id, "weapon_smokegrenade" );
selected[id] = 5;
CmdUsed[id] = true;
}
case 7:
{
give_item( id, "weapon_deagle" );
cs_set_user_bpammo( id, CSW_DEAGLE, 200 );
set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha,20);
selected[id] = 6;
CmdUsed[id] = true;
}
}
ChatColor(id,"!g%s !yAi ales !team%s.",Tag,Nume_Iteme[selected[id]]);
menu_destroy(menu);
return PLUGIN_HANDLED;
}
public give_minigun(pPlayer)
{
UTIL__DropWeapons( pPlayer, DROP_PRIMARY );
g_pWeaponA[ pPlayer ] = true;
static pEntity;
pEntity = fm_give_item( pPlayer , WEAPON_BASE_NAME );
if( pEntity > 0 ) cs_set_weapon_ammo( pEntity, CLIP__WEAPON );
cs_set_user_bpammo( pPlayer , g_iWeaponID , AMMO__WEAPON );
UTIL__WeaponList( pPlayer, WEAPON_LIST , 3 , AMMO__WEAPON , -1 , -1 , 0 , 4 , g_iWeaponID , 0 );
}
public weapon_hook_an( pPlayer )
{
engclient_cmd( pPlayer, WEAPON_BASE_NAME);
return PLUGIN_HANDLED;
}
public client_disconnect( id )
{
if(is_admin_connected[id])
{
is_admin_connected[id] = false
g_iAdminCount--
set_admin_msg()
}
g_pWeaponA[ id ] = false;
}
public Forward_SetModel( pEntity, const pModel[ ] )
{
if( !pev_valid( pEntity ) )
{
return FMRES_IGNORED;
}
static szClassName [ 33 ];
pev( pEntity, pev_classname, szClassName, charsmax(szClassName) );
if( !equal ( szClassName, "weaponbox" ) )
{
return FMRES_IGNORED;
}
static pOwner , pModel;
pModel = fm_find_ent_by_owner ( -1, WEAPON_BASE_NAME, pEntity );
pOwner = pev ( pEntity, pev_owner );
if ( g_pWeaponA [ pOwner ] && pev_valid ( pModel ) )
{
set_pev( pModel , pev_impulse , WEAP_KEY );
engfunc( EngFunc_SetModel, pEntity, W_MODEL );
g_pWeaponA [ pOwner ] = false;
return FMRES_SUPERCEDE;
}
return FMRES_IGNORED;
}
public Forward_UpdateClientData( pPlayer , SendWeapons, CD_Handle )
{
if ( !HoldCBaseWeapon( pPlayer ) )
{
return HAM_IGNORED;
}
static Float:fGametime;
fGametime = get_gametime( );
set_cd ( CD_Handle, CD_flNextAttack, fGametime + 0.001 );
return FMRES_HANDLED;
}
public Forward_PlayBackEvent(flags, invoker, eventindex, Float:delay, Float:origin[3], Float:fvangles[3], Float:fparam1, Float:fparam2, iParam1, iParam2, bParam1, bParam2)
{
return FMRES_SUPERCEDE;
}
public Forward_PlayerPreThink( pId )
{
if( !is_user_alive( pId ) || !HoldCBaseWeapon( pId ) )
{
return FMRES_IGNORED ;
}
if( g_iRun[ pId ] )
{
set_pev( pId , pev_maxspeed , SPEED_FIRE );
}
else
{
set_pev( pId , pev_maxspeed , SPEED_RUN );
}
return FMRES_IGNORED ;
}
public CBaseWeapon__AddToPlayer__Post( pEntity , pPlayer )
{
if( !pev_valid( pEntity ) && !is_user_connected( pPlayer ) )
return HAM_IGNORED;
if( pev( pEntity, pev_impulse) == WEAP_KEY )
{
g_pWeaponA[ pPlayer ] = true;
UTIL__WeaponList( pPlayer, WEAPON_LIST , 3 , AMMO__WEAPON , -1 , -1 , 0 , 4 , g_iWeaponID , 0 );
return HAM_IGNORED ;
}
else
{
UTIL__WeaponList( pPlayer, WEAPON_BASE_NAME , 3 , AMMO__WEAPON , -1 , -1 , 0 , 4 , g_iWeaponID , 0 );
}
return HAM_IGNORED;
}
public CBaseWeapon__Deploy__Post( pEntity )
{
if( !IsValidPrivateData( pEntity ) )
return HAM_IGNORED;
static pId ;
pId = get_pdata_cbase( pEntity , OFFSET_WEAPONOWNER , OFFSET_LINUX_WEAPONS );
if ( !g_pWeaponA[ pId ] )
{
return HAM_IGNORED;
}
set_pev( pId, pev_viewmodel2, V_MODEL);
set_pev( pId, pev_weaponmodel2, P_MODEL);
set_pdata_float( pId, m_flNextAttack, 1.0, OFFSET_LINUX );
set_pdata_float( pEntity, m_flTimeWeaponIdle, 1.0 , OFFSET_LINUX_WEAPONS );
set_pdata_float( pEntity , m_flStartThrow , 0.0 , OFFSET_LINUX_WEAPONS );
UTIL_SenwWeaponAnim( pId, DRAW );
return HAM_IGNORED ;
}
public CBaseWeapon__PrimaryAttack__Pre(pEntity)
{
if( !IsValidPrivateData( pEntity ) )
{
return HAM_IGNORED;
}
static pId ; pId = get_pdata_cbase( pEntity , OFFSET_WEAPONOWNER , OFFSET_LINUX_WEAPONS );
static iClip ; iClip = get_pdata_int( pEntity, m_iClip, OFFSET_LINUX_WEAPONS );
static Float:i_mSpinTime ;i_mSpinTime = get_pdata_float( pEntity ,m_flStartThrow , OFFSET_LINUX_WEAPONS );
if ( !HoldCBaseWeapon( pId ) )
{
return HAM_IGNORED;
}
g_iForwardIndex = register_forward( FM_PlaybackEvent, "Forward_PlayBackEvent" , false );
if( iClip <= 0 )
{
if( i_mSpinTime )
{
emit_sound( pId , CHAN_WEAPON , WEAPON_SOUND_SPINDOWN , 1.0 , ATTN_NORM , 0 , PITCH_NORM ) ;
UTIL_SenwWeaponAnim( pId , SHOOT_END );
set_pdata_float( pEntity ,m_flStartThrow , 0.0 , OFFSET_LINUX_WEAPONS );
g_iRun[ pId ] = false ;
}
return HAM_IGNORED;
}
if( i_mSpinTime <= 0.0 )
{
emit_sound( pId , CHAN_WEAPON , WEAPON_SOUND_SPINUP , 1.0 , ATTN_NORM , 0 , PITCH_NORM ) ;
UTIL_SenwWeaponAnim( pId ,SHOOT_START );
i_mSpinTime += 0.1;
}
else if(i_mSpinTime <= 1.1 )
{
i_mSpinTime += 0.1;
}
else if( i_mSpinTime > 1.1 )
{
ExecuteHam(Ham_Weapon_PrimaryAttack, pEntity);
emit_sound( pId, CHAN_WEAPON, WEAPON_SOUND_FIRE, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
UTIL_SenwWeaponAnim( pId, SHOOT_1 );
UTIL_ScreenShake( pId, ( 1 << 12 ) * 1, ( 1 << 12 ) * 1, ( 1 << 12 ) * 1);
g_iRun[ pId ] = true ;
}
set_pdata_float( pEntity , m_flStartThrow , i_mSpinTime , OFFSET_LINUX_WEAPONS );
set_pdata_float( pEntity, m_flNextPrimaryAttack , WEAPON__SPEED , OFFSET_LINUX_WEAPONS );
set_pdata_float( pEntity, m_flTimeWeaponIdle, WEAPON__SPEED , OFFSET_LINUX_WEAPONS );
unregister_forward(FM_PlaybackEvent, g_iForwardIndex , false);
return HAM_SUPERCEDE ;
}
public CBaseWeapon__PostFrame__Pre( pEntity )
{
if( !IsValidPrivateData( pEntity ) )
return HAM_IGNORED;
static pId;
pId = get_pdata_cbase( pEntity , OFFSET_WEAPONOWNER , OFFSET_LINUX_WEAPONS );
if ( !is_user_connected( pId ) && !HoldCBaseWeapon( pId ) )
{
return HAM_IGNORED;
}
static fInReload ; fInReload = get_pdata_int( pEntity, 54, OFFSET_LINUX_WEAPONS );
static Float:flNextAttack ; flNextAttack = get_pdata_float( pId, m_flNextAttack, OFFSET_LINUX_WEAPONS );
static iClip ; iClip = get_pdata_int( pEntity, m_iClip, OFFSET_LINUX_WEAPONS );
static iAmmoType ; iAmmoType = 376 + get_pdata_int( pEntity, 49, OFFSET_LINUX_WEAPONS );
static iBpAmmo ; iBpAmmo = get_pdata_int( pId, iAmmoType, OFFSET_LINUX );
if ( fInReload && flNextAttack <= RELOAD_TIME )
{
static j ; j = min( CLIP__WEAPON - iClip, iBpAmmo);
set_pdata_int( pEntity, m_iClip, iClip + j, OFFSET_LINUX_WEAPONS );
set_pdata_int( pId, iAmmoType, iBpAmmo-j, OFFSET_LINUX );
set_pdata_int( pEntity, 54, 0, OFFSET_LINUX_WEAPONS );
}
return HAM_IGNORED;
}
public CBaseWeapon__Reload_Pre(pEntity)
{
if( !IsValidPrivateData( pEntity ) )
{
return HAM_IGNORED;
}
static pId;
pId = get_pdata_cbase( pEntity , OFFSET_WEAPONOWNER , OFFSET_LINUX_WEAPONS );
static iAmmoType ; iAmmoType = 376 + get_pdata_int( pEntity, 49, OFFSET_LINUX_WEAPONS );
static iBpAmmo ; iBpAmmo = get_pdata_int( pId, iAmmoType, OFFSET_LINUX );
static iClip ; iClip = get_pdata_int( pEntity, m_iClip, OFFSET_LINUX );
if ( iBpAmmo <= 0 || iClip >= CLIP__WEAPON )
{
return HAM_SUPERCEDE;
}
set_pdata_int( pEntity, m_iClip, 0, OFFSET_LINUX_WEAPONS );
ExecuteHam( Ham_Weapon_Reload, pEntity );
set_pdata_int( pEntity, m_iClip, iClip, OFFSET_LINUX_WEAPONS );
if ( !is_user_connected( pId ) || !HoldCBaseWeapon( pId ) )
{
return HAM_IGNORED;
}
set_pdata_float( pId, m_flNextAttack, RELOAD_TIME , OFFSET_LINUX);
set_pdata_float( pEntity, m_flTimeWeaponIdle, RELOAD_TIME , OFFSET_LINUX_WEAPONS );
set_pdata_float( pEntity , m_flStartThrow , 0.0 , OFFSET_LINUX_WEAPONS );
UTIL_SenwWeaponAnim(pId, RELOAD);
return HAM_SUPERCEDE;
}
public CBaseWeapon__Idle_Pre( pEntity )
{
if( !IsValidPrivateData( pEntity ) )
{
return HAM_IGNORED;
}
static pId;
pId = get_pdata_cbase( pEntity , OFFSET_WEAPONOWNER , OFFSET_LINUX_WEAPONS );
if (get_pdata_int(pEntity, m_flTimeWeaponIdle, OFFSET_LINUX_WEAPONS) > 0.0 )
{
return HAM_IGNORED;
}
if ( !HoldCBaseWeapon( pId ) )
{
return HAM_IGNORED;
}
if( get_pdata_float(pEntity , m_flStartThrow, OFFSET_LINUX_WEAPONS ) )
{
emit_sound( pId , CHAN_WEAPON , WEAPON_SOUND_SPINDOWN , 1.0 , ATTN_NORM , 0 , PITCH_NORM ) ;
UTIL_SenwWeaponAnim ( pId, SHOOT_END );
set_pdata_float( pEntity ,m_flStartThrow , 0.0 , OFFSET_LINUX_WEAPONS );
set_pdata_float( pEntity, m_flTimeWeaponIdle, 0.6 , OFFSET_LINUX_WEAPONS );
set_pdata_float( pId , m_flNextAttack , 0.6 , OFFSET_LINUX ) ;
g_iRun[ pId ] = false ;
return HAM_IGNORED ;
}
UTIL_SenwWeaponAnim ( pId, IDLE );
set_pdata_float( pEntity, m_flTimeWeaponIdle, random_float( 5.0 , 10.0 ) , OFFSET_LINUX_WEAPONS );
return HAM_SUPERCEDE ;
}
public CBaseWeapon__TraceAttack_Pre( iEntity, iAttacker, Float: flDamage)
{
if ( is_user_connected( iAttacker ) && HoldCBaseWeapon( iAttacker ) )
{
SetHamParamFloat(3 , flDamage * WEAPON__DAMAGE );
return HAM_IGNORED ;
}
return HAM_IGNORED;
}
public CBaseWeapon_TraceAttack_Post( pEntity, iAttacker, Float:flDamage, Float:fDir[3], ptr, iDamageType)
{
if ( !is_user_connected( iAttacker ) || !HoldCBaseWeapon( iAttacker ) || !iAttacker )
{
return HAM_HANDLED;
}
new iDecal = GUNSHOT_DECALS[ random_num( 0 , sizeof( GUNSHOT_DECALS ) - 1 ) ];
new Float:vecEnd[3];
get_tr2(ptr, TR_vecEndPos, vecEnd);
message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
write_byte(TE_GUNSHOTDECAL);
engfunc(EngFunc_WriteCoord, vecEnd[0]);
engfunc(EngFunc_WriteCoord, vecEnd[1]);
engfunc(EngFunc_WriteCoord, vecEnd[2] - 10.0 );
write_short(pEntity);
write_byte(iDecal);
message_end( );
return HAM_IGNORED;
}
stock UTIL__DropWeapons(id, bitsDropType)
{
static weapons[32], num, i, weaponid;
num = 0 ;
get_user_weapons(id, weapons, num);
for (i = 0; i < num; i++)
{
weaponid = weapons[i];
if ((bitsDropType == DROP_PRIMARY && ((1<<weaponid) & WEAPONS_PRIMARY_BITSUM)) || (bitsDropType == DROP_SECONDARY && ((1<<weaponid) & WEAPONS_SECONDARY_BITSUM)))
{
static wname[32];
get_weaponname(weaponid, wname, charsmax(wname));
engclient_cmd(id, "drop", wname);
}
}
}
stock fm_find_ent_by_owner(entity, const classname[], owner)
{
while ((entity = engfunc(EngFunc_FindEntityByString, entity, "classname", classname)) && pev(entity, pev_owner) != owner) { /* keep looping */ }
return entity;
}
stock UTIL_SenwWeaponAnim(const pPlayer, const Sequence)
{
set_pev(pPlayer, pev_weaponanim, Sequence);
message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, .player = pPlayer);
write_byte(Sequence);
write_byte(pev(pPlayer, pev_body));
message_end();
}
UTIL__WeaponList( pPlayer, const szWeapon[ ], int, int2, int3, int4, int5, int6, int7, int8 )
{
message_begin( MSG_ONE, get_user_msgid( "WeaponList" ) , _, pPlayer );
write_string( szWeapon );
write_byte( int );
write_byte( int2);
write_byte( int3 );
write_byte( int4 );
write_byte( int5 );
write_byte( int6 );
write_byte( int7 );
write_byte( int8 );
message_end( );
}
stock fm_give_item(id, const item[])
{
static ent;
ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, item));
if (!pev_valid(ent)) return 0;
static Float:originF[3];
pev(id, pev_origin, originF);
set_pev(ent, pev_origin, originF);
set_pev(ent, pev_spawnflags, pev(ent, pev_spawnflags) | SF_NORESPAWN);
dllfunc(DLLFunc_Spawn, ent);
static save;
save = pev(ent, pev_solid);
dllfunc(DLLFunc_Touch, ent, id);
if (pev(ent, pev_solid) != save)
return ent ;
engfunc(EngFunc_RemoveEntity, ent);
return -1;
}
PRECACHE_SOUNDS_FROM_MODEL(const szModelPath[])
{
new iFile;
if ((iFile = fopen(szModelPath, "rt")))
{
new szSoundPath[64];
new iNumSeq, iSeqIndex;
new iEvent, iNumEvents, iEventIndex;
fseek(iFile, 164, SEEK_SET);
fread(iFile, iNumSeq, BLOCK_INT);
fread(iFile, iSeqIndex, BLOCK_INT);
for (new k, i = 0; i < iNumSeq; i++)
{
fseek(iFile, iSeqIndex + 48 + 176 * i, SEEK_SET);
fread(iFile, iNumEvents, BLOCK_INT);
fread(iFile, iEventIndex, BLOCK_INT);
fseek(iFile, iEventIndex + 176 * i, SEEK_SET);
for (k = 0; k < iNumEvents; k++)
{
fseek(iFile, iEventIndex + 4 + 76 * k, SEEK_SET);
fread(iFile, iEvent, BLOCK_INT);
fseek(iFile, 4, SEEK_CUR);
if (iEvent != 5004)
{
continue;
}
fread_blocks(iFile, szSoundPath, 64, BLOCK_CHAR);
if (strlen(szSoundPath))
{
strtolower(szSoundPath);
PRECACHE_SOUND(szSoundPath);
}
}
}
}
fclose(iFile);
}
stock UTIL_ScreenShake( pPlayer, sAmplitude = 0, sDuration = 0, sFrequency = 0 )
{
message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "ScreenShake" ), .player = pPlayer );
write_short( sAmplitude );
write_short( sDuration );
write_short( sFrequency );
message_end( );
}
//stock
stock ChatColor(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)
replace_all(msg, 190, "!g", "^4")
replace_all(msg, 190, "!y", "^1")
replace_all(msg, 190, "!team", "^3")
if (id) players[0] = id; else get_players(players, count, "ch")
{
for (new i = 0; i < count; i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}
public client_putinserver(id)
{
if(get_user_flags(id) & ACCES)
{
is_admin_connected[id] = true
g_iAdminCount++
set_admin_msg()
}
if(g_iAdminCount == 0)
set_admin_msg()
}
public client_infochanged(id)
{
if(is_admin_connected[id])
{
static NewName[32], OldName[32]
get_user_info(id, "name", NewName, 31)
get_user_name(id, OldName, 31)
if(!equal(OldName, NewName))
g_bAdminNick = true
}
}
public set_admin_msg()
{
static g_iAdminName[32], pos, i
pos = 0
pos += formatex(g_msg[pos], 511-pos, "Gold Members: %d", g_iAdminCount)
for(i = 1 ; i <= g_iMaxPlayers ; i++)
{
if(is_admin_connected[i])
{
get_user_name(i, g_iAdminName, 31)
pos += formatex(g_msg[pos], 511-pos, "^n%s", g_iAdminName)
}
}
}
public admins_online()
{
if(get_pcvar_num(g_admin_enable))
{
static r, g, b, Float:x,Float:y
HudMsgPos(x,y)
if (g_iAdminCount > 0)
{
HudMsgColor(g_online_color, r, g, b)
set_hudmessage(r, g, b, x, y, _, _, 4.0, _, _, 4)
ShowSyncHudMsg(0, g_SyncAdmin, "%s", g_msg)
}
}
return PLUGIN_HANDLED
}
public ForwardThink(iEnt)
{
admins_online()
if(g_bAdminNick)
{
set_admin_msg()
g_bAdminNick = false
}
entity_set_float(iEnt, EV_FL_nextthink, get_gametime() + 2.0)
}
public HudMsgColor(cvar, &r, &g, &b)
{
static color[16], piece[5]
get_pcvar_string(cvar, color, 15)
strbreak( color, piece, 4, color, 15)
r = str_to_num(piece)
strbreak( color, piece, 4, color, 15)
g = str_to_num(piece)
b = str_to_num(color)
}
public HudMsgPos(&Float:x, &Float:y)
{
static coords[16], piece[10]
get_pcvar_string(g_msg_xypos, coords, 15)
strbreak(coords, piece, 9, coords, 15)
x = str_to_float(piece)
y = str_to_float(coords)
}
Retired from Amxmodx
0
0
Back to top
NoSwear22
[Mentally Stable]
Status: Offline
(since 06-11-2015 20:13)
Joined: 19 Jul 2015
Posts: 35
,
Topics: 5
Location:
Romania
Reputation:
7.2
Posted: 22-07-2015, 22:12:04
| Translate post to:
... (
Click for more languages
)
Multumesc Mult. puteti da T/C
0
0
Back to top
Topic locked
Topic is closed, you cannot post any messages in it anymore
Locked by
-P!C@-
, 23 July 2015 17:48
Freakz Forum Index
->
Trash Bin
->
CS 2006-2019 (Archived)
->
Plugins - Help / Support
Go to page
Previous
1
,
2
,
3
,
4
The time now is 22-02-2025, 22:26:10
Copyright info
Based on phpBB
ro
/
com
B
Login
I forgot my password
World of Warcraft
Login for more...
Download WoW 7.3.5
Misc
eSports
Achievements
Buy reputation with votes
Reputation trades
Forum rules
Ban list
Members list
User guide (FAQ)
World of Warcraft
View details