I'm making a new plugin called 'amx_score'
Usage: amx_score <user> <kills> <deaths>
I tried compiling this plugin on the AMX Mod X website at
www.amxmodx.org/compiler.php?go=sc
I get these errors:
/home/users/amxmodx/tmp/phplM6fME.sma(1
: error 033: array must be indexed (variable "deaths")
/home/users/amxmodx/tmp/phplM6fME.sma(19) : error 035: argument type mismatch (argument 1)
/home/users/amxmodx/tmp/phplM6fME.sma(20) : error 035: argument type mismatch (argument 1)
/home/users/amxmodx/tmp/phplM6fME.sma(22) : error 035: argument type mismatch (argument 2)
/home/users/amxmodx/tmp/phplM6fME.sma(23) : error 035: argument type mismatch (argument 2)
Here is my code.
Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
public plugin_init() {
register_plugin("AMX-Score","0.1","Rustynails")
register_clcmd("amx_score","do_score",ADMIN_BAN)
}
public do_score(id)
{
new user[32], kills[4], deaths[4], uid
read_argv(1,user,31)
read_argv(2,kills,3)
read_argv(3,deaths,3)
uid = find_player("bhl",user)
if (access(id,ADMIN_BAN)) {
if (deaths) {
if (isdigit(kills)) {
if (isdigit(deaths)) {
if (uid) {
set_user_frags(uid,kills)
cs_set_user_deaths(uid,deaths)
console_print(id,"Changed score.")
} else {
console_print(id,"No such user has been identified on this server.")
}
} else {
console_print(id,"The amount of deaths may only be in numbers.")
}
} else {
console_print(id,"The amount of kills may only be in numbers.")
}
} else {
console_print(id,"You did not supply enough information.")
}
} else {
console_print(id,"You do not have enough access to use this command.")
}
return PLUGIN_HANDLED
}
Thanks for your help.