Quote:
Originally Posted by deprale
PHP Code:
#include <amxmodx> #include <hamsandwich> #include <fakemeta> new bool:isDefusing new defuser
//const m_bIsDefusing = 929 // (1.8.3+ only) 949 if linux (didn't work in my tests, default hlds with amxx 1.10)
public plugin_init( ) { register_plugin( "Stop Def on Dmg", "alliedmods", "1.0" ) RegisterHam( Ham_TakeDamage, "player", "fw_TakeDamage" ) register_event("BarTime", "bomb_defuse_start", "be", "1=5", "1=10") register_event("BarTime", "bomb_defuse_stop", "b", "1=0") }
public bomb_defuse_start(id) { isDefusing = true defuser = id }
public bomb_defuse_stop(id) { isDefusing = false }
public fw_TakeDamage( victim, inflictor, attacker, Float:damage ){ if (is_user_connected(victim) && (victim == defuser && isDefusing) ) { StopDefuser(victim) } }
StopDefuser(const player) //Credits https://forums.alliedmods.net/showpost.php?p=2592752&postcount=4 { const m_bStartDefuse = 384 const m_bIsDefusing = 929 static gmsgBarTime
if(!gmsgBarTime) { gmsgBarTime = get_user_msgid("BarTime") }
if( is_user_connected(player) ) { set_pdata_bool(player, m_bIsDefusing, false) set_pdata_bool(player, m_bStartDefuse, false) message_begin(MSG_ONE, gmsgBarTime, _, player) { write_short(0) message_end() } engclient_cmd(player, "lastinv") engclient_cmd(player, "lastinv") } }
|
Thanks, very kind.
having an error compiling it:
C:\Users\efler\Desktop\addons\amxmodx\scripti ng\custom_def_cancel.sma(1) : fatal error 100: cannot read from file: "á<amxmodx>"
the code is exactly the same , i suspect there is something wrong with my compiler
edit: i dont think there is a problem with my compiler, but im getting this on several code i found browsing the forums.
all my 40 plugins recompile without this issue. anyone know what's up?
i even downloaded amx on another pc , copied your code, tried to compile it and didnt work. so not a problem on my end,
not even with a web compiler, amx studio or a random pawn compiler from github.
what is going on?