Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
new PLUGIN[]="Nerd's revenge"
new AUTHOR[]="BRUm"
new VERSION[]="1.00"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_concmd("admin_nerd", "cmd_nerd", ADMIN_CHAT, "admin_nerd")
}
public cmd_nerd(id, level, cid)
{
//This will check if the user calling the command has the right access level.
if (!cmd_access(id, level, cid, 0)) {
//This terminates the command
return PLUGIN_HANDLED
}
//This prints a message to all clients
client_print(0, print_chat, "YoU hAvE bEeN cUrSeD bY tEh EvIl nErD!")
// Variable that hold information
new Players[32]
new playerCount
new player
// Get players only that are alive
get_players(Players, playerCount, "a")
for (new i=0; i<playerCount; i++)
{
new randomhealth
// player hold the index of the player.
player = Players[i]
// Random a number from 1 to 255 for health
randomhealth = random_num(1, 255)
if(is_user_connected(player) && is_user_connected(player))
{
// Set user health from (Any number above 255 will not display correctly on the health bar.)
set_user_health(player, randomhealth)
}
}
return PLUGIN_HANDLED
}
/*small /small*/
__________________