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) {
new user[256];
read_argv(1,user,255);
// The computer does not know who you are asking about. You must tell it.
// Try looking over the natives: www.amxmodx.org/funcwiki.php?
// (Note, I changed this to check if the player is alive. ID is your id in the server.
if (!is_user_alive(id)) {
console_print(id,"[Striker's RP] You must be alive to use this command.")
return PLUGIN_HANDLED
}
/* This is not needed... Plus, there would be no command here.
read_argc returns the amount of commands, and if it returned 2, the amount
of arguments would really be 1, because it counts the command itself (in this case
that is do_sm).
If you do not enter anything, it repeats the help command.
if (read_argc () == 0) {
console_print (id, "[Striker's RP] Who the fuck am I supposed to turn into Superman?")
return PLUGIN_HANDLED
}*/
// I am now telling it to go to HEALTH now, forwarding the 'id' of the player.
HEALTH(id);
return PLUGIN_HANDLED;
}
new HEALTH(id) {
//get_user_health(id) We don't need to find their health if we're just gonna rewrite it. :P
set_user_health(id, 200)
//} We don't want this. O: It'll close HEALTH before it has done its job.
client_cmd (uid,"name Superman")
client_print(id,print_chat,"YOU ARE NOW SUPERMAN! O:");
new i;
do {
++i;
if (i != id) {
client_print(i,print_chat,"Watch out! Superman is here!");
}
} while (i <= 32);
return PLUGIN_HANDLED
}
Nice attempt, but please, read the documentation over again.
And keep IE or FireFox or whatever you use open so you can access amxmodx.org/funcwiki.php for whenever you need to do something creative.
Edit: DeathMsg byte, byte, byte, string 1: Killer ID, 2: Victim ID, 3: Headshot, 4:Weapon Name
Leeeeeeeeeeeeeeeeeeeeeeeeearn. o_o
register_event ( const event[], const function[], const flags[], [ cond=[], ... ] )
So, something along the lines of...
Code:
register_event("DeathMsg","SETNORM")
Try figuring out what to do in the function SETNORM, and post it here, we'll see how ya did.