1 [Weapon] RailCannon 2014 Empty [Weapon] RailCannon 2014 la data de 13/10/2014, 6:48 pm

Sexi

Sexi
Moderator
Multumiri primite : 115
Mesaje scrise : 539
Data de inscriere : 09/07/2011
Puncte obtinute : 966
100%
Descriere: RailCannon este o arma SF care trage cu laser, are 2 module atat pe click stanga cat si pe click dreapta.

Descarcare: Girlshare

Nume: RailCannon
Versiune: 1.0
Autor: sDs|Aragon*

Instalare:
1. Fisierul RailCannon.sma il puneti in addons/amxmodx/scripting
2. Fisierul RailCannon.amxx il puneti in addons/amxmodx/plugins
3. Intrati in fisierul addons/amxmodx/configs/plugins.ini si adaugati la urma:
Cod:
RailCannon.amxx

4. Adaugati fisierele din models,sound si sprites in folderele respective

Comenzi publice (se tasteaza in joc prin apasarea tastei Y):
/railcannon - cumpara arma

Am lasat instructiuni clare de unde puteti modifica damage-ul si altele, plugin-ul nu contine cvaruri.

Cod:
new WPN_RAILCANNON[][] = {
  /*Name*/ "Rail Cannon",
  /*Acces*/ "0",
  /*Level*/ "25", - Treceti cu vederea asta, si inca cateva chesti cu // din plugin.
  /*Damage*/ "100",
  /*Clip*/ "6",
  /*Shot Delay*/ "0.4",
  /*KnockBack*/ "1",
  /*Price*/ "10000"
},

SMA:
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
//--------------------------------------| Rail Cannon |------------------------------------------------------
//======================================= sDs|Aragon* =======================================================
#include
#include
#include
#include
#include
#include
#include

#define PLUGIN "RailCannon"
#define VERSION "1.0"
#define AUTHOR "Aragon*"

/*#include "furien40/furien40.inc"
#include "furien40/furien40_weapons.inc"*/

#define VIP_LEVEL ADMIN_LEVEL_H
#define PRIMARY_WEAPONS_BITSUM (1<new BloodSpray, BloodDrop, MSGID_WeaponList, MSGID_DeathMsg, MSGID_ScoreInfo, MSGID_SayText

#define RAILCANNON_WEAPONKEY 4352
#define weapon_railcannon "weapon_galil"
#define CSW_RAILCANNON CSW_GALIL
new WPN_RAILCANNON[][] = {
/*Name*/ "Rail Cannon",
/*Acces*/ "1",
/*Level*/ "25",
/*Damage*/ "100",
/*Clip*/ "6",
/*Shot Delay*/ "0.4",
/*KnockBack*/ "1",
/*Price*/ "10000"
},
RailCannonModel_V[] = "models/RailCannon//v_railcannon.mdl",
RailCannonModel_P[] = "models/RailCannon//p_railcannon.mdl",
RailCannonModel_W[] = "models/RailCannon//w_railcannon.mdl",
RailCannon_WeaponList[] = "weapon_railcannon",
RailCannon_Sound[][] = {
"weapons/railcanon_shoot1.wav",
"weapons/railcanon_shoot2.wav",
"weapons/railcanon_chage1_start.wav",
"weapons/railcanon_chage1.wav",
"weapons/railcanon_chage2.wav",
"weapons/railcanon_chage3.wav",
"weapons/railcanon_chage3_loop.wav",
"weapons/railcanon_clipin.wav",
"weapons/railcanon_clipout.wav",
"weapons/railcanon_draw.wav"
},
RailCannon_Generic[][] = {
"sprites/weapon_railcannon.txt",
"sprites/RailCannon/railcannon.spr"
},
/*RailCannonID, */bool:HaveRailCannon[33], railcannon_event, railcannon_beam, railcannon_explode

public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
//RailCannonID = RegisterPrimary(WPN_RAILCANNON[0], WPN_RAILCANNON[1], WPN_RAILCANNON[2], RAILCANNON_WEAPONKEY, weapon_railcannon, CSW_RAILCANNON, RailCannon_WeaponList, WPN_RAILCANNON[4])

register_clcmd(RailCannon_WeaponList, "Hook_RailCannon");
register_clcmd("railcannon", "Buy_RailCannon");
register_clcmd("say /railcannon", "Buy_RailCannon");
register_clcmd("say_team /railcannon", "Buy_RailCannon");

register_event("CurWeapon", "RailCannon_ViewModel", "be", "1=1");
register_event("WeapPickup","RailCannon_ViewModel","b","1=19");

register_forward(FM_SetModel, "RailCannon_WorldModel", 1);
register_forward(FM_UpdateClientData, "RailCannon_UpdateClientData", 1);
register_forward(FM_PlaybackEvent, "RailCannon_PlaybackEvent");

register_forward(FM_CmdStart, "RailCannon_CmdStart");

RegisterHam(Ham_Item_AddToPlayer, weapon_railcannon, "RailCannon_AddToPlayer");
RegisterHam(Ham_Item_Deploy , weapon_railcannon, "RailCannon_Deploy_Post", 1);
RegisterHam(Ham_Weapon_WeaponIdle, weapon_railcannon, "RailCannon_WeaponIdle")
RegisterHam(Ham_Weapon_PrimaryAttack, weapon_railcannon, "RailCannon_PrimaryAttack");
RegisterHam(Ham_Weapon_Reload, weapon_railcannon, "RailCannon_Reload");
RegisterHam(Ham_Weapon_Reload, weapon_railcannon, "RailCannon_Reload_Post", 1);
RegisterHam(Ham_Item_PostFrame, weapon_railcannon, "RailCannon_PostFrame");

MSGID_WeaponList = get_user_msgid("WeaponList")
MSGID_DeathMsg = get_user_msgid("DeathMsg")
MSGID_ScoreInfo = get_user_msgid("ScoreInfo")
MSGID_SayText = get_user_msgid("SayText")
}

public plugin_precache() {
register_forward(FM_PrecacheEvent, "RailCannon_PrecacheEvent_Post", 1);

railcannon_beam = precache_model("sprites/RailCannon/railcannon_beam.spr");
railcannon_explode = precache_model("sprites/RailCannon/ef_balrog1_blue.spr");

precache_model(RailCannonModel_V);
precache_model(RailCannonModel_P);
precache_model(RailCannonModel_W);
for(new i = 0; i < sizeof(RailCannon_Sound); i++)
engfunc(EngFunc_PrecacheSound, RailCannon_Sound[i]);
for(new i = 0; i < sizeof(RailCannon_Generic); i++)
engfunc(EngFunc_PrecacheGeneric, RailCannon_Generic[i]);
}

public plugin_natives() {
register_native("get_user_railcannon", "get_user_railcannon", 1);
register_native("set_user_railcannon", "set_user_railcannon", 1);
}

public Buy_RailCannon(id) {
if(is_user_alive(id)) {
if(str_to_num(WPN_RAILCANNON[1]) == 1 && !(get_user_flags(id) & VIP_LEVEL) || cs_get_user_money(id) < str_to_num(WPN_RAILCANNON[7]))
return PLUGIN_CONTINUE;
else {
cs_set_user_money(id, cs_get_user_money(id) - str_to_num(WPN_RAILCANNON[7]))
set_user_railcannon(id, true)
}
}
return PLUGIN_CONTINUE
}

public RailCannon_ViewModel(id) {
if(get_user_weapon(id) == CSW_RAILCANNON && get_user_railcannon(id)) {
set_pev(id, pev_viewmodel2, RailCannonModel_V);
set_pev(id, pev_weaponmodel2, RailCannonModel_P);
}
}

public RailCannon_WorldModel(entity, model[]) {
if(is_valid_ent(entity)) {
static ClassName[33];
entity_get_string(entity, EV_SZ_classname, ClassName, charsmax(ClassName));

if(equal(ClassName, "weaponbox")) {
new Owner = entity_get_edict(entity, EV_ENT_owner),
RailCannon = find_ent_by_owner(-1, weapon_railcannon, entity);

if(get_user_railcannon(Owner) && pev_valid(RailCannon) && entity_get_int(RailCannon, EV_INT_impulse) == RAILCANNON_WEAPONKEY) {
set_user_railcannon(Owner, false);
entity_set_model(entity, RailCannonModel_W);
}
}
}
return FMRES_IGNORED;
}

public RailCannon_UpdateClientData(id, sendweapons, cd_handle) {
if(is_user_alive(id) && is_user_connected(id) && get_user_weapon(id) == CSW_RAILCANNON && get_user_railcannon(id))
set_cd(cd_handle, CD_flNextAttack, halflife_time() + 0.001);
return FMRES_IGNORED;
}

public RailCannon_PlaybackEvent(flags, invoker, eventid, Float:delay, Float:origin[3], Float:angles[3], Float:fparam1, Float:fparam2, iParam1, iParam2, bParam1, bParam2) {
if(is_user_connected(invoker) && eventid == railcannon_event)
playback_event(flags | FEV_HOSTONLY, invoker, eventid, delay, origin, angles, fparam1, fparam2, iParam1, iParam2, bParam1, bParam2);
return FMRES_IGNORED;
}

public RailCannon_PrecacheEvent_Post(type, const name[]) {
if (equal("events/galil.sc", name))
railcannon_event = get_orig_retval();
return FMRES_IGNORED;
}

public RailCannon_CmdStart(id, uc_handle, seed) {
if(is_user_alive(id) && is_user_connected(id)) {
new CurButton = get_uc(uc_handle, UC_Buttons);

if(CurButton & IN_ATTACK && get_user_weapon(id) == CSW_RAILCANNON && get_user_railcannon(id)) {
new RailCannon = fm_find_ent_by_owner(-1, weapon_railcannon, id);

if(pev_valid(RailCannon) && entity_get_int(RailCannon, EV_INT_iuser2) == 0 && cs_get_weapon_ammo(RailCannon) > 0 && !get_pdata_int(RailCannon, 54, 4) && get_pdata_float(id, 83, 5) <= 0.0) {
set_weapon_anim(id, 4);
emit_sound(id, CHAN_WEAPON,RailCannon_Sound[0], VOL_NORM, ATTN_NORM, 0, PITCH_NORM);

RailCannon_Fire(id, 1.0);

cs_set_weapon_ammo(RailCannon, cs_get_weapon_ammo(RailCannon) - 1);

if(cs_get_weapon_ammo(RailCannon) > 0 && !get_pdata_int(RailCannon, 54, 4) && get_pdata_float(id, 83, 5) <= 0.0) {
set_pdata_float(id, 83, str_to_float(WPN_RAILCANNON[5]), 5);
set_pdata_float(RailCannon, 48, 1.0, 4)
}
}
CurButton &= ~IN_ATTACK;
set_uc(uc_handle, UC_Buttons, CurButton);
}
if(!(CurButton & IN_ATTACK2) && (pev(id, pev_oldbuttons) & IN_ATTACK2) && get_user_weapon(id) == CSW_RAILCANNON && get_user_railcannon(id)) {
new RailCannon = fm_find_ent_by_owner(-1, weapon_railcannon, id);

if(entity_get_int(RailCannon, EV_INT_iuser2) > 0) {
if(pev_valid(RailCannon) && cs_get_weapon_ammo(RailCannon) > 0 && !get_pdata_int(RailCannon, 54, 4) && get_pdata_float(id, 83, 5) <= 0.0) {
set_weapon_anim(id, 5);
emit_sound(id, CHAN_WEAPON,RailCannon_Sound[1], VOL_NORM, ATTN_NORM, 0, PITCH_NORM);

RailCannon_Fire(id, float(entity_get_int(RailCannon, EV_INT_iuser2)));

cs_set_weapon_ammo(RailCannon, cs_get_weapon_ammo(RailCannon) - 1);
entity_set_int(RailCannon, EV_INT_iuser2, 0)

if(cs_get_weapon_ammo(RailCannon) > 0 && !get_pdata_int(RailCannon, 54, 4) && get_pdata_float(id, 83, 5) <= 0.0) {
set_pdata_float(id, 83, str_to_float(WPN_RAILCANNON[5]), 5);
set_pdata_float(RailCannon, 48, 1.0, 4)
}
}
CurButton &= ~IN_ATTACK2;
set_uc(uc_handle, UC_Buttons, CurButton);
}
else if(pev_valid(RailCannon) && cs_get_weapon_ammo(RailCannon) > 0 && !get_pdata_int(RailCannon, 54, 4) && get_pdata_float(id, 83, 5) <= 0.0) {
entity_set_int(RailCannon, EV_INT_iuser2, 0)
set_pdata_float(id, 83, 0.1, 5);
set_pdata_float(RailCannon, 48, 0.1, 4)
}
}
else if(CurButton & IN_ATTACK2 && get_user_weapon(id) == CSW_RAILCANNON && get_user_railcannon(id)) {
new RailCannon = fm_find_ent_by_owner(-1, weapon_railcannon, id);

if(pev_valid(RailCannon)) {
if(entity_get_int(RailCannon, EV_INT_iuser2) == 2 && entity_get_float(RailCannon, EV_FL_fuser1) <= get_gametime()) {
entity_set_int(RailCannon, EV_INT_iuser2, 3)
emit_sound(id, CHAN_WEAPON,RailCannon_Sound[6], VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
HudMessage(id, "RELEASE!", 200, 0, 0, -1.0, -1.0, 0, _, 0.5);
}
else if(entity_get_int(RailCannon, EV_INT_iuser2) == 1 && entity_get_float(RailCannon, EV_FL_fuser1) <= get_gametime()) {
entity_set_int(RailCannon, EV_INT_iuser2, 2)
entity_set_float(RailCannon, EV_FL_fuser1, get_gametime() + 1.7)
set_pdata_float(RailCannon, 48, 1.8, 4)
emit_sound(id, CHAN_WEAPON,RailCannon_Sound[5], VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
set_weapon_anim(id, 2);
}
else if(!(pev(id, pev_oldbuttons) & IN_ATTACK2) && entity_get_int(RailCannon, EV_INT_iuser2) == 0 && get_pdata_float(id, 83, 5) <= 0.0) {
entity_set_int(RailCannon, EV_INT_iuser2, 1)
entity_set_float(RailCannon, EV_FL_fuser1, get_gametime() + 1.7)
set_pdata_float(RailCannon, 48, 1.8, 4)
emit_sound(id, CHAN_WEAPON,RailCannon_Sound[3], VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
set_weapon_anim(id, 1);
}
}
CurButton &= ~IN_ATTACK2;
set_uc(uc_handle, UC_Buttons, CurButton);
}
}
return FMRES_IGNORED;
}

public RailCannon_AddToPlayer(Weapon, id) {
if(pev_valid(Weapon) && is_user_alive(id) && entity_get_int(Weapon, EV_INT_impulse) == RAILCANNON_WEAPONKEY) {
//set_user_railcannon(id, true)
HaveRailCannon[id] = true;
WeaponList(id, CSW_RAILCANNON, RailCannon_WeaponList, 0)
}
else if(pev_valid(Weapon) && is_user_alive(id) && entity_get_int(id, EV_INT_impulse) == RAILCANNON_WEAPONKEY)
ColorChat(id, "!t[!g%s!t]!g Damage:!t %s!g Clip:!t %s!g Shot Delay:!t %s!g KnockBack:!t %s", WPN_RAILCANNON[0], WPN_RAILCANNON[3], WPN_RAILCANNON[4], WPN_RAILCANNON[5], WPN_RAILCANNON[6])
return HAM_IGNORED;
}

public RailCannon_Deploy_Post(Weapon) {
if(pev_valid(Weapon)) {
new Owner = get_pdata_cbase(Weapon, 41, 4);

if(is_user_alive(Owner) && get_user_railcannon(Owner)) {
set_pev(Owner, pev_viewmodel2, RailCannonModel_V);
set_pev(Owner, pev_weaponmodel2, RailCannonModel_P);
set_weapon_anim(Owner, 7)

set_pdata_float(Owner, 83, 1.13, 5);
set_pdata_float(Weapon, 48, 1.13, 4)

entity_set_int(Weapon, EV_INT_iuser2, 0)
}
}
return HAM_IGNORED;
}

public RailCannon_WeaponIdle(Weapon) {
if(pev_valid(Weapon)) {
new Owner = get_pdata_cbase(Weapon, 41, 4);

if(is_user_alive(Owner) && get_user_railcannon(Owner) && get_pdata_float(Weapon, 48, 4) <= 0.1) {
set_pdata_float(Weapon, 48, 10.0, 4)
set_weapon_anim(Owner, 0)

if(entity_get_int(Weapon, EV_INT_iuser2) == 3) {
set_pdata_float(Weapon, 48, 1.2, 4)
emit_sound(Owner, CHAN_WEAPON,RailCannon_Sound[6], VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
set_weapon_anim(Owner, 3);
}
else {
set_pdata_float(Weapon, 48, 1.7, 4)
set_weapon_anim(Owner, 0)
}
return HAM_SUPERCEDE;
}
}
return HAM_IGNORED;
}

public RailCannon_PrimaryAttack(Weapon) {
if(pev_valid(Weapon)) {
new Owner = get_pdata_cbase(Weapon, 41, 4);
if(is_user_alive(Owner) && get_user_railcannon(Owner))
return HAM_SUPERCEDE;
}
return HAM_IGNORED;
}

public RailCannon_Reload(Weapon) {
if(pev_valid(Weapon)) {
new Owner = get_pdata_cbase(Weapon, 41, 4);

if(is_user_alive(Owner) && get_user_railcannon(Owner)) {
if(cs_get_user_bpammo(Owner, CSW_RAILCANNON) <= 0 || get_pdata_int(Weapon, 51, 4) >= str_to_num(WPN_RAILCANNON[4]))
return HAM_SUPERCEDE;
}
}
return HAM_IGNORED;
}

public RailCannon_Reload_Post(Weapon) {
if(pev_valid(Weapon)) {
new Owner = get_pdata_cbase(Weapon, 41, 4);

if(is_user_alive(Owner) && get_user_railcannon(Owner)) {
if(cs_get_user_bpammo(Owner, CSW_RAILCANNON) <= 0 || get_pdata_int(Weapon, 51, 4) >= str_to_num(WPN_RAILCANNON[4]))
return HAM_SUPERCEDE;
set_pdata_float(Weapon, 48, 2.93, 4);
set_pdata_float(Owner, 83, 2.93, 5);
set_pdata_int(Weapon, 54, 1, 4);
entity_set_int(Weapon, EV_INT_iuser2, 0)
set_weapon_anim(Owner, 6)
}
}
return HAM_IGNORED;
}

public RailCannon_PostFrame(Weapon) {
if(pev_valid(Weapon)) {
new Owner = get_pdata_cbase(Weapon, 41, 4);

if(is_user_alive(Owner) && get_user_railcannon(Owner) && get_pdata_int(Weapon, 54, 4) && get_pdata_float(Owner, 83, 5) <= 0.0) {
new Temp = min(str_to_num(WPN_RAILCANNON[4]) - get_pdata_int(Weapon, 51, 4), cs_get_user_bpammo(Owner, CSW_RAILCANNON));

set_pdata_int(Weapon, 51, get_pdata_int(Weapon, 51, 4) + Temp, 4);
cs_set_user_bpammo(Owner, CSW_RAILCANNON, cs_get_user_bpammo(Owner, CSW_RAILCANNON) - Temp);
set_pdata_int(Weapon, 54, 0, 4);
}
}
return HAM_IGNORED;
}

public RailCannon_Fire(id, Float:DamageMultiplier) {
static Victim, Body, EndOrigin[3], BeamOrigin[3];
get_user_origin(id, BeamOrigin, 3) ;
get_user_origin(id, EndOrigin, 3);

message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
write_byte(TE_BEAMENTPOINT);
write_short(id | 0x1000);
write_coord(BeamOrigin[0]); // Start X
write_coord(BeamOrigin[1]); // Start Y
write_coord(BeamOrigin[2]); // Start Z
write_short(railcannon_beam); // Sprite
write_byte(1); // Start frame
write_byte(2); // Frame rate
write_byte(1); // Life
write_byte(floatround(20.0 * DamageMultiplier)); // Line width
write_byte(0); // Noise
write_byte(0); // Red
write_byte(100); // Green
write_byte(200); // Blue
write_byte(255); // Brightness
write_byte(25); // Scroll speed
message_end();

message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
write_byte(TE_EXPLOSION);
write_coord(EndOrigin[0]);
write_coord(EndOrigin[1]);
write_coord(EndOrigin[2]);
write_short(railcannon_explode);
write_byte(floatround(2.0 * DamageMultiplier));
write_byte(10);
write_byte(TE_EXPLFLAG_NOSOUND);
message_end();

message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_WORLDDECAL)
write_coord(EndOrigin[0])
write_coord(EndOrigin[1])
write_coord(EndOrigin[2])
write_byte(41)
message_end()


get_user_aiming(id, Victim, Body, 999999);
static ClassName[32];
pev(Victim, pev_classname, ClassName, charsmax(ClassName));

if(equal(ClassName, "player") && is_user_connected(Victim) && is_user_alive(Victim)) {
if(!fm_get_user_godmode(Victim) && get_user_team(Victim) != get_user_team(id) && Victim != id) {
new Float:Damage = float(get_damage_body(Body, str_to_float(WPN_RAILCANNON[3]))) * DamageMultiplier;
new Float:Origin[3];
pev(id, pev_origin, Origin);

make_blood(Victim, floatround(Damage))
make_knockback(Victim, Origin, str_to_float(WPN_RAILCANNON[6])*Damage);

if(get_user_health(Victim) > Damage)
ExecuteHam(Ham_TakeDamage, Victim, id, id, Damage, DMG_ENERGYBEAM);
else
death_message(id, Victim, "railcannon");
}
}
else if(is_valid_ent(Victim) && equal(ClassName, "func_breakable")) {
if(entity_get_float(Victim, EV_FL_health) <= str_to_float(WPN_RAILCANNON[3]))
force_use(id, Victim);
}
}

public Hook_RailCannon(id) {
engclient_cmd(id, weapon_railcannon);
return PLUGIN_HANDLED
}

public get_user_railcannon(id)
return HaveRailCannon[id]

public set_user_railcannon(id, bool:railcannon) {
if(railcannon) {
if(!HaveRailCannon[id]) {
drop_primary_weapons(id);
HaveRailCannon[id] = true;
WeaponList(id, CSW_RAILCANNON, RailCannon_WeaponList, 0)

new Impulse = entity_get_int(id, EV_INT_impulse)
entity_set_int(id, EV_INT_impulse, RAILCANNON_WEAPONKEY);
fm_give_item(id, weapon_railcannon);
entity_set_int(id, EV_INT_impulse, Impulse);

new Weapon = fm_find_ent_by_owner(-1, weapon_railcannon, id);
cs_set_weapon_ammo(Weapon, str_to_num(WPN_RAILCANNON[4]))
entity_set_int(Weapon, EV_INT_impulse, RAILCANNON_WEAPONKEY)
}
}
else if(HaveRailCannon[id])
HaveRailCannon[id] = true
}

/*
public get_user_railcannon(id)
return get_user_primary(id, RailCannonID)

public set_user_railcannon(id, bool:railcannon)
set_user_primary(id, RailCannonID, railcannon)
*/

stock WeaponList(id, CSW_WEAPON, const Weapon[], Flag=0) {
switch(CSW_WEAPON) {
case CSW_P228: {
message_begin(MSG_ONE, MSGID_WeaponList, _, id);
write_string(Weapon); // WeaponName
write_byte(9); // PrimaryAmmoID
write_byte(52); // PrimaryAmmoMaxAmount
write_byte(-1); // SecondaryAmmoID
write_byte(-1); // SecondaryAmmoMaxAmount
write_byte(1); // SlotID (0...N)
write_byte(3); // NumberInSlot (1...N)
write_byte(CSW_P228); // WeaponID
write_byte(Flag); // Flags
message_end();
}
case CSW_SCOUT: {
message_begin(MSG_ONE, MSGID_WeaponList, _, id);
write_string(Weapon); // WeaponName
write_byte(2); // PrimaryAmmoID
write_byte(90); // PrimaryAmmoMaxAmount
write_byte(-1); // SecondaryAmmoID
write_byte(-1); // SecondaryAmmoMaxAmount
write_byte(0); // SlotID (0...N)
write_byte(9); // NumberInSlot (1...N)
write_byte(CSW_SCOUT); // WeaponID
write_byte(Flag); // Flags
message_end();
}
case CSW_HEGRENADE: {
message_begin(MSG_ONE, MSGID_WeaponList, _, id);
write_string(Weapon); // WeaponName
write_byte(12); // PrimaryAmmoID
write_byte(1); // PrimaryAmmoMaxAmount
write_byte(-1); // SecondaryAmmoID
write_byte(-1); // SecondaryAmmoMaxAmount
write_byte(3); // SlotID (0...N)
write_byte(1); // NumberInSlot (1...N)
write_byte(CSW_HEGRENADE); // WeaponID
write_byte(Flag); // Flags
message_end();
}
case CSW_XM1014: {
message_begin(MSG_ONE, MSGID_WeaponList, _, id);
write_string(Weapon); // WeaponName
write_byte(5); // PrimaryAmmoID
write_byte(32); // PrimaryAmmoMaxAmount
write_byte(-1); // SecondaryAmmoID
write_byte(-1); // SecondaryAmmoMaxAmount
write_byte(0); // SlotID (0...N)
write_byte(12); // NumberInSlot (1...N)
write_byte(CSW_XM1014); // WeaponID
write_byte(Flag); // Flags
message_end();
}
case CSW_C4: {
message_begin(MSG_ONE, MSGID_WeaponList, _, id);
write_string(Weapon); // WeaponName
write_byte(14); // PrimaryAmmoID
write_byte(1); // PrimaryAmmoMaxAmount
write_byte(-1); // SecondaryAmmoID
write_byte(-1); // SecondaryAmmoMaxAmount
write_byte(4); // SlotID (0...N)
write_byte(3); // NumberInSlot (1...N)
write_byte(CSW_C4); // WeaponID
write_byte(Flag); // Flags
message_end();
}
case CSW_MAC10: {
message_begin(MSG_ONE, MSGID_WeaponList, _, id);
write_string(Weapon); // WeaponName
write_byte(6); // PrimaryAmmoID
write_byte(100); // PrimaryAmmoMaxAmount
write_byte(-1); // SecondaryAmmoID
write_byte(-1); // SecondaryAmmoMaxAmount
write_byte(0); // SlotID (0...N)
write_byte(13); // NumberInSlot (1...N)
write_byte(CSW_MAC10); // WeaponID
write_byte(Flag); // Flags
message_end();
}
case CSW_AUG: {
message_begin(MSG_ONE, MSGID_WeaponList, _, id);
write_string(Weapon); // WeaponName
write_byte(4); // PrimaryAmmoID
write_byte(90); // PrimaryAmmoMaxAmount
write_byte(-1); // SecondaryAmmoID
write_byte(-1); // SecondaryAmmoMaxAmount
write_byte(0); // SlotID (0...N)
write_byte(14); // NumberInSlot (1...N)
write_byte(CSW_AUG); // WeaponID
write_byte(Flag); // Flags
message_end();
}
case CSW_SMOKEGRENADE: {
message_begin(MSG_ONE, MSGID_WeaponList, _, id);
write_string(Weapon); // WeaponName
write_byte(13); // PrimaryAmmoID
write_byte(1); // PrimaryAmmoMaxAmount
write_byte(-1); // SecondaryAmmoID
write_byte(-1); // SecondaryAmmoMaxAmount
write_byte(3); // SlotID (0...N)
write_byte(3); // NumberInSlot (1...N)
write_byte(CSW_SMOKEGRENADE); // WeaponID
write_byte(Flag); // Flags
message_end();
}
case CSW_ELITE: {
message_begin(MSG_ONE, MSGID_WeaponList, _, id);
write_string(Weapon); // WeaponName
write_byte(10); // PrimaryAmmoID
write_byte(120); // PrimaryAmmoMaxAmount
write_byte(-1); // SecondaryAmmoID
write_byte(-1); // SecondaryAmmoMaxAmount
write_byte(1); // SlotID (0...N)
write_byte(5); // NumberInSlot (1...N)
write_byte(CSW_ELITE); // WeaponID
write_byte(Flag); // Flags
message_end();
}
case CSW_FIVESEVEN: {
message_begin(MSG_ONE, MSGID_WeaponList, _, id);
write_string(Weapon); // WeaponName
write_byte(7); // PrimaryAmmoID
write_byte(100); // PrimaryAmmoMaxAmount
write_byte(-1); // SecondaryAmmoID
write_byte(-1); // SecondaryAmmoMaxAmount
write_byte(1); // SlotID (0...N)
write_byte(6); // NumberInSlot (1...N)
write_byte(CSW_FIVESEVEN); // WeaponID
write_byte(Flag); // Flags
message_end();
}
case CSW_UMP45: {
message_begin(MSG_ONE, MSGID_WeaponList, _, id);
write_string(Weapon); // WeaponName
write_byte(6); // PrimaryAmmoID
write_byte(100); // PrimaryAmmoMaxAmount
write_byte(-1); // SecondaryAmmoID
write_byte(-1); // SecondaryAmmoMaxAmount
write_byte(0); // SlotID (0...N)
write_byte(15); // NumberInSlot (1...N)
write_byte(CSW_UMP45); // WeaponID
write_byte(Flag); // Flags
message_end();
}
case CSW_SG550: {
message_begin(MSG_ONE, MSGID_WeaponList, _, id);
write_string(Weapon); // WeaponName
write_byte(4); // PrimaryAmmoID
write_byte(90); // PrimaryAmmoMaxAmount
write_byte(-1); // SecondaryAmmoID
write_byte(-1); // SecondaryAmmoMaxAmount
write_byte(0); // SlotID (0...N)
write_byte(16); // NumberInSlot (1...N)
write_byte(CSW_SG550); // WeaponID
write_byte(Flag); // Flags
message_end();
}
case CSW_GALIL: {
message_begin(MSG_ONE, MSGID_WeaponList, _, id);
write_string(Weapon); // WeaponName
write_byte(4); // PrimaryAmmoID
write_byte(90); // PrimaryAmmoMaxAmount
write_byte(-1); // SecondaryAmmoID
write_byte(-1); // SecondaryAmmoMaxAmount
write_byte(0); // SlotID (0...N)
write_byte(17); // NumberInSlot (1...N)
write_byte(CSW_GALIL); // WeaponID
write_byte(Flag); // Flags
message_end();
}
case CSW_FAMAS: {
message_begin(MSG_ONE, MSGID_WeaponList, _, id);
write_string(Weapon); // WeaponName
write_byte(4); // PrimaryAmmoID
write_byte(90); // PrimaryAmmoMaxAmount
write_byte(-1); // SecondaryAmmoID
write_byte(-1); // SecondaryAmmoMaxAmount
write_byte(0); // SlotID (0...N)
write_byte(18); // NumberInSlot (1...N)
write_byte(CSW_FAMAS); // WeaponID
write_byte(Flag); // Flags
message_end();
}
case CSW_USP: {
message_begin(MSG_ONE, MSGID_WeaponList, _, id);
write_string(Weapon); // WeaponName
write_byte(6); // PrimaryAmmoID
write_byte(100); // PrimaryAmmoMaxAmount
write_byte(-1); // SecondaryAmmoID
write_byte(-1); // SecondaryAmmoMaxAmount
write_byte(1); // SlotID (0...N)
write_byte(4); // NumberInSlot (1...N)
write_byte(CSW_USP); // WeaponID
write_byte(Flag); // Flags
message_end();
}
case CSW_GLOCK18: {
message_begin(MSG_ONE, MSGID_WeaponList, _, id);
write_string(Weapon); // WeaponName
write_byte(10); // PrimaryAmmoID
write_byte(120); // PrimaryAmmoMaxAmount
write_byte(-1); // SecondaryAmmoID
write_byte(-1); // SecondaryAmmoMaxAmount
write_byte(1); // SlotID (0...N)
write_byte(2); // NumberInSlot (1...N)
write_byte(CSW_GLOCK18); // WeaponID
write_byte(Flag); // Flags
message_end();
}
case CSW_AWP: {
message_begin(MSG_ONE, MSGID_WeaponList, _, id);
write_string(Weapon); // WeaponName
write_byte(1); // PrimaryAmmoID
write_byte(30); // PrimaryAmmoMaxAmount
write_byte(-1); // SecondaryAmmoID
write_byte(-1); // SecondaryAmmoMaxAmount
write_byte(0); // SlotID (0...N)
write_byte(2); // NumberInSlot (1...N)
write_byte(CSW_AWP); // WeaponID
write_byte(Flag); // Flags
message_end();
}
case CSW_MP5NAVY: {
message_begin(MSG_ONE, MSGID_WeaponList, _, id);
write_string(Weapon); // WeaponName
write_byte(10); // PrimaryAmmoID
write_byte(120); // PrimaryAmmoMaxAmount
write_byte(-1); // SecondaryAmmoID
write_byte(-1); // SecondaryAmmoMaxAmount
write_byte(0); // SlotID (0...N)
write_byte(7); // NumberInSlot (1...N)
write_byte(CSW_MP5NAVY); // WeaponID
write_byte(Flag); // Flags
message_end();
}
case CSW_M249: {
message_begin(MSG_ONE, MSGID_WeaponList, _, id);
write_string(Weapon); // WeaponName
write_byte(3); // PrimaryAmmoID
write_byte(200); // PrimaryAmmoMaxAmount
write_byte(-1); // SecondaryAmmoID
write_byte(-1); // SecondaryAmmoMaxAmount
write_byte(0); // SlotID (0...N)
write_byte(4); // NumberInSlot (1...N)
write_byte(CSW_M249); // WeaponID
write_byte(Flag); // Flags
message_end();
}
case CSW_M3: {
message_begin(MSG_ONE, MSGID_WeaponList, _, id);
write_string(Weapon); // WeaponName
write_byte(5); // PrimaryAmmoID
write_byte(32); // PrimaryAmmoMaxAmount
write_byte(-1); // SecondaryAmmoID
write_byte(-1); // SecondaryAmmoMaxAmount
write_byte(0); // SlotID (0...N)
write_byte(5); // NumberInSlot (1...N)
write_byte(CSW_M3); // WeaponID
write_byte(Flag); // Flags
message_end();
}
case CSW_M4A1: {
message_begin(MSG_ONE, MSGID_WeaponList, _, id);
write_string(Weapon); // WeaponName
write_byte(4); // PrimaryAmmoID
write_byte(90); // PrimaryAmmoMaxAmount
write_byte(-1); // SecondaryAmmoID
write_byte(-1); // SecondaryAmmoMaxAmount
write_byte(0); // SlotID (0...N)
write_byte(6); // NumberInSlot (1...N)
write_byte(CSW_M4A1); // WeaponID
write_byte(Flag); // Flags
message_end();
}
case CSW_TMP: {
message_begin(MSG_ONE, MSGID_WeaponList, _, id);
write_string(Weapon); // WeaponName
write_byte(10); // PrimaryAmmoID
write_byte(120); // PrimaryAmmoMaxAmount
write_byte(-1); // SecondaryAmmoID
write_byte(-1); // SecondaryAmmoMaxAmount
write_byte(0); // SlotID (0...N)
write_byte(11); // NumberInSlot (1...N)
write_byte(CSW_TMP); // WeaponID
write_byte(Flag); // Flags
message_end();
}
case CSW_G3SG1: {
message_begin(MSG_ONE, MSGID_WeaponList, _, id);
write_string(Weapon); // WeaponName
write_byte(2); // PrimaryAmmoID
write_byte(90); // PrimaryAmmoMaxAmount
write_byte(-1); // SecondaryAmmoID
write_byte(-1); // SecondaryAmmoMaxAmount
write_byte(0); // SlotID (0...N)
write_byte(3); // NumberInSlot (1...N)
write_byte(CSW_G3SG1); // WeaponID
write_byte(Flag); // Flags
message_end();
}
case CSW_FLASHBANG: {
message_begin(MSG_ONE, MSGID_WeaponList, _, id);
write_string(Weapon); // WeaponName
write_byte(11); // PrimaryAmmoID
write_byte(2); // PrimaryAmmoMaxAmount
write_byte(-1); // SecondaryAmmoID
write_byte(-1); // SecondaryAmmoMaxAmount
write_byte(3); // SlotID (0...N)
write_byte(2); // NumberInSlot (1...N)
write_byte(CSW_FLASHBANG); // WeaponID
write_byte(Flag); // Flags
message_end();
}
case CSW_DEAGLE: {
message_begin(MSG_ONE, MSGID_WeaponList, _, id);
write_string(Weapon); // WeaponName
write_byte(8); // PrimaryAmmoID
write_byte(35); // PrimaryAmmoMaxAmount
write_byte(-1); // SecondaryAmmoID
write_byte(-1); // SecondaryAmmoMaxAmount
write_byte(1); // SlotID (0...N)
write_byte(1); // NumberInSlot (1...N)
write_byte(CSW_DEAGLE); // WeaponID
write_byte(Flag); // Flags
message_end();
}
case CSW_SG552: {
message_begin(MSG_ONE, MSGID_WeaponList, _, id);
write_string(Weapon); // WeaponName
write_byte(4); // PrimaryAmmoID
write_byte(90); // PrimaryAmmoMaxAmount
write_byte(-1); // SecondaryAmmoID
write_byte(-1); // SecondaryAmmoMaxAmount
write_byte(0); // SlotID (0...N)
write_byte(10); // NumberInSlot (1...N)
write_byte(CSW_SG552); // WeaponID
write_byte(Flag); // Flags
message_end();
}
case CSW_AK47: {
message_begin(MSG_ONE, MSGID_WeaponList, _, id);
write_string(Weapon); // WeaponName
write_byte(2); // PrimaryAmmoID
write_byte(90); // PrimaryAmmoMaxAmount
write_byte(-1); // SecondaryAmmoID
write_byte(-1); // SecondaryAmmoMaxAmount
write_byte(0); // SlotID (0...N)
write_byte(1); // NumberInSlot (1...N)
write_byte(CSW_AK47); // WeaponID
write_byte(Flag); // Flags
message_end();
}
case CSW_KNIFE: {
message_begin(MSG_ONE, MSGID_WeaponList, _, id);
write_string(Weapon); // WeaponName
write_byte(-1); // PrimaryAmmoID
write_byte(-1); // PrimaryAmmoMaxAmount
write_byte(-1); // SecondaryAmmoID
write_byte(-1); // SecondaryAmmoMaxAmount
write_byte(2); // SlotID (0...N)
write_byte(1); // NumberInSlot (1...N)
write_byte(CSW_KNIFE); // WeaponID
write_byte(Flag); // Flags
message_end();
}
case CSW_P90: {
message_begin(MSG_ONE, MSGID_WeaponList, _, id);
write_string(Weapon); // WeaponName
write_byte(7); // PrimaryAmmoID
write_byte(100); // PrimaryAmmoMaxAmount
write_byte(-1); // SecondaryAmmoID
write_byte(-1); // SecondaryAmmoMaxAmount
write_byte(0); // SlotID (0...N)
write_byte(8); // NumberInSlot (1...N)
write_byte(CSW_P90); // WeaponID
write_byte(Flag); // Flags
message_end();
}
}
}

public death_message(killer, victim, const WeaponName[]) {
if(is_user_connected(killer) && is_user_connected(victim)) {
set_msg_block(MSGID_DeathMsg, BLOCK_SET);
ExecuteHamB(Ham_Killed, victim, killer, 2);
set_msg_block(MSGID_DeathMsg, BLOCK_NOT);
make_deathmsg(killer, victim, 0, WeaponName);
cs_set_user_money(killer, cs_get_user_money(killer) + 300);

message_begin(MSG_BROADCAST, MSGID_ScoreInfo);
write_byte(killer); // id
write_short(pev(killer, pev_frags)); // frags
write_short(cs_get_user_deaths(killer)); // deaths
write_short(0); // class?
write_short(get_user_team(killer)); // team
message_end();

message_begin(MSG_BROADCAST, MSGID_ScoreInfo);
write_byte(victim); // id
write_short(pev(victim, pev_frags)); // frags
write_short(cs_get_user_deaths(victim)); // deaths
write_short(0); // class?
write_short(get_user_team(victim)); // team
message_end();
}
}

public make_knockback(id, Float:origin[3], Float:maxspeed) {
if(is_user_alive(id)) {
new Float:Velocity[3], Float:Origin[3], Float:Distance[3], Float:Time;
entity_get_vector(id, EV_VEC_origin, Origin);

Distance[0] = Origin[0] - origin[0], Distance[1] = Origin[1] - origin[1], Distance[2] = Origin[2] - origin[2];
Time = (vector_distance(Origin,origin) / maxspeed);
Velocity[0] = Distance[0] / Time, Velocity[1] = Distance[1] / Time, Velocity[2] = Distance[2] / Time;

entity_set_vector(id, EV_VEC_velocity, Velocity);
}
}

public make_blood(id, Amount) {
if(is_user_alive(id)) {
new BloodColor = ExecuteHam(Ham_BloodColor, id);
if(BloodColor != -1) {
new Float:Origin[3]
pev(id, pev_origin, Origin);
Amount *= 2; //according to HLSDK

message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
write_byte(TE_BLOODSPRITE);
write_coord(floatround(Origin[0]));
write_coord(floatround(Origin[1]));
write_coord(floatround(Origin[2]));
write_short(BloodSpray);
write_short(BloodDrop);
write_byte(BloodColor);
write_byte(min(max(3, Amount/10), 16));
message_end();
}
}
}

public set_weapon_anim(id, anim) {
if(is_user_connected(id)) {
set_pev(id, pev_weaponanim, anim);
message_begin(MSG_ONE, SVC_WEAPONANIM, _, id);
write_byte(anim);
write_byte(pev(id, pev_body));
message_end();
}
}

stock drop_primary_weapons(id) {
if(is_user_alive(id)) {
new Weapons[32], Num = 0, WeaponID;
get_user_weapons(id, Weapons, Num);

for(new i = 0; i < Num; i++) {
WeaponID = Weapons[i];

if(((1< new WName[32];
get_weaponname(WeaponID, WName, charsmax(WName));

engclient_cmd(id, "drop", WName);
}
}
}
}

stock get_damage_body(body, Float:damage) {
switch(body) {
case HIT_HEAD:
damage *= 2.0;
case HIT_STOMACH:
damage *= 1.0;
case HIT_CHEST:
damage *= 1.5;
case HIT_LEFTARM:
damage *= 0.75;
case HIT_RIGHTARM:
damage *= 0.75;
case HIT_LEFTLEG:
damage *= 0.75;
case HIT_RIGHTLEG:
damage *= 0.75;
default: damage *= 1.0;
}

return floatround(damage);
}

stock HudMessage(const id, const message[], red = 0, green = 160, blue = 0, Float:x = -1.0, Float:y = 0.65, effects = 2, Float:fxtime = 0.01, Float:holdtime = 3.0, Float:fadeintime = 0.01, Float:fadeouttime = 0.01) {
new count = 1, players[32];

if(id) players[0] = id;
else get_players(players, count, "ch"); {
for(new i = 0; i < count; i++) {
if(is_user_connected(players[i])) {
new color = (clamp(blue, 0, 255) + (clamp(green, 0, 255) << 8) + (clamp(red, 0, 255) << 16))

message_begin(MSG_ONE_UNRELIABLE, SVC_DIRECTOR, _, players[i]);
write_byte(strlen(message) + 31);
write_byte(DRC_CMD_MESSAGE);
write_byte(effects);
write_long(color);
write_long(_love struck);
write_long(_:y);
write_long(_:fadeintime);
write_long(_:fadeouttime);
write_long(_:holdtime);
write_long(_:fxtime);
write_string(message);
message_end();
}
}
}
}

stock ColorChat(const id, const input[], any:...) {
new count = 1, players[32], msg[191];
vformat(msg, 190, input, 3);

replace_all(msg, 190, "!g", "^4");
replace_all(msg, 190, "!y", "^1");
replace_all(msg, 190, "!t", "^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, MSGID_SayText, _, players[i]);
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}

Imagini:
 [Weapon] RailCannon 2014 110

 [Weapon] RailCannon 2014 210