Native StarChaserSR

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
418
Реакции
-7
Предупреждения
8
Ошибка
Без ошибок
ОС
Windows
Amx Mod X
1.9.0
Билд
Protocol version 48
Exe version 1.1.2.6 (cstrike)
Exe build: 16:05:41 Jun 15 2009 (4554)
ReGamedll
Без ReGamedll
Версия Metamod
1.21p
Список метамодулей
Currently loaded plugins:
description stat pend file vers src load unlod
[ 1] AMX Mod X RUN - amxmodx_mm.dll v1.9.0-d ini Start ANY
[ 2] POD-Bot mm RUN - podbot_mm.dll v3.0B20b ini Chlvl ANY
[ 3] Print Center Fi RUN - printcenterfix_m v2.0.1 ini ANY ANY
[ 4] Ultimate Unprec RUN - ultimate_unpreca v0.3 Alp ini ANY ANY
[ 5] CStrike RUN - cstrike_amxx.dll v1.9.0.5 pl1 ANY ANY
[ 6] Fun RUN - fun_amxx.dll v1.9.0-d pl1 ANY ANY
[ 7] FakeMeta RUN - fakemeta_amxx.dl v1.9.0-d pl1 ANY ANY
[ 8] Engine RUN - engine_amxx.dll v1.9.0-d pl1 ANY ANY
[ 9] Ham Sandwich RUN - hamsandwich_amxx v1.9.0-d pl1 ANY ANY
9 plugins, 9 running
Список плагинов
Currently loaded plugins:
name version author file status
[ 1] Admin Base 1.9.0-dev+ AMXX Dev Team admin.amxx running
[ 2] Admin Commands 1.9.0-dev+ AMXX Dev Team admincmd.amxx running
[ 3] Admin Help 1.9.0-dev+ AMXX Dev Team adminhelp.amxx running
[ 4] Slots Reservation 1.9.0-dev+ AMXX Dev Team adminslots.amxx running
[ 5] Multi-Lingual System 1.9.0-dev+ AMXX Dev Team multilingual.am running
[ 6] Menus Front-End 1.9.0-dev+ AMXX Dev Team menufront.amxx running
[ 7] Commands Menu 1.9.0-dev+ AMXX Dev Team cmdmenu.amxx running
[ 8] Players Menu 1.9.0-dev+ AMXX Dev Team plmenu.amxx running
[ 9] Maps Menu 1.9.0-dev+ AMXX Dev Team mapsmenu.amxx running
[ 10] Plugin Menu 1.9.0-dev+ AMXX Dev Team pluginmenu.amxx running
[ 11] Admin Chat 1.9.0-dev+ AMXX Dev Team adminchat.amxx running
[ 12] Anti Flood 1.9.0-dev+ AMXX Dev Team antiflood.amxx running
[ 13] Scrolling Message 1.9.0-dev+ AMXX Dev Team scrollmsg.amxx running
[ 14] Info. Messages 1.9.0-dev+ AMXX Dev Team imessage.amxx running
[ 15] Admin Votes 1.9.0-dev+ AMXX Dev Team adminvote.amxx running
[ 16] NextMap 1.9.0-dev+ AMXX Dev Team nextmap.amxx running
[ 17] Nextmap Chooser 1.9.0-dev+ AMXX Dev Team mapchooser.amxx running
[ 18] TimeLeft 1.9.0-dev+ AMXX Dev Team timeleft.amxx running
[ 19] Pause Plugins 1.9.0-dev+ AMXX Dev Team pausecfg.amxx running
[ 20] Stats Configuration 1.9.0-dev+ AMXX Dev Team statscfg.amxx running
[ 21] POD-Bot Menu 1.3 g4s|figurE.09 amxx_podbotmenu running
[ 22] menu privilegij enu privil nu privilegij menu_privilegij running
[ 23] moi kobinet oi kobinet i kobinet my_kabinet.amxx running
[ 24] Camera Changer 1.3 Bl0ck Camera_Changer. running
[ 25] Admin Prefixes 3.0 m0skVi4a ;] AdminPrefixes.a running
[ 26] [AMXX] Admin Gift 02.01.2018 Number One AdminRight.amxx running
[ 27] NadeModes 11.2 Nomexous & OT nademodes.amxx running
[ 28] KH_HEALTH 1.0 Kulogram KH_Health.amxx running
[ 29] [ZP] Addon: Menu Selec 1.0 Universe & BuB9n creator_give_we running
[ 30] Precache Management 1.0.0 ConnorMcLeod precache_manage stopped
[ 31] Extra Precacher 1.0 Alka extra_precacher running
[ 32] [ZP] Core/Engine 5.0.8 ZP Dev Team zp50_core.amxx running
[ 33] [AMXX] External Settin 0.1 WiLS amx_settings_ap running
[ 34] [CS] Player Models API 1.2 WiLS cs_player_model running
[ 35] [CS] Teams API 1.2 WiLS cs_teams_api.am running
[ 36] [CS] MaxSpeed API 1.0 WiLS cs_maxspeed_api running
[ 37] [CS] Weapon Models API 1.1 WiLS cs_weap_models_ running
[ 38] [CS] Weapons Restrict 0.4 WiLS cs_weap_restric running
[ 39] [CS] Ham Hooks for Bot 1.0 WiLS cs_ham_bots_api running
[ 40] [ZP] Class: Zombie 5.0.8 ZP Dev Team zp50_class_zomb running
[ 41] [ZP] Class: Human 5.0.8 ZP Dev Team zp50_class_huma running
[ 42] [ZP] Class: Nemesis 5.0.8 ZP Dev Team zp50_class_neme running
[ 43] [ZP] Class: Survivor 5.0.8 ZP Dev Team zp50_class_surv running
[ 44] [ZP] Class: Zombie: Cl 5.0.8 ZP Dev Team zp50_class_zomb running
[ 45] [CSO:Hunter Zombie] 1.2 HoRRoR/tERoR edi zp50_class_chin running
[ 46] NST Zombie Class Heal 1.0 NST zp50_class_sham running
[ 47] [ZP] Wallclimb 1.0 WallClimb by Pyt zp50_class_skal running
[ 48] [ZP] Zombie Class: Dra 0.1 =), LARS-BLOODLI zp50_class_reve running
[ 49] [ZP] Zombie Class: Rev 1.0 =), LARS-BLOODLI zp50_class_reve running
[ 50] [ZP] Zombie Class: Poi 0.1 =), LARS-BLOODLI zp50_class_reve running
[ 51] [ZP] Class: Human: Cla 5.0.8 ZP Dev Team zp50_class_huma running
[ 52] [ZP] Human Armor 5.0.8 ZP Dev Team zp50_human_armo running
[ 53] [ZP] Game Modes Manage 5.0.8 ZP Dev Team zp50_gamemodes. running
[ 54] [ZP] Game Mode: Infect 5.0.8 ZP Dev Team zp50_gamemode_i paused
[ 55] [ZP] Game Mode: Multip 5.0.8 ZP Dev Team zp50_gamemode_m paused
[ 56] [ZP] Game Mode: Swarm 5.0.8 ZP Dev Team zp50_gamemode_s paused
[ 57] [ZP] Game Mode: Nemesi 5.0.8 ZP Dev Team zp50_gamemode_n paused
[ 58] [ZP] Game Mode: Surviv 5.0.8 ZP Dev Team zp50_gamemode_s paused
[ 59] [ZP] Game Mode: Plague 5.0.8 ZP Dev Team zp50_gamemode_p paused
[ 60] [ZP] Game Mode: Armage 5.0.8 ZP Dev Team zp50_gamemode_a paused
[ 61] [ZP] Items Manager 5.0.8 ZP Dev Team zp50_items.amxx running
[ 62] [ZP] Items Manager: Am 5.0.8 ZP Dev Team zp50_items_ammo running
[ 63] [ZP] Item: Weapons 5.0.8 ZP Dev Team zp50_item_weapo running
[ 64] [ZP] Item: Antidote 5.0.8 ZP Dev Team zp50_item_antid running
[ 65] [ZP] Item: Zombie Madn 5.0.8 ZP Dev Team zp50_item_zombi running
[ 66] [ZP] Item: Infection B 5.0.8 ZP Dev Team zp50_item_infec running
[ 67] [ZP] Extra Item: Jump 1.0 Opo4uMapy zp_jump_bomb.am running
[ 68] [ZP] Admin Commands 5.0.8 ZP Dev Team zp50_admin_comm running
[ 69] [ZP] Admin Menus 5.0.8 ZP Dev Team zp50_admin_menu running
[ 70] [ZP] Admin Models 5.0.8 ZP Dev Team zp50_admin_mode running
[ 71] [ZP] Custom Buy Menus 5.0.8 ZP Dev Team zp50_buy_menus. running
[ 72] [ZP] Buyzones 5.0.8 ZP Dev Team zp50_buy_zones. running
[ 73] [ZP] Rewards: Ammo Pac 5.0.8 ZP Dev Team zp50_rewards_am running
[ 74] [ZP] Rewards: Frags & 5.0.8 ZP Dev Team zp50_rewards_fr running
[ 75] [ZP] Deathmatch 5.0.8 ZP Dev Team zp50_deathmatch running
[ 76] [ZP] Random Spawning 5.0.8 ZP Dev Team zp50_random_spa running
[ 77] [ZP] Spawn Protection 5.0.8 ZP Dev Team zp50_spawn_prot running
[ 78] [ZP] Zombie Features 5.0.8 ZP Dev Team zp50_zombie_fea running
[ 79] [ZP] Zombie Sounds 5.0.8 ZP Dev Team zp50_zombie_sou running
[ 80] [ZP] Zombie Damage 5.0.8 ZP Dev Team zp50_zombie_dam running
[ 81] [ZP] Human Unlimited A 5.0.8 ZP Dev Team zp50_human_ammo running
[ 82] [ZP] Flashlight 5.0.8 ZP Dev Team zp50_flashlight running
[ 83] [ZP] Nightvision 5.0.8 ZP Dev Team zp50_nightvisio running
[ 84] [ZP] Leap/Longjump 5.0.8 ZP Dev Team zp50_leap.amxx running
[ 85] [ZP] Pain Shock Free 5.0.8 ZP Dev Team zp50_painshockf running
[ 86] [ZP] Knockback 5.0.8 ZP Dev Team zp50_knockback. running
[ 87] [ZP] Weapon Drop/Strip 5.0.8 ZP Dev Team zp50_weapon_dro running
[ 88] [ZP] Effects: Infect 5.0.8 ZP Dev Team zp50_effects_in running
[ 89] [ZP] Effects: Cure 5.0.8 ZP Dev Team zp50_effects_cu running
[ 90] [ZP] Effects: Lighting 5.0.8 ZP Dev Team zp50_effects_li running
[ 91] [ZP] Ambience Effects 5.0.8 ZP Dev Team zp50_ambience_e running
[ 92] New Jetpack 0.0.3 Bad_Bud,ZmOutSta NewJP_mu.amxx running
[ 93] [ZP] Extra Item: Plasm v0.1 Crazy zp_extra_plasma running
[ 94] [ZP] Extra: Cart Blue 1.0 KORD_12.7 zp_extra_cartbl running
[ 95] unknown unknown unknown zp_extra_dartpi running
[ 96] [ZMO] Weapon: Deagle C 1.0 Chrescoe1 , Plan zp_extra_hunter running
[ 97] [ZMO]Weapon: Cyclone 1.0 Base: Batcon; Re zp_extra_cyclon running
[ 98] [ZP] Extra: CSO Weapon 0.1 KORD_12.7 zp_extra_dual_g running
[ 99] unknown unknown unknown zp_extra_dinfin running
[100] Janus-11 1.0 m4m3ts zp_extra_janus1 running
[101] [CSO Like] Weapon: Bri 1.1 / 05.0 inf (nimroK) / B zp_extra_brickx running
[102] [ZP] Extra Item: Frost 1.4 Raheem zp_frost_m4a1.a running
[103] [ZP] Weapon: M4A1 Silv 1.0 xUnicorn (t3rkec zp_weapon_m4a1_ running
[104] Brick Peace V2 1.0 m4m3ts zp_extra_brickp running
[105] AK-47Long 1.0 misna zp_extra_aklong running
[106] [ZP] Weapon: AK47 Beas 1.0 | 2018 xUnicorn (t3rkec zp_weapon_ak47_ running
[107] [ZP] Weapon: BALROG3 1.0 PbI)I(Uu' / Batc zp_extra_barlog running
[108] [ZP] Extra: CSO Weapon 1.0 KORD_12.7 zp_extra_railgu running
[109] [CSO] Thunderbolt 3.0 Dias cso_extra_thund running
[110] [ZP] Weapon: Savery 1.0 Base: Batcon & x cso_weapon_save running
[111] [ZP] Extra: AWP Camo 1.0 Crock / =) (Popr zp_extra_awp_wo running
[112] [ZP] Extra: Lighting E 1.0 Crock / =) (Popr zp_lighting_elf running
[113] [ZP] Extra: CSO Weapon 1.0 KORD_12.7 zp_extra_awpz.a running
[114] [ZP] Extra: CSO Weapon 1.0 KORD_12.7 zp_extra_vulcan running
[115] [CSO Like] BrickPiace 1.0 AsepKhairulAnam zp_extra_brickp running
[116] [ZP] Extra: M249 Pheon 1.0 Crock / =) (Popr zp_extra_m249_p running
[117] [ZP] Extra: m134ex 1.0 LARS-DAY[BR]EAKE zp_extra_m134.a running
[118] [CSO] M4A1 Dark Knight 1.0 || CLO AsepKhairulAnam@ buff_buffm4.amx running
[119] Janus-11 1.0 m4m3ts normal_janus11. running
[120] [WPN] Ethereal 1.0 Chrescoe1 wpn_ethereal.am running
[121] [CounterStrikeOnline] 1.0 [YouTube]COBA native_starchas running
[122] [ZP] Main Menu 5.0.8 ZP Dev Team zp50_main_menu. running
[123] [ZP] Objective Remover 5.0.8 ZP Dev Team zp50_objective_ running
[124] [ZP] Gameplay Fixes 5.0.8 ZP Dev Team zp50_gameplay_f running
[125] [ZP] Team Scoring 5.0.8 ZP Dev Team zp50_team_scori running
[126] [ZP] Server Browser In 5.0.8 ZP Dev Team zp50_serverbrow running
[127] [ZP] HUD Information 5.0.8 ZP Dev Team zp50_hud_info.a running
[128] [ZP] Ammo Packs 5.0.8 ZP Dev Team zp50_ammopacks. running
[129] [ZP] Grenade: Fire 5.0.8 ZP Dev Team zp50_grenade_fi running
[130] [ZP] Grenade: Frost 5.0.8 ZP Dev Team zp50_grenade_fr running
[131] [ZP] Grenade: Flare 5.0.8 ZP Dev Team zp50_grenade_fl running
[132] [ZP] ZP 4.3 Subplugin 5.0.8 ZP Dev Team zp50_zp43_compa running
[133] [ZP] Can Auto Save Amm 0.1.0 ZombArena.Ru zp_save.amxx running
[134] [ZP] Addon: Knifes 1.1 Mr.TheFold, reda zp_addon_knifes running
[135] [ZP] Sub-Plugin: Parac 1.1 Random1, 93()|29 zbg_addons_para running
[136] New ZP Ammo-Menu 0.1 Sanya@ zp_ammomenu.amx running
[137] [ZP] ZP++ Ice Cube 1.0 DareDevil (Gyiov zp50_ice_cube.a running
[138] [ZP]Level System 6.0 Dambas zp_level_system running
[139] [ZP] Admin Lvl Menu 1.0 Dambas zp_level_admin_ running
[140] [ZP] Addon: Perfect La 4.2 [P]erfec[T] [S]c zp_lasermine_pe running
[141] No Survivor Recoil v1.0 Stone/Mog zp_no_survivor. running
[142] [ZP] DHUD Informer 0.0.0.1 Andrei zp_score.amxx running
[143] By_neo_countdown 1.0 NEO zp_countdown.am running
[144] AdvancedHook 1.0 _RedGamer_ zp_hook_advance running
[145] ZM VIP 1.7.2 aaarnas zm_vip.amxx running
[146] Vip Menu ip Menu p Menu zp_vip_menu.amx running
[147] Super Vip Menu uper Vip M per Vip Menu zp_supervip_men running
[148] Owner Menu wner Menu ner Menu zp_owner_menu.a running
[149] Creator Menu reator Men eator Menu zp_creator_menu running
[150] MultiJump Advanced 1.0 _RedGamer_ zp_multijump.am running
150 plugins, 142 running
Автор плагина
[YouTube]COBA
Версия плагина
1.0
Исходный код
#pragma compress 1

#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <fakemeta_util>
#include <fun>
#include <hamsandwich>
#include <xs>
#include <cstrike>
#include <zombieplague>

#pragma tabsize 0

#define ENG_NULLENT -1
#define EV_INT_WEAPONKEY EV_INT_impulse
#define scsr_WEAPONKEY 10018
#define MAX_PLAYERS 32
#define IsValidUser(%1) (1 <= %1 <= g_MaxPlayers)

const USE_STOPPED = 0
const OFFSET_ACTIVE_ITEM = 373
const OFFSET_WEAPONOWNER = 41
const OFFSET_LINUX = 5
const OFFSET_LINUX_WEAPONS = 4

#define WEAP_LINUX_XTRA_OFF 4
#define m_fKnown 44
#define m_flNextPrimaryAttack 46
#define m_flTimeWeaponIdle 48
#define m_iClip 51
#define m_fInReload 54
#define PLAYER_LINUX_XTRA_OFF 5
#define m_flNextAttack 83

#define scsr_RELOAD_TIME 4.0
#define scsr_SHOOT1 1
#define scsr_SHOOT2 2
#define scsr_RELOAD 3
#define scsr_DRAW 4

#define write_coord_f(%1) engfunc(EngFunc_WriteCoord,%1)

new const Fire_Sounds[][] = { "CounterStrikeOnline/starchasersr-1.wav" }

new scsr_V_MODEL[64] = "models/CounterStrikeOnline/v_starchasersr.mdl"
new scsr_P_MODEL[64] = "models/CounterStrikeOnline/p_starchasersr.mdl"
new scsr_W_MODEL[64] = "models/CounterStrikeOnline/w_starchasersr.mdl"

new const scsr_name[] = "CounterStrikeOnline/weapon_starchasersr"

new const scsr_spr[][] =
{
"sprites/CounterStrikeOnline/huds/640hud171.spr",
"sprites/CounterStrikeOnline/huds/640hud18.spr"
}

new const GUNSHOT_DECALS[] = { 41, 42, 43, 44, 45 }

new cvar_dmg_scsr, cvar_recoil_scsr, cvar_clip_scsr, cvar_spd_scsr, cvar_scsr_ammo
new g_MaxPlayers, g_orig_event_scsr, g_IsInPrimaryAttack
new Float:cl_pushangle[MAX_PLAYERS + 1][3]
new g_has_scsr[33], g_clip_ammo[33], g_scsr_TmpClip[33], oldweap[33]
new gmsgWeaponList, scsr_ball
new g_SprID
new Float:g_lastexpl[33]

const PRIMARY_WEAPONS_BIT_SUM =
(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)
new const WEAPONENTNAMES[][] = { "", "weapon_p228", "", "weapon_scout", "weapon_hegrenade", "weapon_xm1014", "weapon_c4", "weapon_mac10",
"weapon_aug", "weapon_smokegrenade", "weapon_elite", "weapon_fiveseven", "weapon_ump45", "weapon_sg550",
"weapon_galil", "weapon_famas", "weapon_usp", "weapon_glock18", "weapon_awp", "weapon_mp5navy", "weapon_m249",
"weapon_m3", "weapon_m4a1", "weapon_tmp", "weapon_g3sg1", "weapon_flashbang", "weapon_deagle", "weapon_sg552",
"weapon_ak47", "weapon_knife", "weapon_p90" }

public plugin_init()
{
register_plugin("[CounterStrikeOnline] Star Chaser SR", "1.0", "[YouTube]COBA")
register_message(get_user_msgid("DeathMsg"), "message_DeathMsg")
register_event("CurWeapon","CurrentWeapon","be","1=1")
RegisterHam(Ham_Item_AddToPlayer, "weapon_g3sg1", "fw_scsr_AddToPlayer")
RegisterHam(Ham_Use, "func_tank", "fw_UseStationary_Post", 1)
RegisterHam(Ham_Use, "func_tankmortar", "fw_UseStationary_Post", 1)
RegisterHam(Ham_Use, "func_tankrocket", "fw_UseStationary_Post", 1)
RegisterHam(Ham_Use, "func_tanklaser", "fw_UseStationary_Post", 1)
for (new i = 1; i < sizeof WEAPONENTNAMES; i++)
if (WEAPONENTNAMES[i][0]) RegisterHam(Ham_Item_Deploy, WEAPONENTNAMES[i], "fw_Item_Deploy_Post", 1)
RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_g3sg1", "fw_scsr_PrimaryAttack")
RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_g3sg1", "fw_scsr_PrimaryAttack_Post", 1)
RegisterHam(Ham_Item_PostFrame, "weapon_g3sg1", "scsr_ItemPostFrame")
RegisterHam(Ham_Weapon_Reload, "weapon_g3sg1", "scsr_Reload")
RegisterHam(Ham_Weapon_Reload, "weapon_g3sg1", "scsr_Reload_Post", 1)
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
register_forward(FM_SetModel, "fw_SetModel")
register_forward(FM_UpdateClientData, "fw_UpdateClientData_Post", 1)
register_forward(FM_PlaybackEvent, "fwPlaybackEvent")

gmsgWeaponList = get_user_msgid("WeaponList")

RegisterHam(Ham_TraceAttack, "worldspawn", "fw_TraceAttack", 1)
RegisterHam(Ham_TraceAttack, "func_breakable", "fw_TraceAttack", 1)
RegisterHam(Ham_TraceAttack, "func_wall", "fw_TraceAttack", 1)
RegisterHam(Ham_TraceAttack, "func_door", "fw_TraceAttack", 1)
RegisterHam(Ham_TraceAttack, "func_door_rotating", "fw_TraceAttack", 1)
RegisterHam(Ham_TraceAttack, "func_plat", "fw_TraceAttack", 1)
RegisterHam(Ham_TraceAttack, "func_rotating", "fw_TraceAttack", 1)

cvar_dmg_scsr = register_cvar("zp_scsr_dmg", "6.0")
cvar_recoil_scsr = register_cvar("zp_scsr_recoil", "1.90")
cvar_clip_scsr = register_cvar("zp_scsr_clip", "15")
cvar_spd_scsr = register_cvar("zp_scsr_spd", "2.48")
cvar_scsr_ammo = register_cvar("zp_scsr_ammo", "120")

register_clcmd("get_starchaser", "give_scsr", ADMIN_KICK)
register_clcmd("scsr_name", "command_scsr")

g_MaxPlayers = get_maxplayers()
}

public plugin_precache()
{
precache_model(scsr_V_MODEL)
precache_model(scsr_P_MODEL)
precache_model(scsr_W_MODEL)
for(new i = 0; i < sizeof Fire_Sounds; i++)
precache_sound(Fire_Sounds[i])
precache_sound("CounterStrikeOnline/starchasersr_clipin.wav")
precache_sound("CounterStrikeOnline/starchasersr_clipout.wav")
precache_sound("CounterStrikeOnline/starchasersr_idle.wav")

g_SprID = precache_model("sprites/CounterStrikeOnline/ef_starchasersr_explosion.spr")
scsr_ball = precache_model("sprites/CounterStrikeOnline/ef_starchasersr_star.spr")

new sFile[64]
formatex(sFile, charsmax(sFile), "sprites/%s.txt", scsr_name)
precache_generic(sFile)

for(new i = 0; i < sizeof(scsr_spr); i++)
{
precache_generic(scsr_spr[i])
}

register_forward(FM_PrecacheEvent, "fwPrecacheEvent_Post", 1)
}

public fw_TraceAttack(iEnt, iAttacker, Float:flDamage, Float:fDir[3], ptr, iDamageType, Player, id)
{
if(!is_user_alive(iAttacker))
return

new g_currentweapon = get_user_weapon(iAttacker)

if(g_currentweapon != CSW_G3SG1) return

if(!g_has_scsr[iAttacker]) return

static Float:flEnd[3]
get_tr2(ptr, TR_vecEndPos, flEnd)

if(iEnt)
{
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_DECAL)
write_coord_f(flEnd[0])
write_coord_f(flEnd[1])
write_coord_f(flEnd[2])
write_byte(GUNSHOT_DECALS[random_num (0, sizeof GUNSHOT_DECALS -1)])
write_short(iEnt)
message_end()
}
else
{
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_WORLDDECAL)
write_coord_f(flEnd[0])
write_coord_f(flEnd[1])
write_coord_f(flEnd[2])
write_byte(GUNSHOT_DECALS[random_num (0, sizeof GUNSHOT_DECALS -1)])
message_end()
}
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_GUNSHOTDECAL)
write_coord_f(flEnd[0])
write_coord_f(flEnd[1])
write_coord_f(flEnd[2])
write_short(iAttacker)
write_byte(GUNSHOT_DECALS[random_num (0, sizeof GUNSHOT_DECALS -1)])
message_end()
}

public command_scsr(Player)
{
engclient_cmd(Player, "weapon_g3sg1")
return PLUGIN_HANDLED
}

public plugin_natives ()
{
register_native("give_weapon_scsr", "native_give_weapon_add", 1)
}
public native_give_weapon_add(id)
{
give_scsr(id)
}

public fwPrecacheEvent_Post(type, const name[])
{
if (equal("events/g3sg1.sc", name))
{
g_orig_event_scsr = get_orig_retval()
return FMRES_HANDLED
}
return FMRES_IGNORED
}

public client_connect(id)
{
g_has_scsr[id] = false
}

public client_disconnect(id)
{
g_has_scsr[id] = false
}

public fw_SetModel(entity, model[])
{
if(!is_valid_ent(entity))
return FMRES_IGNORED

static szClassName[33]
entity_get_string(entity, EV_SZ_classname, szClassName, charsmax(szClassName))

if(!equal(szClassName, "weaponbox"))
return FMRES_IGNORED

static iOwner

iOwner = entity_get_edict(entity, EV_ENT_owner)

if(equal(model, "models/w_g3sg1.mdl"))
{
static iStoredAugID

iStoredAugID = find_ent_by_owner(ENG_NULLENT, "weapon_g3sg1", entity)

if(!is_valid_ent(iStoredAugID))
return FMRES_IGNORED

if(g_has_scsr[iOwner])
{
entity_set_int(iStoredAugID, EV_INT_WEAPONKEY, scsr_WEAPONKEY)

g_has_scsr[iOwner] = false

entity_set_model(entity, scsr_W_MODEL)

return FMRES_SUPERCEDE
}
}
return FMRES_IGNORED
}

public give_scsr(id)
{
drop_weapons(id, 1)
new iWep2 = give_item(id,"weapon_g3sg1")
if( iWep2 > 0 )
{
cs_set_weapon_ammo(iWep2, get_pcvar_num(cvar_clip_scsr))
cs_set_user_bpammo (id, CSW_G3SG1, get_pcvar_num(cvar_scsr_ammo))
UTIL_PlayWeaponAnimation(id, scsr_DRAW)
set_pdata_float(id, m_flNextAttack, 1.0, PLAYER_LINUX_XTRA_OFF)

g_has_scsr[id] = true
message_begin(MSG_ONE, gmsgWeaponList, {0,0,0}, id)
write_string("scsr_name")
write_byte(2)
write_byte(90)
write_byte(-1)
write_byte(-1)
write_byte(0)
write_byte(3)
write_byte(CSW_G3SG1)
message_end()
}
return PLUGIN_HANDLED;
}

public fw_scsr_AddToPlayer(scsr, id)
{
if(!is_valid_ent(scsr) || !is_user_connected(id))
return HAM_IGNORED

if(entity_get_int(scsr, EV_INT_WEAPONKEY) == scsr_WEAPONKEY)
{
g_has_scsr[id] = true

entity_set_int(scsr, EV_INT_WEAPONKEY, 0)

message_begin(MSG_ONE, gmsgWeaponList, {0,0,0}, id)
write_string("scsr_name")
write_byte(2)
write_byte(90)
write_byte(-1)
write_byte(-1)
write_byte(0)
write_byte(3)
write_byte(CSW_G3SG1)
message_end()

return HAM_HANDLED
}
else
{
message_begin(MSG_ONE, gmsgWeaponList, _, id)
write_string("weapon_g3sg1")
write_byte(2)
write_byte(90)
write_byte(-1)
write_byte(-1)
write_byte(0)
write_byte(3)
write_byte(CSW_G3SG1)
message_end()
}
return HAM_IGNORED
}

public fw_UseStationary_Post(entity, caller, activator, use_type)
{
if (use_type == USE_STOPPED && is_user_connected(caller))
replace_weapon_models(caller, get_user_weapon(caller))
}

public fw_Item_Deploy_Post(weapon_ent)
{
static owner
owner = fm_cs_get_weapon_ent_owner(weapon_ent)

static weaponid
weaponid = cs_get_weapon_id(weapon_ent)

replace_weapon_models(owner, weaponid)
}

public CurrentWeapon(id)
{
replace_weapon_models(id, read_data(2))

if(read_data(2) != CSW_G3SG1 || !g_has_scsr[id])
return

static Float:iSpeed
if(g_has_scsr[id])
iSpeed = get_pcvar_float(cvar_spd_scsr)

static weapon[32],Ent
get_weaponname(read_data(2),weapon,31)
Ent = find_ent_by_owner(-1,weapon,id)
if(Ent)
{
static Float:Delay
Delay = get_pdata_float( Ent, 46, 4) * iSpeed
if (Delay > 0.0)
{
set_pdata_float(Ent, 46, Delay, 4)
}
}
}

replace_weapon_models(id, weaponid)
{
switch (weaponid)
{
case CSW_G3SG1:
{
if (zp_get_user_zombie(id) || zp_get_user_nemesis(id) || zp_get_user_survivor(id))
return

if(g_has_scsr[id])
{
set_pev(id, pev_viewmodel2, scsr_V_MODEL)
set_pev(id, pev_weaponmodel2, scsr_P_MODEL)
if(oldweap[id] != CSW_G3SG1)
{
UTIL_PlayWeaponAnimation(id, scsr_DRAW)
set_pdata_float(id, m_flNextAttack, 1.0, PLAYER_LINUX_XTRA_OFF)

message_begin(MSG_ONE, gmsgWeaponList, _, id)
write_string("scsr_name")
write_byte(2)
write_byte(90)
write_byte(-1)
write_byte(-1)
write_byte(0)
write_byte(3)
write_byte(CSW_G3SG1)
message_end()
}
}
}
}
oldweap[id] = weaponid
}

public fw_UpdateClientData_Post(Player, SendWeapons, CD_Handle)
{
if(!is_user_alive(Player) || (get_user_weapon(Player) != CSW_G3SG1 || !g_has_scsr[Player]))
return FMRES_IGNORED

set_cd(CD_Handle, CD_flNextAttack, halflife_time () + 0.001)
return FMRES_HANDLED
}

public fw_scsr_PrimaryAttack(Weapon)
{
new Player = get_pdata_cbase(Weapon, 41, 4)

if (!g_has_scsr[Player])
return

g_IsInPrimaryAttack = 1
pev(Player,pev_punchangle,cl_pushangle[Player])

g_clip_ammo[Player] = cs_get_weapon_ammo(Weapon)
}

public fwPlaybackEvent(flags, invoker, eventid, Float:delay, Float:origin[3], Float:angles[3], Float:fparam1, Float:fparam2, iParam1, iParam2, bParam1, bParam2)
{
if ((eventid != g_orig_event_scsr) || !g_IsInPrimaryAttack)
return FMRES_IGNORED
if (!(1 <= invoker <= g_MaxPlayers))
return FMRES_IGNORED

playback_event(flags | FEV_HOSTONLY, invoker, eventid, delay, origin, angles, fparam1, fparam2, iParam1, iParam2, bParam1, bParam2)
return FMRES_SUPERCEDE
}

public fw_scsr_PrimaryAttack_Post(Weapon)
{
g_IsInPrimaryAttack = 0
new iPlayer = get_pdata_cbase(Weapon, 41, 4)

new szClip, szAmmo
get_user_weapon(iPlayer, szClip, szAmmo)

if(!is_user_alive(iPlayer))
return

if(g_has_scsr[iPlayer])
{
if (!g_clip_ammo[iPlayer])
return

new Float:push[3]
pev(iPlayer,pev_punchangle,push)
xs_vec_sub(push,cl_pushangle[iPlayer],push)

xs_vec_mul_scalar(push,get_pcvar_float(cvar_recoil_scsr),push)
xs_vec_add(push,cl_pushangle[iPlayer],push)
set_pev(iPlayer,pev_punchangle,push)

emit_sound(iPlayer, CHAN_WEAPON, Fire_Sounds[0], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
UTIL_PlayWeaponAnimation(iPlayer, random_num(scsr_SHOOT1, scsr_SHOOT2))

static Float:plrViewAngles[3], Float:VecEnd[3], Float:VecDir[3], Float:PlrOrigin[3]
pev(iPlayer, pev_v_angle, plrViewAngles)

static Float:VecSrc[3], Float:VecDst[3]

//VecSrc = pev->origin + pev->view_ofs
pev(iPlayer, pev_origin, PlrOrigin)
pev(iPlayer, pev_view_ofs, VecSrc)
xs_vec_add(VecSrc, PlrOrigin, VecSrc)

//VecDst = VecDir * 8192.0
angle_vector(plrViewAngles, ANGLEVECTOR_FORWARD, VecDir)
xs_vec_mul_scalar(VecDir, 8192.0, VecDst)
xs_vec_add(VecDst, VecSrc, VecDst)

new hTrace = create_tr2()
engfunc(EngFunc_TraceLine, VecSrc, VecDst, 0, iPlayer, hTrace)
get_tr2(hTrace, TR_vecEndPos, VecEnd)

explode(iPlayer);
scsr_spr_ball(iPlayer, VecSrc, VecEnd);
}
}

public explode(id)
{
if(is_user_alive(id))
{
new Float:originF[3]
fm_get_aim_origin(id, originF)
message_begin(MSG_ALL, SVC_TEMPENTITY)
write_byte(TE_SPARKS)
engfunc(EngFunc_WriteCoord, originF[0])
engfunc(EngFunc_WriteCoord, originF[1])
engfunc(EngFunc_WriteCoord, originF[2]+30.0)
message_end()

message_begin(MSG_ALL, SVC_TEMPENTITY)
write_byte(TE_SPARKS)
engfunc(EngFunc_WriteCoord, originF[0]+30.0)
engfunc(EngFunc_WriteCoord, originF[1])
engfunc(EngFunc_WriteCoord, originF[2]+30.0)
message_end()

message_begin(MSG_ALL, SVC_TEMPENTITY)
write_byte(TE_SPARKS)
engfunc(EngFunc_WriteCoord, originF[0])
engfunc(EngFunc_WriteCoord, originF[1]+30.0)
engfunc(EngFunc_WriteCoord, originF[2]+30.0)
message_end()

message_begin(MSG_ALL, SVC_TEMPENTITY)
write_byte(TE_SPARKS)
engfunc(EngFunc_WriteCoord, originF[0])
engfunc(EngFunc_WriteCoord, originF[1]+40.0)
engfunc(EngFunc_WriteCoord, originF[2]+40.0)
message_end()

message_begin(MSG_ALL, SVC_TEMPENTITY)
write_byte(TE_SPARKS)
engfunc(EngFunc_WriteCoord, originF[0])
engfunc(EngFunc_WriteCoord, originF[1]+40.0)
engfunc(EngFunc_WriteCoord, originF[2]+30.0)
message_end()

message_begin(MSG_ALL, SVC_TEMPENTITY)
write_byte(TE_SPARKS)
engfunc(EngFunc_WriteCoord, originF[0])
engfunc(EngFunc_WriteCoord, originF[1]+30.0)
engfunc(EngFunc_WriteCoord, originF[2]+40.0)
message_end()

// Draw explosion
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_SPRITE) // Temporary entity ID
engfunc(EngFunc_WriteCoord, originF[0]) // engfunc because float
engfunc(EngFunc_WriteCoord, originF[1])
engfunc(EngFunc_WriteCoord, originF[2]+40.0)
write_short(g_SprID) // Sprite index
write_byte(8) // Scale
write_byte(255) // Framerate
message_end()

new a = FM_NULLENT
while((a = find_ent_in_sphere(a, originF, 60.0)) != 0)
{
if (id == a)
continue

if(pev(a, pev_takedamage) != DAMAGE_NO)
{
ExecuteHamB(Ham_TakeDamage, a, id, id, 50.0, DMG_BULLET)
}
}
return PLUGIN_HANDLED
}
return PLUGIN_HANDLED
}

public fw_TakeDamage(victim, inflictor, attacker, Float:damage, ent)
{
if (victim != attacker && is_user_connected(attacker))
{
if(get_user_weapon(attacker) == CSW_G3SG1)
{
if(g_has_scsr[attacker])
SetHamParamFloat(4, damage * get_pcvar_float(cvar_dmg_scsr))
}
}
}

public message_DeathMsg(msg_id, msg_dest, id)
{
static szTruncatedWeapon[33], iAttacker, iVictim

get_msg_arg_string(4, szTruncatedWeapon, charsmax(szTruncatedWeapon))

iAttacker = get_msg_arg_int(1)
iVictim = get_msg_arg_int(2)

if(!is_user_connected(iAttacker) || iAttacker == iVictim)
return PLUGIN_CONTINUE

if(equal(szTruncatedWeapon, "sg550") && get_user_weapon(iAttacker) == CSW_G3SG1)
{
if(g_has_scsr[iAttacker])
set_msg_arg_string(4, "sg550")
}
return PLUGIN_CONTINUE
}

stock fm_cs_get_current_weapon_ent(id)
{
return get_pdata_cbase(id, OFFSET_ACTIVE_ITEM, OFFSET_LINUX)
}

stock fm_cs_get_weapon_ent_owner(ent)
{
return get_pdata_cbase(ent, OFFSET_WEAPONOWNER, OFFSET_LINUX_WEAPONS)
}

stock UTIL_PlayWeaponAnimation(const Player, const Sequence)
{
set_pev(Player, pev_weaponanim, Sequence)

message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, .player = Player)
write_byte(Sequence)
write_byte(pev(Player, pev_body))
message_end()
}

public scsr_ItemPostFrame(weapon_entity)
{
new id = pev(weapon_entity, pev_owner)
if (!is_user_connected(id))
return HAM_IGNORED

if (!g_has_scsr[id])
return HAM_IGNORED

static iClipExtra

iClipExtra = get_pcvar_num(cvar_clip_scsr)
new Float:flNextAttack = get_pdata_float(id, m_flNextAttack, PLAYER_LINUX_XTRA_OFF)

new iBpAmmo = cs_get_user_bpammo(id, CSW_G3SG1)
new iClip = get_pdata_int(weapon_entity, m_iClip, WEAP_LINUX_XTRA_OFF)

new fInReload = get_pdata_int(weapon_entity, m_fInReload, WEAP_LINUX_XTRA_OFF)

if(!(get_user_button(id) & IN_ATTACK))
g_lastexpl[id] = get_gametime()

if( fInReload && flNextAttack <= 0.0 )
{
new j = min(iClipExtra - iClip, iBpAmmo)

set_pdata_int(weapon_entity, m_iClip, iClip + j, WEAP_LINUX_XTRA_OFF)
cs_set_user_bpammo(id, CSW_G3SG1, iBpAmmo-j)

set_pdata_int(weapon_entity, m_fInReload, 0, WEAP_LINUX_XTRA_OFF)
fInReload = 0
}
return HAM_IGNORED
}

public scsr_Reload(weapon_entity)
{
new id = pev(weapon_entity, pev_owner)
if (!is_user_connected(id))
return HAM_IGNORED

if (!g_has_scsr[id])
return HAM_IGNORED

static iClipExtra

if(g_has_scsr[id])
iClipExtra = get_pcvar_num(cvar_clip_scsr)

g_scsr_TmpClip[id] = -1

new iBpAmmo = cs_get_user_bpammo(id, CSW_G3SG1)
new iClip = get_pdata_int(weapon_entity, m_iClip, WEAP_LINUX_XTRA_OFF)

if (iBpAmmo <= 0)
return HAM_SUPERCEDE

if (iClip >= iClipExtra)
return HAM_SUPERCEDE

g_scsr_TmpClip[id] = iClip

return HAM_IGNORED
}

public scsr_Reload_Post(weapon_entity)
{
new id = pev(weapon_entity, pev_owner)
if (!is_user_connected(id))
return HAM_IGNORED

if (!g_has_scsr[id])
return HAM_IGNORED

if (g_scsr_TmpClip[id] == -1)
return HAM_IGNORED

set_pdata_int(weapon_entity, m_iClip, g_scsr_TmpClip[id], WEAP_LINUX_XTRA_OFF)

set_pdata_float(weapon_entity, m_flTimeWeaponIdle, scsr_RELOAD_TIME, WEAP_LINUX_XTRA_OFF)

set_pdata_float(id, m_flNextAttack, scsr_RELOAD_TIME, PLAYER_LINUX_XTRA_OFF)

set_pdata_int(weapon_entity, m_fInReload, 1, WEAP_LINUX_XTRA_OFF)

UTIL_PlayWeaponAnimation(id, scsr_RELOAD)

return HAM_IGNORED
}

stock scsr_spr_ball(id, Float:fVec1[3], Float:fVec2[3])
{
static iVec1[3]
FVecIVec(fVec1, iVec1)

static Float:origin[3], Float:vSrc[3], Float:angles[3], Float:v_forward[3], Float:v_right[3], Float:v_up[3], Float:gun_position[3], Float:player_origin[3], Float:player_view_offset[3]
pev(id, pev_v_angle, angles)
engfunc(EngFunc_MakeVectors, angles)
global_get(glb_v_forward, v_forward)
global_get(glb_v_right, v_right)
global_get(glb_v_up, v_up)

//m_pPlayer->GetGunPosition( ) = pev->origin + pev->view_ofs
pev(id, pev_origin, player_origin)
pev(id, pev_view_ofs, player_view_offset)
xs_vec_add(player_origin, player_view_offset, gun_position)

xs_vec_mul_scalar(v_forward, 24.0, v_forward)
xs_vec_mul_scalar(v_right, 3.0, v_right)

if ((pev(id, pev_flags) & FL_DUCKING) == FL_DUCKING)
xs_vec_mul_scalar(v_up, 6.0, v_up)
else
xs_vec_mul_scalar(v_up, -2.0, v_up)

xs_vec_add(gun_position, v_forward, origin)
xs_vec_add(origin, v_right, origin)
xs_vec_add(origin, v_up, origin)

vSrc[0] = origin[0]
vSrc[1] = origin[1]
vSrc[2] = origin[2]

new Float:dist = get_distance_f(vSrc, fVec2)
new CountDrops = floatround(dist / 50.0)

if (CountDrops > 20)
CountDrops = 20

if (CountDrops < 2)
CountDrops = 2

message_begin(MSG_PAS, SVC_TEMPENTITY, iVec1)
write_byte(TE_SPRITETRAIL)
engfunc(EngFunc_WriteCoord, vSrc[0])
engfunc(EngFunc_WriteCoord, vSrc[1])
engfunc(EngFunc_WriteCoord, vSrc[2])
engfunc(EngFunc_WriteCoord, fVec2[0])
engfunc(EngFunc_WriteCoord, fVec2[1])
engfunc(EngFunc_WriteCoord, fVec2[2])
write_short(scsr_ball)
write_byte(CountDrops)
write_byte(0)
write_byte(1)
write_byte(60)
write_byte(10)
message_end()
}

stock drop_weapons(id, dropwhat)
{
static weapons[32], num, i, weaponid
num = 0
get_user_weapons(id, weapons, num)

for (i = 0; i < num; i++)
{
weaponid = weapons[i]

if (dropwhat == 1 && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM))
{
static wname[32]
get_weaponname(weaponid, wname, sizeof wname - 1)
engclient_cmd(id, "drop", wname)
}
}
}
Здравствуйте, я оружие с Extra Items переделал на выдачу по нативам.. у меня проблема, спрайты веапонлиста на Extra Items работали нормально, но патроны также съехали, только перевел на натив и пропал спрайт веапонлиста и патроны конечно тоже остались съехавшиеся, кто не понял меня. Саму функцию Extra Item'а я удалил из кода.. Вот скрины неправильных спрайтов
 
В этой теме было размещено решение! Перейти к решению.

Download all Attachments

Сообщения
1,042
Реакции
206
Предупреждения
1
Помог
6 раз(а)
Советую изучить работу с нативами, а не заниматься ерундой.
 
Сообщения
892
Реакции
149
Помог
25 раз(а)
Вопрос.
Почему веапонлист указан один:
C++:
new const scsr_name[] = "CounterStrikeOnline/weapon_starchasersr"
А команду ты регаешь не с название веапонлиста?
C++:
register_clcmd("scsr_name", "command_scsr")
Сделай так:
Diff:
-register_clcmd("scsr_name", "command_scsr")
+register_clcmd(scsr_name, "command_scsr")
2 Май 2023
И еще, а разве нужно засылать веапонлист в момент выдачи оружия через команду/натив, если он уже вызывается в AddItemToPlayer?
 
Сообщения
418
Реакции
-7
Предупреждения
8
Решил
В функции выдачи, т.е give_scsr(id)

Код:
-write_string("scsr_name")
+write_string(scsr_name)
2 Май 2023
Спасибо ImmortalAmxx
 
Статус
В этой теме нельзя размещать новые ответы.

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу