Oooooooook, let me break it down for you.
Here we have your code in whole:
Code:
#include <amxmodx>
#include <fun>
public plugin_init ( ) {
register_plugin("Striker's Superman Plugin","0.1","Ryan 'Striker' Davis")
register_concmd("rp_superman","do_sm",ADMIN_KICK, " Sets user to Superman!")
}
public do_sm(id) {
if (!(get_user_flags(id) &ADMIN_KICK) ) {
console_print(id,"[Striker's RP] Get Admin douche!")
return PLUGIN_HANDLED
}
if (read_argc () == 0) {
console_print (id, "[Striker's RP] Who the fuck am I supposed to turn into Superman?")
return PLUGIN_HANDLED
}
new user[32], uid
read_argv(1,user,32)
uid = find_player ("bh",user)
if (uid == 0) {
console_print (id, "[Striker's RP] Hey, asshole, nobody here goes by that!")
return PLUGIN_HANDLED
}
new HEALTH(id) {
get_user_health(id)
set_user_health(id, 200)
}
client_cmd (uid,"name Superman")
console_print (id,"User Is now Superman.")
return PLUGIN_HANDLED
}
Now there are some really... really... wrong things here, lol.
First of all, let's start with plugin_init();
Code:
public plugin_init ( ) {
register_plugin("Striker's Superman Plugin","0.1","Ryan 'Striker' Davis")
register_concmd("rp_superman","do_sm",ADMIN_KICK, " Sets user to Superman!")
}
OK, now, in the entry for register_concmd on
http://amxmodx.org/funcwiki.php it says...
Code:
register_concmd ( const cmd[],const function[],flags=-1, info[]="" )
cmd[] = the command that you are going to put into the console, function[] is what function it is going to use,
flags is where you put what access you need to use the command, and info is what you see whenever a player types it in without any arguments.
Let me say this clearly, IF YOU SET THE FLAGS AS ADMIN_KICK, YOU CANNOT USE THE COMMAND IF YOU DO NOT HAVE UP TO ADMIN_KICK ADMIN ACCESS.
YOU DO NOT NEED TO FIND OUT THEIR ACCESS.
xD
So, let's look at do_sm();
Code:
if (!(get_user_flags(id) &ADMIN_KICK) ) {
console_print(id,"[Striker's RP] Get Admin douche!")
return PLUGIN_HANDLED
[/code]
OK, we can get rid of that...
Now, the next if statement,
Code:
if (read_argc () == 0) {
console_print (id, "[Striker's RP] Who the fuck am I supposed to turn into Superman?")
return PLUGIN_HANDLED
}
Alright, I see where you are going with this, but it is still very, very wrong lol.
AMXX kinda does this for you. If you were to enter no arguments, it would do nothing, so do not worry about this.
Now, we are assuming you want to type in rp_superman player'snamehere and have them be turned into superman. Well, this is kinda the wrong way to go with it.
So, instead, try this:
Code:
new arg1[256];
read_argv(1,arg1,255);
new pNum = get_playersnum(0);
new pName[256];
for (new i; i < pNum; ++i) {
get_user_name(i,pName,255);
if (equali(pName,arg1)) {
HEALTH(i);
}
}
return PLUGIN_HANDLED;
PM me with specific questions, or whatever you guys are planning to do.
(Also, try to go read over the Wiki again xD )
Edit: Forgot to fix Health for you.
Code:
new HEALTH(id) {
get_user_health(id)
set_user_health(id, 200)
client_cmd (id,"name Superman")
set_hudmessage (200,100,0,-1.0,0.35,0,6.0,12.0,0.1,0.2,4);
show_hudmessage(0,"HOMGSUPERMAN!(gaben)");
console_print (id,"User Is now Superman.")
return PLUGIN_HANDLED;
}