Here. Analyze what I did with the code.
Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#define PLUGIN "IDK"
#define VERSION "1.0"
#define AUTHOR "nwQ"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /lol","hpa")
register_clcmd("say lol","hpa")
}
public hpa(id) {
new Heath = get_user_health(id);
new randomNum = random(3);
if(!is_user_alive(id))
{
client_print(id,print_center,"Jestes martwy stary xP");
return PLUGIN_HANDLED;
}
switch(randomNum)
{
case 0:
{
give_item(id,"weapon_ak47");
client_print(0,print_chat,"Dostales AK xD");
}
case 1:
{
set_user_health(id,Heath + 149);
client_print(id,print_center,"Dostales zycie xP");
}
case 2:
{
give_item(id,"weapon_m4a1");
client_print(id,print_chat,"Dostales M4 xD")
}
}
return PLUGIN_HANDLED
}
__________________