Member
|
04-23-2024
, 22:22
Slay Fire
|
#1
|
Hello!
This plugin are supposed to burn players alive to death. the plugin made by f117bomb, i just found it yesterday but i got 2 problems
-There is no Effects, Sounds
-If you try to burn other players you die to
can anyone fix it
PHP Code:
/* AMX Mod script.
*
* (c) Copyright 2002-2003, f117bomb
* This file is provided as is (no warranties).
*/
#include <amxmodx>
#include <amxmisc>
#include <fun>
public plugin_init()
{
register_plugin("AINO Commands", "2.0", "AMX(x) Community")
register_dictionary("admin_allinone.txt")
register_concmd("amx_slay_fire","fire_player",ADMIN_MAP,"<authid, nick or #userid>")
}
new gmsgDamage,smoke,mflash
new onfire[33]
public fire_player(id,level,cid) {
if (!cmd_access(id,level,cid,2))
return PLUGIN_HANDLED
new arg[32]
read_argv(1,arg,31)
new victim = cmd_target(id,arg,7)
if (!victim)
return PLUGIN_HANDLED
new skIndex[2]
skIndex[0] = victim
new name[32]
get_user_name(victim,name,31)
onfire[victim] = 1
ignite_effects(skIndex)
ignite_player(skIndex)
new adminname[32]
get_user_name(id,adminname,31)
switch(get_cvar_num("amx_show_activity")) {
case 2: client_print(0, print_chat, "%L", LANG_PLAYER, "AINO_FIRE_PLAYER_CASE2", adminname, name)
case 1: client_print(0, print_chat, "%L", LANG_PLAYER, "AINO_FIRE_PLAYER_CASE1", name)
}
console_print(id, "%L", LANG_PLAYER, "AINO_FIRE_PLAYER_SUCCESS",name)
log_amx("%L", LANG_SERVER, "AINO_LOG_FIRE_PLAYER", adminname, name)
return PLUGIN_HANDLED
}
public ignite_effects(skIndex[]) {
new kIndex = skIndex[0]
gmsgDamage = get_user_msgid("Damage")
if (is_user_alive(kIndex) && onfire[kIndex] ) {
new korigin[3]
get_user_origin(kIndex,korigin)
//TE_SPRITE - additive sprite, plays 1 cycle
message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
write_byte( 17 )
write_coord(korigin[0]) // coord, coord, coord (position)
write_coord(korigin[1])
write_coord(korigin[2])
write_short( mflash ) // short (sprite index)
write_byte( 20 ) // byte (scale in 0.1's)
write_byte( 200 ) // byte (brightness)
message_end()
//Smoke
message_begin( MSG_BROADCAST,SVC_TEMPENTITY,korigin)
write_byte( 5 )
write_coord(korigin[0])// coord coord coord (position)
write_coord(korigin[1])
write_coord(korigin[2])
write_short( smoke )// short (sprite index)
write_byte( 20 ) // byte (scale in 0.1's)
write_byte( 15 ) // byte (framerate)
message_end()
set_task(0.2, "ignite_effects" , 0 , skIndex, 2)
}
else {
if( onfire[kIndex] ) {
emit_sound(kIndex,CHAN_AUTO, "scientist/scream21.wav", 0.6, ATTN_NORM, 0, PITCH_HIGH)
onfire[kIndex] = 0
}
}
return PLUGIN_CONTINUE
}
public ignite_player(skIndex[]) {
new kIndex = skIndex[0]
if (is_user_alive(kIndex) && onfire[kIndex] ) {
new korigin[3]
new players[32], inum = 0
new pOrigin[3]
new kHeath = get_user_health(kIndex)
get_user_origin(kIndex,korigin)
//create some damage
set_user_health(kIndex,kHeath - 10)
message_begin(MSG_ONE, gmsgDamage, {0,0,0}, kIndex)
write_byte(30) // dmg_save
write_byte(30) // dmg_take
write_long(1<<21) // visibleDamageBits
write_coord(korigin[0]) // damageOrigin.x
write_coord(korigin[1]) // damageOrigin.y
write_coord(korigin[2]) // damageOrigin.z
message_end()
//create some sound
emit_sound(kIndex,CHAN_ITEM, "ambience/flameburst1.wav", 0.6, ATTN_NORM, 0, PITCH_NORM)
//Ignite Others
get_players(players,inum,"a")
for(new i = 0 ;i < inum; ++i) {
get_user_origin(players[i],pOrigin)
if( get_distance(korigin,pOrigin) < 100 ) {
if( !onfire[players[i]] ) {
new spIndex[2]
spIndex[0] = players[i]
new pName[32], kName[32]
get_user_name(players[i],pName,31)
get_user_name(kIndex,kName,31)
emit_sound(players[i],CHAN_WEAPON ,"scientist/scream07.wav", 1.0, ATTN_NORM, 0, PITCH_HIGH)
client_print(0, 3, "%L", LANG_PLAYER, "* [AMXX] OH! NO! %s has caught %s on fire!",kName,pName)
onfire[players[i]] =1
ignite_player(players[i])
ignite_effects(players[i])
}
}
}
players[0] = 0
pOrigin[0] = 0
korigin[0] = 0
//Call Again in 2 seconds
set_task(2.0, "ignite_player" , 0 , skIndex, 2)
}
return PLUGIN_CONTINUE
}
|
|