AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Whats wrong with my snippet! (https://forums.alliedmods.net/showthread.php?t=6330)

TotalNoobScripter 09-27-2004 21:27

Whats wrong with my snippet!
 
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.

BillyTheKid 09-27-2004 22:11

Let me get this right!

amx_sjo <playername> and you want it to set a job for them
or do you want a player to be able to run the command amx_sjo and it sets the job for them!!!

TotalNoobScripter 09-27-2004 22:54

job
 
i want to set a job for them, but they cant set a job for themselves as in amx_sjo playername "New Job"

edit: on a personal note i love your signiture.

Select * from * where *=*;

TotalNoobScripter 09-28-2004 21:56

bump
 
*bump* plz help!


All times are GMT -4. The time now is 17:11.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.