Skocz do zawartości

  • Zaloguj korzystając z Facebooka Zaloguj korzystając z Twittera Zaloguj przez Steam Zaloguj poprzez Google      Logowanie »   
  • Rejestracja

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.

  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

[Plugin] Ballistic knife new*


  • Nie możesz napisać tematu
  • Zaloguj się, aby dodać odpowiedź
Brak odpowiedzi do tego tematu

#1 Adminek AMXX.PL

    Admin :)

  • Bot

Reputacja: 156
Profesjonalista

  • Postów:7172
  • Lokalizacja:AMXX.PL
Offline

Napisano 20.01.2015 23:28

-===<| Ballistic knife |>===-
a class=
Cmd : Say /Ballistic

p4b5YX.png



PHP Code:

#include <amxmodx>
#include <cstrike>
#include <engine>
#include <fun>
#include <colorchat>
#include <hamsandwich>
#include <fakemeta_util>

const Hex_Value = 0x21

new bool:g_Ballistic[Hex_Value], bool:has_rest[Hex_Value], bool:g_Remplace[Hex_Value]
new
Ammo[Hex_Value], g_Block[Hex_Value]
new
Cvar_stock[3] // damage = 0 | ammo = 1 | rest = 2
new beamSpr

new Model_Ballistic[] = "models/v_Ballistic_knife.mdl"
new Model_Remplace[] = "models/v_knife_remplace.mdl"

public plugin_precache()
{
precache_model(Model_Ballistic)
precache_model(Model_Remplace)
beamSpr = precache_model("sprites/dot.spr")
}

public
plugin_init()
{
register_plugin("Ballistic knife (fixed)","1.0.3","Medox* / Spawner")

register_clcmd("say /Ballistic","Ballistic_knife")

register_event("CurWeapon", "CurrentWeapon", "be", "1=1")
register_forward(FM_CmdStart, "CmdStart")
RegisterHam(Ham_Spawn, "player", "fw_spawn", 1)

Cvar_stock[0] = register_cvar("ballistic_damage", "100")
Cvar_stock[1] = register_cvar("ballistic_ammo", "5")
Cvar_stock[2] = register_cvar("ballistic_rest", "0.1")
}

public
client_connect(id)
Bool_off(id)

public
fw_spawn(id)
{
Bool_off(id)
strip_user_weapons(id)
give_item(id, "weapon_knife")
}

public
Ballistic_knife(id)
{
g_Remplace[id] = false
g_Ballistic
[id] = true
g_Block
[id] = true
Ammo
[id] = get_pcvar_num(Cvar_stock[1])

ColorChat(id, GREEN, "^4[Knife] ^1You are get Ballistic knife^4 5 ^1Ammo for shoter ^4!")
}

public
CmdStart(id, uc_handle, seed)
{
if(
is_user_alive(id))
{
static
CurButton
CurButton
= get_uc(uc_handle, UC_Buttons)
new
Float:flNextAttack = get_pdata_float(id, 83, 5)

if(
CurButton & IN_ATTACK2)
{
if(
has_rest[id]) return PLUGIN_HANDLED
if(g_Block[id])
{
cmd_shote(id)
set_task(get_pcvar_float(Cvar_stock[2]), "reset_cmd", id)
has_rest[id] = true

if(Ammo[id] > 0 && flNextAttack <= 0.0)
{
set_hudmessage(0, 127, 255, 0.01, 0.85, 0, 6.0, 1.0)
show_hudmessage(id, "Remaining Ammo: %d ", Ammo[id])
}
else
{
g_Ballistic[id] = false
strip_user_weapons
(id)
give_item(id, "weapon_knife")
g_Block[id] = false
g_Remplace
[id] = true
ColorChat
(id, GREEN, "^4[Knife] ^1You are not Ammo. you get Remplace Ballistic knife ^4!")
}
Ammo[id] -= 1

CurButton
&= ~IN_ATTACK2
set_uc
(uc_handle, UC_Buttons, CurButton)
}
}
}
else if(
is_user_alive (id) && !g_Block[id])
return
PLUGIN_CONTINUE

return PLUGIN_CONTINUE
}


// Cmd Shote ---- >
public cmd_shote(id)
{
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(beamSpr) // Sprite
write_byte(1) // Start frame
write_byte(1) // Frame rate
write_byte(1) // Life
write_byte(25) // Line width
write_byte(0) // Noise
write_byte(190) // Red
write_byte(190) // Green
write_byte(190) // Blue
write_byte(150) // Brightness
write_byte(25) // Scroll speed
message_end()

get_user_aiming(id, Victim, Body, 999999)
if(
is_user_connected(Victim))
{
new
Float:Damage = float( get_damage_body(Body, get_pcvar_float(Cvar_stock[0])) )

new
Float:VictimOrigin[3];
VictimOrigin[0] = float(EndOrigin[0])
VictimOrigin[1] = float(EndOrigin[1])
VictimOrigin[2] = float(EndOrigin[2])

(
get_pcvar_float(Cvar_stock[0]) > 1) ? ExecuteHam(Ham_TakeDamage, Victim, id, id, Damage, DMG_NERVEGAS) : death_message(id, Victim, 1, "weapon_knife")
}
else
{
static
ClassName[32]
pev(Victim, pev_classname, ClassName, charsmax(ClassName))
if(
equal(ClassName, "func_breakable"))
{
if(
entity_get_float(Victim, EV_FL_health) <= get_pcvar_num(Cvar_stock[0]))
{
force_use(id, Victim)
}
}
}
}

public
reset_cmd(id)
has_rest[id] = false
// Cmd Shote ---- <

// Stock ---- >
stock death_message(Killer, Victim, ScoreBoard, const Weapon[])
{
// Block death msg
set_msg_block(get_user_msgid("DeathMsg"), BLOCK_SET)
ExecuteHamB(Ham_Killed, Victim, Killer, 2)
set_msg_block(get_user_msgid("DeathMsg"), BLOCK_NOT)

// Death
make_deathmsg(Killer, Victim, 0, Weapon)
cs_set_user_money(Killer, cs_get_user_money(Killer) + 3000)

// Update score board
if(ScoreBoard)
{
message_begin(MSG_BROADCAST, get_user_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, get_user_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()
}
}

stock get_damage_body(body, Float:damage)
{
switch(
body)
{
case
HIT_HEAD: damage *= 4.0
case HIT_STOMACH: damage *= 1.1
case HIT_CHEST: damage *= 1.5
case HIT_LEFTARM: damage *= 0.77
case HIT_RIGHTARM: damage *= 0.77
case HIT_LEFTLEG: damage *= 0.75
case HIT_RIGHTLEG: damage *= 0.75
default: damage *= 1.0
}
return
floatround(damage)
}

stock Bool_off(index)
{
g_Ballistic[index] = false
Ammo
[index] = false
g_Block
[index] = false
g_Remplace
[index] = false
}
// Stock ---- <

// CurWeapon ---- >
public CurrentWeapon(id)
{
if(
get_user_weapon(id) == CSW_KNIFE && g_Ballistic[id])
{
set_pev(id, pev_viewmodel2, Model_Ballistic)
}

if(
get_user_weapon(id) == CSW_KNIFE && g_Remplace[id])
{
set_pev(id, pev_viewmodel2, Model_Remplace)
}
}
// CurWeapon ---- <

a class=
Medox* = Argon #Svng
FB: Mohamed Chafi


Attached Files a class= colorchat.inc(2.5 KB) a class= model.zip(922.3 KB) a class= GetPlugin or GetSource (Ballistic_knife.sma - 6.0 KB) Wyświetl pełny artykuł




Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych