RU
RU
UA
EN
PL
ГЛАВНАЯ
УСЛУГИ
ПЛАГИНЫ
КАРТЫ
REBUY
SCANMON
CASSA
SALE
ФОРУМ
МОНИТОР
HELP
КОНТАКТ
Главная
/
Plugins
/
real_weapon_drop
real_weapon_drop
Теги:
Скачать плагины cs
Эффекты
Теперь когда вы будете выкидывает оружие в верх оно будет лететь в верх, а не как раньше тут же падает на землю. И всё это благодаря плагину
Компилятор: 1.8.2 Multibild
953
Команды:
Кваров и команд нет
.sma / .sp
#include
#include
#include
#include
#include
#define PLUGIN_NAME "Real Weapon Drop" #define PLUGIN_VERSION "1.4" #define PLUGIN_AUTHOR "Numb" new maxplayers; new get_user_msgid_AmmoPickup; new Array:ammo_entery_datas; new ammo_entery_num; new alive[33]; new cs_ammo_weapons[10] = { CSW_AWP, CSW_SCOUT, CSW_M249, CSW_M4A1, CSW_M3, CSW_USP, CSW_FIVESEVEN, CSW_DEAGLE, CSW_P228, CSW_GLOCK18 }; new cs_ammo_max[10] = { 30, 90, 200, 90, 32, 100, 100, 35, 52, 120 }; new cs_ammo_id[10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; new const ammo_model[] = "models/w_357ammobox.mdl"; new const ammo_sound[] = "items/9mmclip2.wav"; // cs standart - "items/9mmclip1.wav" public plugin_precache() { precache_model(ammo_model); precache_sound(ammo_sound); } public plugin_init() { register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR); RegisterHam(Ham_Spawn, "weaponbox", "Ham_FOSpawn_weaponbox", 1); RegisterHam(Ham_Killed, "weaponbox", "Ham_FEKilled_weaponbox", 0); RegisterHam(Ham_Think, "weaponbox", "Ham_FEThink_weaponbox", 0); RegisterHam(Ham_Touch, "weaponbox", "Ham_FETouch_weaponbox", 0); RegisterHam(Ham_Spawn, "player", "Ham_FOSpawn_player", 1); RegisterHam(Ham_Killed, "player", "Ham_FEKilled_player", 0); RegisterHam(Ham_Touch, "armoury_entity", "Ham_FETouch_armoury_entity", 0); RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_hegrenade", "Ham_FOWeapon_PrimaryAttack_he", 1); RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_flashbang", "Ham_FOWeapon_PrimaryAttack_fb", 1); RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_smokegrenade", "Ham_FOWeapon_PrimaryAttack_sg", 1); register_event("HLTV", "Event_NewRound", "a", "1=0", "2=0"); register_event("CurWeapon", "Event_CurWeapon", "be"); get_user_msgid_AmmoPickup = get_user_msgid("AmmoPickup"); ammo_entery_datas = ArrayCreate(64); maxplayers = get_maxplayers(); } public Event_NewRound() { new view[32]; if( ammo_entery_num ) { new buffer[64], s_ent[5], ent; for( new item; item < ammo_entery_num; item++ ) { ArrayGetString(ammo_entery_datas, item, buffer, 63); replace_all(buffer, 63, "_", " "); parse(buffer, s_ent, 4); ent = str_to_num(s_ent); if( pev_valid(ent) ) { pev(ent, pev_classname, view, 31); if( equal(view, "weaponbox") ) { pev(ent, pev_model, view, 31); if( equal(view, ammo_model) ) { set_pev(ent, pev_solid, SOLID_NOT); dllfunc(DLLFunc_Think, ent); engfunc(EngFunc_RemoveEntity, ent); } } } } ArrayClear(ammo_entery_datas); ammo_entery_num = 0; } new ent = -1, owner; while( (ent=engfunc(EngFunc_FindEntityByString, ent, "classname", "weaponbox"))>0 ) { pev(ent, pev_model, view, 31); if( equal(view, ammo_model) ) { set_pev(ent, pev_solid, SOLID_NOT); dllfunc(DLLFunc_Think, ent); engfunc(EngFunc_RemoveEntity, ent); } } ent = -1; while( (ent=engfunc(EngFunc_FindEntityByString, ent, "classname", "armoury_entity"))>0 ) { owner = pev(ent, pev_owner); if( owner > 0 && owner <= maxplayers ) { dllfunc(DLLFunc_Think, ent); engfunc(EngFunc_RemoveEntity, ent); } } } public Event_CurWeapon(id) { if( alive[id] ) alive[id] = 1; } public Ham_FEThink_weaponbox(weaponbox_ent) { if( !ammo_entery_num ) return HAM_IGNORED; new buffer[64]; pev(weaponbox_ent, pev_model, buffer, 31); if( !equal(buffer, ammo_model) ) return HAM_IGNORED; new s_ent[5]; for( new item; item < ammo_entery_num; item++ ) { ArrayGetString(ammo_entery_datas, item, buffer, 63); replace_all(buffer, 63, "_", " "); parse(buffer, s_ent, 4); if( str_to_num(s_ent)==weaponbox_ent ) { ArrayDeleteItem2(ammo_entery_datas, item); ammo_entery_num--; return HAM_IGNORED; } } return HAM_IGNORED; } public Ham_FEKilled_weaponbox(weaponbox_ent, idattacker, shouldgib) { if( !ammo_entery_num ) return HAM_IGNORED; new buffer[64]; pev(weaponbox_ent, pev_model, buffer, 31); if( !equal(buffer, ammo_model) ) return HAM_IGNORED; new s_ent[5]; for( new item; item < ammo_entery_num; item++ ) { ArrayGetString(ammo_entery_datas, item, buffer, 63); replace_all(buffer, 63, "_", " "); parse(buffer, s_ent, 4); if( str_to_num(s_ent)==weaponbox_ent ) { ArrayDeleteItem2(ammo_entery_datas, item); ammo_entery_num--; return HAM_IGNORED; } } return HAM_IGNORED; } public Ham_FOSpawn_weaponbox(weaponbox_ent) weaponbox_spawned(weaponbox_ent, pev(weaponbox_ent, pev_owner)); public weaponbox_spawned(weaponbox_ent, owner) { static classname[32]; if( owner ) pev(owner, pev_classname, classname, 31); else copy(classname, 31, ""); if( equal(classname, "player") ) { static Float:velocity[3]; pev(owner, pev_velocity, velocity); if( alive[owner] ) { static Float:aim_speed[3], Float:velocity[3]; pev(owner, pev_velocity, velocity); velocity_by_aim(owner, 200, aim_speed); velocity[0] += aim_speed[0]; velocity[1] += aim_speed[1]; velocity[2] += aim_speed[2]; } else if( !task_exists(weaponbox_ent) ) { set_pev(weaponbox_ent, pev_velocity, Float:{0.0, 0.0, 0.0}); set_task(0.01, "modify_death_speed", weaponbox_ent); } } } public modify_death_speed(weaponbox_ent) { if( pev_valid(weaponbox_ent) ) { static classname[32]; pev(weaponbox_ent, pev_classname, classname, 31); if( equal(classname, "weaponbox") || equal(classname, "armoury_entity") ) { static owner; owner = pev(weaponbox_ent, pev_owner); if( pev_valid(owner) ) { pev(owner, pev_classname, classname, 31); if( equal(classname, "player") ) { if( !alive[owner] && pev_valid(owner) ) { static Float:velocity[3]; pev(owner, pev_velocity, velocity); set_pev(weaponbox_ent, pev_velocity, velocity); } } } } } } public Ham_FOSpawn_player(id) alive[id] = 1; public Ham_FEKilled_player(victim, idattacker, shouldgib) { client_dies(victim); return HAM_IGNORED; } public client_disconnect(id) client_dies(id); public client_dies(id) { if( !alive[id] ) return; new buffer[64], pbammo, len, total_ammo, weaponbox_ent, Float:origin[3], Float:angles[3]; pev(id, pev_v_angle, angles); pev(id, pev_origin, origin); angles[0] = 0.0; if( (pbammo=clamp(cs_get_user_bpammo(id, CSW_HEGRENADE), 0, 254)-((alive[id]==CSW_HEGRENADE)?1:0))>0 ) { if( (weaponbox_ent=engfunc(EngFunc_CreateNamedEntity, (len=engfunc(EngFunc_AllocString, "armoury_entity"))))>0 ) { total_ammo = random_num(-22, 22); angles[1] += float(total_ammo); num_to_str(pbammo, buffer, 4); set_armoury_entity_kvd(weaponbox_ent, "15", buffer); dllfunc(DLLFunc_Spawn, weaponbox_ent); engfunc(EngFunc_SetOrigin, weaponbox_ent, origin); set_pev(weaponbox_ent, pev_angles, angles); set_pev(weaponbox_ent, pev_owner, id); set_pev(weaponbox_ent, pev_movetype, MOVETYPE_BOUNCE); set_pev(weaponbox_ent, pev_gravity, 1.0); weaponbox_spawned(weaponbox_ent, id); angles[1] -= float(total_ammo); if( alive[id] != CSW_HEGRENADE ) cs_set_user_bpammo(id, CSW_HEGRENADE, 0); } } if( (pbammo=clamp(cs_get_user_bpammo(id, CSW_FLASHBANG), 0, 254)-((alive[id]==CSW_FLASHBANG)?1:0))>0 ) { if( !len ) len = engfunc(EngFunc_AllocString, "armoury_entity"); if( (weaponbox_ent=engfunc(EngFunc_CreateNamedEntity, len))>0 ) { total_ammo = random_num(-22, 22); angles[1] += float(total_ammo); num_to_str(pbammo, buffer, 4); set_armoury_entity_kvd(weaponbox_ent, "14", buffer); dllfunc(DLLFunc_Spawn, weaponbox_ent); engfunc(EngFunc_SetOrigin, weaponbox_ent, origin); set_pev(weaponbox_ent, pev_angles, angles); set_pev(weaponbox_ent, pev_owner, id); set_pev(weaponbox_ent, pev_movetype, MOVETYPE_BOUNCE); set_pev(weaponbox_ent, pev_gravity, 1.0); weaponbox_spawned(weaponbox_ent, id); angles[1] -= float(total_ammo); if( alive[id] != CSW_FLASHBANG ) cs_set_user_bpammo(id, CSW_FLASHBANG, 0); } } if( (pbammo=clamp(cs_get_user_bpammo(id, CSW_SMOKEGRENADE), 0, 254)-((alive[id]==CSW_SMOKEGRENADE)?1:0))>0 ) { if( !len ) len = engfunc(EngFunc_AllocString, "armoury_entity"); if( (weaponbox_ent=engfunc(EngFunc_CreateNamedEntity, len))>0 ) { total_ammo = random_num(-22, 22); angles[1] += float(total_ammo); num_to_str(pbammo, buffer, 4); set_armoury_entity_kvd(weaponbox_ent, "18", buffer); dllfunc(DLLFunc_Spawn, weaponbox_ent); engfunc(EngFunc_SetOrigin, weaponbox_ent, origin); set_pev(weaponbox_ent, pev_angles, angles); set_pev(weaponbox_ent, pev_owner, id); set_pev(weaponbox_ent, pev_movetype, MOVETYPE_BOUNCE); set_pev(weaponbox_ent, pev_gravity, 1.0); weaponbox_spawned(weaponbox_ent, id); angles[1] -= float(total_ammo); if( alive[id] != CSW_SMOKEGRENADE ) cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 0); } } alive[id] = 0; new weapons[32], num, weapon_name[32]; get_user_weapons(id, weapons, num); for( new i; i < num; i++ ) { switch( weapons[i] ) { case CSW_HEGRENADE, CSW_SMOKEGRENADE, CSW_FLASHBANG, CSW_KNIFE: continue; default: { get_weaponname(weapons[i], weapon_name, 31); engclient_cmd(id, "drop", weapon_name); } } } len = 0; for( new i; i < 10; i++ ) { pbammo = clamp(cs_get_user_bpammo(id, cs_ammo_weapons[i]), 0, 254); len += format(buffer[len], 63-len, "%s%d", (i==0)?"":"_", pbammo); total_ammo += pbammo; } if( total_ammo>0 ) { if( (weaponbox_ent=engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "weaponbox")))>0 ) { dllfunc(DLLFunc_Spawn, weaponbox_ent); engfunc(EngFunc_SetModel, weaponbox_ent, ammo_model); engfunc(EngFunc_SetOrigin, weaponbox_ent, origin); set_pev(weaponbox_ent, pev_angles, angles); set_pev(weaponbox_ent, pev_owner, id); weaponbox_spawned(weaponbox_ent, id); format(buffer, 63, "%d_%s", weaponbox_ent, buffer); ArrayPushString(ammo_entery_datas, buffer); ammo_entery_num++; } } alive[id] = 0; } public Ham_FETouch_armoury_entity(ent, id) { if( id < 0 || id > maxplayers ) return FMRES_IGNORED; static owner; owner = pev(ent, pev_owner); if( owner < 1 || owner > maxplayers ) return FMRES_IGNORED; if( !(pev(ent, pev_flags)&FL_ONGROUND) ) return FMRES_SUPERCEDE; if( pev(ent, pev_effects)&EF_NODRAW ) { set_pev(ent, pev_solid, SOLID_NOT); engfunc(EngFunc_RemoveEntity, ent); return FMRES_SUPERCEDE; } return FMRES_IGNORED; } public Ham_FETouch_weaponbox(weaponbox_ent, id) { if( !ammo_entery_num ) return HAM_IGNORED; static classname[32]; pev(weaponbox_ent, pev_model, classname, 31); if( !equal(classname, ammo_model) ) return HAM_IGNORED; pev(id, pev_classname, classname, 31); if( equal(classname, "player") ) { static i, buffer[64], ent_id[5], s_ammo_values[10][4], ammo_values[10], item; for( item=0; item < ammo_entery_num; item++ ) { ArrayGetString(ammo_entery_datas, item, buffer, 63); replace_all(buffer, 63, "_", " "); parse(buffer, ent_id, 4, s_ammo_values[0], 3, s_ammo_values[1], 3, s_ammo_values[2], 3, s_ammo_values[3], 3, s_ammo_values[4], 3, s_ammo_values[5], 3, s_ammo_values[6], 3, s_ammo_values[7], 3, s_ammo_values[8], 3, s_ammo_values[9], 3); if( weaponbox_ent==str_to_num(ent_id) ) break; else copy(buffer, 63, ""); } if( !buffer[0] ) return HAM_IGNORED; for( i=0; i < 10; i++ ) ammo_values[i] = str_to_num(s_ammo_values[i]); if( !(pev(weaponbox_ent, pev_flags)&FL_ONGROUND) ) return HAM_SUPERCEDE; static user_ammo, total_new_user_ammo, new_user_ammo, total_ammo, ammo_values_changed; total_ammo = 0; ammo_values_changed = false; for( i=0; i < 10; i++ ) { if( ammo_values[i] ) { user_ammo = clamp(cs_get_user_bpammo(id, cs_ammo_weapons[i]), 0, 254); if( user_ammo
cs_ammo_max[i] ) ammo_values[i] = total_new_user_ammo-cs_ammo_max[i]; else ammo_values[i] = 0; message_begin(MSG_ONE_UNRELIABLE, get_user_msgid_AmmoPickup, {0, 0, 0}, id); write_byte(cs_ammo_id[i]); write_byte((new_user_ammo-user_ammo)); message_end(); cs_set_user_bpammo(id, cs_ammo_weapons[i], new_user_ammo); emit_sound(id, CHAN_ITEM, ammo_sound, 1.0, ATTN_NORM, 0, PITCH_NORM); if( !ammo_values_changed ) ammo_values_changed = true; } total_ammo += ammo_values[i]; } } if( !ammo_values_changed ) return HAM_SUPERCEDE; if( total_ammo ) { static len; len = format(buffer, 63, "%d", weaponbox_ent); for( i=0; i < 10; i++ ) len += format(buffer[len], 63-len, "_%d", ammo_values[i]); ArrayDeleteItem2(ammo_entery_datas, item); ArrayPushString(ammo_entery_datas, buffer); } else { set_pev(weaponbox_ent, pev_solid, SOLID_NOT); dllfunc(DLLFunc_Think, weaponbox_ent); engfunc(EngFunc_RemoveEntity, weaponbox_ent); ArrayDeleteItem2(ammo_entery_datas, item); ammo_entery_num--; } return HAM_SUPERCEDE; } return HAM_IGNORED; } public Ham_FOWeapon_PrimaryAttack_he(ent) grenade_attack(ent, CSW_HEGRENADE); public Ham_FOWeapon_PrimaryAttack_fb(ent) grenade_attack(ent, CSW_FLASHBANG); public Ham_FOWeapon_PrimaryAttack_sg(ent) grenade_attack(ent, CSW_SMOKEGRENADE); grenade_attack(ent, grenade_id) { static owner; owner = pev(ent, pev_owner); if( is_user_alive(owner) && user_has_weapon(owner, grenade_id) ) { alive[owner] = grenade_id; return 1; } return 0; } ArrayDeleteItem2(Array:arrayid, itemid) // Fix standart native and I will use it. Untill then - I'll use my way... { if( ammo_entery_num==1 ) ArrayClear(arrayid); else { static bool:temp_exists, Array:temp_array; if( !temp_exists ) { temp_array = ArrayCreate(64); temp_exists = true; } else ArrayClear(temp_array); new data[64], item; for( item = 0; item < ammo_entery_num; item++ ) { if( item!=itemid ) { ArrayGetString(arrayid, item, data, 63); ArrayPushString(temp_array, data); } } ArrayClear(arrayid); for( item = 0; item < (ammo_entery_num-1); item++ ) { ArrayGetString(temp_array, item, data, 63); ArrayPushString(arrayid, data); } } return 1; } set_armoury_entity_kvd(ent, const item_id[], const count[]) { set_kvd(0, KV_ClassName, "armoury_entity"); set_kvd(0, KV_KeyName, "item"); set_kvd(0, KV_Value, item_id); set_kvd(0, KV_fHandled, 0); if( dllfunc(DLLFunc_KeyValue, ent, 0) ) { set_kvd(0, KV_ClassName, "armoury_entity"); set_kvd(0, KV_KeyName, "count"); set_kvd(0, KV_Value, count); set_kvd(0, KV_fHandled, 0); return dllfunc(DLLFunc_KeyValue, ent, 0); } return 0; }
Отправить
Загрузил
CS90
2018-11-04 10:41:37
0
20
Установить на сервер
Скачать
Нет оплаченых серверов
Купить сервер CS 1.6
Купить сервер CS:GO
Купить сервер CSS v34
Подключить свой VDS к панели
Данная иконка означает, что плагин был проверен администрацией хостинга на тестовом сервере, и проблем с ним не было выявлено. Рекомендуем ставить исключительно проверенные плагины.
Плагин загружен на сервер, но проверка еще не была проведена.
CSHOST.COM.UA 2012-2024 Хостинг игровых серверов