Member
|
06-21-2017
, 15:08
Re: Could you edit this plugin for me?
|
#3
|
Quote:
Originally Posted by edon1337
PHP Code:
#include amxmodx #include hamsandwich
#define PLUGIN "Killed effects :D" #define VERSION "0.0.1" #define AUTHOR "BodyBuilder"
#define _RPC return PLUGIN_CONTINUE
static GREEN, weapon, hitzone, bodypart[128], origin[3], D_color, D_x, D_y, D_effect, D_fxtime, D_holdtime, D_fadeintime, D_fadeouttime, D_reliable
#define HLW_CROWBAR 1 #define HLW_GLOCK 2 #define HLW_PYTHON 3 #define HLW_MP5 4 #define HLW_CROSSBOW 6 #define HLW_SHOTGUN 7 #define HLW_GAUSS 9 #define HLW_EGON 10 #define HLW_HORNETGUN 11
public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR)
RegisterHam(Ham_Killed,"player","killed_eff", 1) }
public killed_eff(victim, attacker) { get_user_attacker(victim, weapon, hitzone) get_user_origin(victim,origin)
switch(weapon) { case HLW_CROWBAR: _RPC case HLW_GLOCK: {} case HLW_PYTHON: {} case HLW_MP5: {} case HLW_CROSSBOW: {} case HLW_SHOTGUN: {} case HLW_GAUSS: {} case HLW_EGON: {} case HLW_HORNETGUN: {} }
switch(hitzone) { case 1: bodypart = "head" }
if(weapon && hitzone == 1) { if(attacker == victim) { _RPC }
Set_Director_Hud_Message(0, 255, 0, -1.00, 0.45, 1, 0.01, 2.0, 0.01, 0.01) Show_Director_Hud_Message(attacker,"HEAD SHOT :D") client_cmd(attacker,"spk misc/headshot")
Set_Director_Hud_Message(255, 0, 0, -1.00, 0.45, 1, 0.01, 2.0, 0.01, 0.01) Show_Director_Hud_Message(victim,"HEAD SHOT :-(") client_cmd(victim,"spk misc/headshot") message_begin(MSG_BROADCAST,SVC_TEMPENTITY) write_byte(TE_SPRITETRAIL) write_coord(origin[0]) write_coord(origin[1]) write_coord(origin[2]) write_coord(origin[0]) write_coord(origin[1]) write_coord(origin[2]) write_short(GREEN) write_byte(30) write_byte(10) write_byte(1) write_byte(50) write_byte(10) message_end() } _RPC }
public plugin_precache() { precache_sound("misc/headshot.wav") GREEN = precache_model("sprites/killed/green.spr") }
stock Set_Director_Hud_Message(red = 0,green = 160,blue = 0,Float:x = -1.0,Float:y = 0.65,effects = 2,Float:fxtime = 6.0,Float:holdtime = 3.0,Float:fadeintime = 0.1,Float:fadeouttime = 1.5,bool:reliable = false) { #define clamp_byte(%1) (clamp(%1,0,255)) #define pack_color(%1,%2,%3) (%3 + (%2 << 8) + (%1 << 16))
D_color = pack_color(clamp_byte(red),clamp_byte(green),clamp_byte(blue)) D_x = _:x D_y = _:y D_effect = effects D_fxtime = _:fxtime D_holdtime = _:holdtime D_fadeintime = _:fadeintime D_fadeouttime = _:fadeouttime D_reliable = _:reliable
return 1 }
stock Show_Director_Hud_Message(index,const message[],any:...) { static buffer[128], playersList[32], numPlayers, numArguments, size
numArguments = numargs() new Array:handleArrayML = ArrayCreate() size = ArraySize(handleArrayML)
if(numArguments == 2) { Send_Director_Hud_Message(index,message) } else if(index || numArguments == 3) { vformat(buffer,charsmax(buffer),message,3) Send_Director_Hud_Message(index,buffer) } else { get_players(playersList,numPlayers,"ch")
if(!numPlayers) { return 0 }
for(new i = 2, j; i < numArguments; i++) {
if(getarg(i) == LANG_PLAYER) { while((buffer[j] = getarg(i + 1,j++))){} j = 0
if(GetLangTransKey(buffer) != TransKey_Bad) { ArrayPushCell(handleArrayML,i++) } } } if(!size) { vformat(buffer,charsmax(buffer),message,3) Send_Director_Hud_Message(index,buffer) } else { for(new i = 0,j; i < numPlayers; i++) { index = playersList[i]
for(j = 0; j < size; j++) { setarg(ArrayGetCell(handleArrayML,j),0,index) } vformat(buffer,charsmax(buffer),message,3) Send_Director_Hud_Message(index,buffer) } } ArrayDestroy(handleArrayML) } return 1 }
stock Send_Director_Hud_Message(const index, const message[]) { message_begin(D_reliable ?(index ? MSG_ONE : MSG_ALL) : (index ? MSG_ONE_UNRELIABLE : MSG_BROADCAST),SVC_DIRECTOR,_,index) { write_byte(strlen(message) + 31) write_byte(DRC_CMD_MESSAGE) write_byte(D_effect) write_long(D_color) write_long(D_x) write_long(D_y) write_long(D_fadeintime) write_long(D_fadeouttime) write_long(D_holdtime) write_long(D_fxtime) write_string(message) } message_end() }
|
Superrr. Thanks.
Another request:
(victim,"HEAD SHOT" :-( Orange: Playername, Gray: Message.) ----> Showtime: 3 Sec.
(victim,"spk headcrap/hc_headbite.wav")
Can you do that?
Last edited by termra; 06-21-2017 at 18:00.
|
|