Thank you so much for your time and effort! but unfortunatelly plugin is not working as it should, i´m getting this error:
SV_StartSound: sound/misc/klaxon1.wav not precached (0)
I´ve put the sound available for download in the respective path but when I connect to the server it doesn´t download nothing.Could you pls check?Perhaps some precache command is missing, don´t know.
I think I did it!I just saw one plugin that uses precaching and copy the code I believe is necessary and include fakemeta could someone pls check if the code and procedure is correct?
Here it is the changed code:
PHP Code:
/* Formatright © 2009, ConnorMcLeod
Jail Rebel is free software;
you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Jail Rebel; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
// Includes
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>
#include <fun>
#include <fakemeta>
// New Const
new const VERSION[] = "1.0";
new const PREFIX[] = "^4[ JailBreak ]^1";
// sound
new const sz_Alarm[] = "sounds/klaxon1.wav";
//Defines
#define MAX_PLAYERS 32
#define IsPlayer(%1) ( 1 <= %1 <= g_iMaxPlayers )
// New Variables
new g_iTKills[MAX_PLAYERS+1]
new g_bRebel[MAX_PLAYERS+1]
new g_iMaxPlayers
new gmsgSayText
// Plugins Starts
public plugin_precache()
{
engfunc(EngFunc_PrecacheSound, sz_Alarm)
}
public plugin_init()
{
register_plugin("[JailBreak] Rebel Dector", VERSION, "ConnorMcLeod")
RegisterHam(Ham_Spawn, "player", "Player_Spawn_Post", 1)
register_event("DeathMsg", "Event_DeathMsg", "a")
register_event("Damage", "Event_Damage", "b", "2>0", "3=0")
g_iMaxPlayers = get_maxplayers()
gmsgSayText = get_user_msgid("SayText")
}
public client_putinserver(id)
{
g_bRebel[id] = false
g_iTKills[id] = 0
}
public Player_Spawn_Post( id )
{
if( is_user_alive( id ) )
{
g_bRebel[id] = false
g_iTKills[id] = 0
}
}
public Event_DeathMsg()
{
new iVictim = read_data(2)
if( cs_get_user_team( iVictim ) == CS_TEAM_T )
{
set_user_rendering(iVictim, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 1)
new iKiller = read_data(1)
if( IsPlayer( iKiller ) && cs_get_user_team( iKiller ) == CS_TEAM_CT )
{
if( g_bRebel[iVictim] )
{
new szVName[32], szKName[32]
get_user_name(iVictim, szVName, charsmax(szVName))
get_user_name(iKiller, szKName, charsmax(szKName))
client_print_c(0, "%s Guard^4 %s ^1killed rebel^4 %s", PREFIX, szKName, szVName)
}
}
}
}
public Event_Damage( id )
{
if( (read_data(4) || read_data(5) || read_data(6)) && cs_get_user_team(id) == CS_TEAM_CT )
{
new iAttacker = get_user_attacker(id)
if( IsPlayer(iAttacker)
&& !g_bRebel[iAttacker]
&& is_user_alive(iAttacker)
&& cs_get_user_team(iAttacker) == CS_TEAM_T )
{
new szName[32]
get_user_name(iAttacker, szName, charsmax(szName))
set_user_rendering(iAttacker, kRenderFxGlowShell, 250, 0, 0, kRenderNormal, 1)
g_bRebel[iAttacker] = true
client_print_c(0, "%s Prisoner^4 %s ^1is now a ^4rebel! ^1(Glowing Red) Take Him Down", PREFIX, szName)
emit_sound(0, CHAN_AUTO, sz_Alarm, 1.0, ATTN_NORM, 0, PITCH_NORM)
}
}
}
client_print_c(id, fmt[], any:...)
{
new szString[128]
szString[0] = 0x04
vformat(szString[1], sizeof( szString ) - 2, fmt, 3)
message_begin(id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, gmsgSayText, _, id)
write_byte(1)
write_string(szString)
message_end()
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang2070\\ f0\\ fs16 \n\\ par }
*/