Od początku będzie problem napisać jednak mam coś takiego i wywala błędy z lini 84 czyli to
show_hudmessage(idattacker, "%s dostal od kurczaka dodatkowe HP!", name);
W innych pluginach/cmd ta komenda działa,a tutaj errory wywala
:
#include <amxmodx>
#include <hamsandwich>
#include <engine>
#include <cstrike>
#pragma semicolon 1
#define PLUGIN_VERSION "1.0.0"
#define HUD_COLOR_R 255
#define HUD_COLOR_G 0
#define HUD_COLOR_B 0
new gCvarEnabled;
new gCvarChickenKillFrags;
new gCvarChickenKillMoney;
new gCvarChickenKillShowKiller;
new ickslapdmg;
new gHudSyncCreate;
new const gChickenModelIndexes[][] =
{
"*63",
"*66"
};
new const gChickenKilledSound[] = "misc/killChicken.wav";
public plugin_init()
{
register_plugin( "Italy Chicken Killer", PLUGIN_VERSION, "tuty" );
new szMapName[ 10 ];
get_mapname( szMapName, charsmax( szMapName ) );
if( equali( szMapName, "cs_italy" ) )
{
RegisterHam( Ham_TakeDamage, "func_breakable", "bacon_BreakableKilled", 1 );
gCvarEnabled = register_cvar( "italy_chicken_kill", "1" );
gCvarChickenKillFrags = register_cvar( "italy_chicken_frags", "2" );
gCvarChickenKillMoney = register_cvar( "italy_chicken_money", "500" );
gCvarChickenKillShowKiller = register_cvar( "italy_chicken_showkiller", "1" );
ickslapdmg = register_cvar( "italy_chicken_slap_dmg", "40" );
gHudSyncCreate = CreateHudSyncObj();
}
else
{
pause( "a" );
log_amx( "# [AMXX] :: Plugin zostal zapauzowany poniewaz gramy teraz <%s>.", szMapName );
}
}
public plugin_precache()
{
precache_sound( gChickenKilledSound );
}
public bacon_BreakableKilled( this, idinflictor, idattacker, Float:damage, damagebits )
{
if( get_pcvar_num( gCvarEnabled ) != 0 && entity_get_float( this, EV_FL_health ) <= 0 )
{
new szModelIndex[ 12 ];
entity_get_string( this, EV_SZ_model, szModelIndex, charsmax( szModelIndex ) );
new szNameIndex[ 32 ];
get_user_name( idattacker, szNameIndex, charsmax( szNameIndex ) );
for( new i = 0; i < sizeof( gChickenModelIndexes ); i++ )
{
if( equal( szModelIndex, gChickenModelIndexes[ i ] ) )
{
switch(random_num(1,200))
{
case 1 .. 30:{
{
entity_set_float( idattacker, EV_FL_frags, float( get_user_frags( idattacker ) + get_pcvar_num( gCvarChickenKillFrags ) ) );
cs_set_user_money( idattacker, cs_get_user_money( idattacker ) + get_pcvar_num( gCvarChickenKillMoney ), 1 );
set_hudmessage(0, 255, 0, -1.0, -1.0)
show_hudmessage(idattacker, "%s dostal od kurczaka dodatkowe HP!", name);
}
case 31 .. 61:{
set_hudmessage(0, 255, 0, -1.0, -1.0)
show_hudmessage(idattacker, "%s dostal od kurczaka dodatkowe HP!", name);
client_print(idattacker,print_chat,"Otrzymales HP od kurczaka!");
set_user_health(idattacker, get_user_health(idattacker) + get_cvar_num("ickhp") );
}
case 62 .. 100:{
user_slap( idattacker, get_pcvar_num( ickslapdmg ) );
set_hudmessage(0, 255, 0, -1.0, -1.0)
show_hudmessage(idattacker, "Kurczak zranil %s o 40HP!");
client_print(idattacker,print_chat,"Straciles 40 HP!");
}
case 101 .. 151:{
entity_set_float( idattacker, EV_FL_frags, float( get_user_frags( idattacker ) - get_pcvar_num( ickfragminus ) ) );
set_hudmessage(0, 255, 0, -1.0, -1.0)
show_hudmessage(idattacker, "%s tym razem mial peha!", name);
client_print(idattacker,print_chat,"Kurak zabral Ci fraga!");
}
case 152 .. 185:{
user_slap( idattacker, get_pcvar_num( ickslapdmg ) );
set_hudmessage(0, 255, 0, -1.0, -1.0)
show_hudmessage(idattacker, "Kurczak zranil %s o 40HP!");
client_print(idattacker,print_chat,"Straciles 40 HP!");
}
case 186 .. 200:{
user_kill( idattacker );
client_print(idattacker,print_chat, "Zostales zjedzony przez kuraka!");
set_hudmessage(0, 255, 0, -1.0, -1.0)
show_hudmessage(id, "%s zostal zjedzony przez kurczaka!", name);
}
}
if( get_pcvar_num( gCvarChickenKillShowKiller ) != 0 )
{
set_hudmessage( HUD_COLOR_R, HUD_COLOR_G, HUD_COLOR_B, -1.0, 0.72, 2, 6.0, 4.0 );
ShowSyncHudMsg( 0, gHudSyncCreate, "!! %s zabil kurczaka !!", szNameIndex );
client_cmd( 0, "speak ^"%s^"", gChickenKilledSound );
}
}
}
}
}