Its the first time im making a plugin, so don't be to hard on me
Im trying to make a plugin to punish people saying lol, so its the SayLolGetSlap plugin. But because its the first time, i screwed something up so it doesnt work.
I used rolnaaba's script ,
http://forums.alliedmods.net/showthread.php?t=41148 , but im stuck on something , instead of getting hp in that plugin, i wanted to let someone lose hp, so what did i do? I changed the number of health to -1. But somehow, when im testing it, and i say lol, my hp doesnt goes down, and i cant activate it. The other problem is, the slapping effect, if i use this script there wont be slapped, but just -1 hp, so could someone help me with that? Here's the code:
Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
public plugin_init()
{
register_plugin("Say Lol And Get Slapped", "1.0", "eXec")
register_concmd("say lol", "lol")
register_cvar("slaplol_on", "1")
}
public func_gethp(id)
{
if(get_cvar_num("slaplol_on") == 0)
{
return PLUGIN_HANDLED
}
else
{
set_user_health(id, get_user_health(id) - 1)
return PLUGIN_HANDLED
}
return PLUGIN_HANDLED
}
__________________