 |
|
Junior Member
|

03-26-2014
, 03:28
Re: Amxx studio error!
|
#6
|
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#define PLUGIN "Headshot Double Frag"
#define VERSION "1.0"
#define AUTHOR "Phantom~"
new toggle
new frags
new sound
new pun_list[][]
{
"%s has turned %s head into a red jello!!"
"%s gave %s a glimpse of his cold blooded murder !!!!"
};
new plugin_precache()
{
precache_sound("sound/headshot.wav")
}
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("deathmsg", "hook_death", "a");
toggle = register_pcvar("hsdf_enabled" "1");
sounds = register_cvar("kdf_sounds","1");
frags = register_pcvar("hsdf_frags" "1");
}
public hook_death()
{
if(get_pcvar_num(toggle) != 1)
return PLUGIN_HANDLED;
new amount = 0;
new killer = read_data(1);
new victim = read_data(2);
new kname[32]; get_user_name(killer,kname,31);
new vname[32]; get_user_name(victim,vname,31);
new weapon[24];
new namount[32];
read_data(4,weapon,23);
if(weapon[0] == 'k' && get_user_team(killer) != get_user_team(victim))
{
inc_frag(killer);
if(get_pcvar_num(getmoney) == 1)
{
amount = cs_get_user_frags(victim)*random(5)/4;
}
num_to_str(amount, namount, 32);
if(bsounds(sounds)) client_cmd(0,"spk misc/headshot");
}
return PLUGIN_HANDLED;
}
inc_frag(index)
{
if(!is_user_connected(index)) return;
set_user_frags(index,get_user_frags(index)+ge t_pcvar_num(frags));
}
bool: bsounds(pcvar)
{
if(get_pcvar_num(pcvar) == 1)
return true;
return false;
}
This is the code its not compiling.
The Errors:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team
Error: Start of function body without function header on line 17
Error: Invalid function or declaration on line 20
Error: Expected token: ";", but found "(" on line 22
Error: Undefined symbol "register_pcvar" on line 31
Warning: Expression has no effect on line 31
Error: Expected token: ";", but found ")" on line 31
Error: Invalid expression, assumed zero on line 31
Error: Too many error messages on one line on line 31
Compilation aborted.
7 Errors.
Could not locate output file (compile failed).
Last edited by Hologram; 03-26-2014 at 03:34.
|
|
|
|