Correct the code pls
When compile:
Code:
//AMXXPC compile.exe
// by the AMX Mod X Dev Team
//// Unstoppable.sma
// D:\Dovydo\Counter - strike Failai\Addonai\L4DPlague\L4DPlague\addons\amxmodx\
scripting\Unstoppable.sma(98) : warning 213: tag mismatch
// D:\Dovydo\Counter - strike Failai\Addonai\L4DPlague\L4DPlague\addons\amxmodx\
scripting\Unstoppable.sma(99) : warning 213: tag mismatch
// D:\Dovydo\Counter - strike Failai\Addonai\L4DPlague\L4DPlague\addons\amxmodx\
scripting\Unstoppable.sma(105) : error 035: argument type mismatch (argument 2)
// D:\Dovydo\Counter - strike Failai\Addonai\L4DPlague\L4DPlague\addons\amxmodx\
scripting\Unstoppable.sma(106) : error 035: argument type mismatch (argument 2)
// D:\Dovydo\Counter - strike Failai\Addonai\L4DPlague\L4DPlague\addons\amxmodx\
scripting\Unstoppable.sma(112) : warning 209: function "Unstoppable" should retu
rn a value
//
// 2 Errors.
// Could not locate output file D:\Dovydo\Counter - strike Failai\Addonai\L4DPla
gue\L4DPlague\addons\amxmodx\scripting\compiled\Unstoppable.amx (compile failed)
.
//
// Compilation Time: 0,22 sec
// ----------------------------------------
Press enter to exit ...
Full Code:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <amxmisc>
#include <fun>
#include <cstrike>
#define PLUGIN "Unstoppable"
#define VERSION "1.0"
#define AUTHOR "DoviuX"
/*================================================================================
[Customization]
=================================================================================*/
new const gIsUnstoppable[][] = {
"sound/Unstoppable1.wav",
"sound/Unstoppable2.wav",
"sound/Unstoppable3.wav"
}
new const gNoMoney[] = "sound/NoMoney.wav"
new const Model[] = { "model/player/Unstoppable/Unstoppable.mdl" }
/*================================================================================
[New Variables]
=================================================================================*/
//Unstoppable stuff...
new price
new health
new speed
new gravity
new armor
/*================================================================================
[Init and Precache]
=================================================================================*/
public plugin_init()
{
register_plugin( PLUGIN, VERSION, AUTHOR );
register_clcmd("say /unstoppable", "Unstoppable")
register_clcmd("say_team /unstoppable", "Unstoppable")
price = register_cvar("un_unstoppable", "16000")
health = register_cvar("un_health", "1000");
speed = register_cvar("un_speed", "295");
gravity = register_cvar("un_gravity", "0.6");
armor = register_cvar("un_armor", "300");
}
public plugin_cfg()
{
// Get configs dir
new cfgdir[32]
get_configsdir(cfgdir, charsmax(cfgdir))
// Execute config file (Unstoppable.cfg)
server_cmd("exec %s/Unstoppable.cfg", cfgdir)
}
/*================================================================================
[Plugin Start]
=================================================================================*/
public plugin_precache()
{
for(new i = 0; i < sizeof gIsUnstoppable; i++)
precache_generic( gIsUnstoppable[ i ] )
precache_sound(gNoMoney)
precache_model( Model);
}
public Unstoppable(id)
{
new Cost = get_pcvar_num(price);
new Money = cs_get_user_money(id);
if (Money < Cost)
{
set_hudmessage( 225, 225, 225, -1.0, 0.29, 2, 6.0, 12.0 );
show_hudmessage( 0, "You don't have enough money!" );
client_cmd( 0, "spk %s", gNoMoney);
return PLUGIN_HANDLED;
}
else
{
new name[32];
get_user_name(id,name,31);
set_hudmessage( 225, 225, 225, -1.0, 0.29, 2, 6.0, 12.0 );
show_hudmessage( 0, "%s is now unstoppable!", name);
cs_set_user_model( id, "Model")
set_user_health( id, get_pcvar_num( health ) )
set_user_maxspeed( id, get_pcvar_num( speed ) )
set_user_gravity( id, get_pcvar_num( gravity ) )
set_user_armor( id, get_pcvar_num( armor ) )
client_cmd( id, "spk %s", gIsUnstoppable[random_num(0, sizeof gIsUnstoppable - 1)])
strip_user_weapons(id)
give_item( id, "weapon_m4a1")
give_item( id, "weapon_deagle")
cs_set_user_bpammo( id, "weapon_m4a1", 200 )
cs_set_user_bpammo( id, "weapon_deagle", 200 )
Money -= Cost;
cs_set_user_money(id, Money);
}
}
|