hello, heres a section of code i need help with.
in the plugin init i have
Code:
// Admin Commands
register_concmd("amx_cmo","createmoney",ADMIN_LEVEL_E)
register_concmd("amx_dmo","destroymoney",ADMIN_LEVEL_E)
register_concmd("amx_ssa","setsalaries",ADMIN_LEVEL_E)
register_concmd("amx_sjo","setjobs",ADMIN_LEVEL_E)
then what i want to run is the amx_sjo (setjobs) funtcion.
Code:
public setjobs(id){
new authid[32],query[256];
get_user_authid(id,authid,31);
new argtarget[32];
read_argv(1,argtarget,31);
new target = cmd_target(id,argtarget,8);
if(!target) return PLUGIN_HANDLED;
new authid2[32];
get_user_authid(target,authid2,31);
format(query,255,"UPDATE money SET job=%s WHERE steamid='%s'",newjob,authid);
mysql_query(mysql,query);
format(query,255,"SELECT job FROM money WHERE steamid='%s'",authid);
mysql_query(mysql,query);
if(mysql_nextrow(mysql) > 0) {
mysql_getfield(mysql,1,currentjob,31);
client_print(id,print_notify,"You Job has been changed to %s",currentjob);
set_hudmessage(0,175,0,-1.0,-1.0,0,0.0,5.0,0.0,0.0,2);
show_hudmessage(id,"Your new job is %s",currentjob);
return PLUGIN_HANDLED;
} else {
client_print(id,print_notify,"There was an error somewhere.");
return PLUGIN_HANDLED;
the only problem is i dont know how to have arguments in the command that would be asigned to newjob and make a varable to return a current job. the authid thing i got from another script. plz plz plz help me. onceagain read my sig, don't yell at me, im a n00b.