I've only corrected the tag mismatch warnings, not the critical errors
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
#include <cstrike>
#include <engine>
new owner
new CsTeams:Ownerteam
public plugin_init()
{
register_plugin("Nade-Slap","1.0","r4nDoMz")
register_cvar("nslap_dmg", "5")
register_touch("grenade", "player", "touch_nade")
register_cvar("amx_nslap", "1")
RegisterHam( Ham_Weapon_PrimaryAttack, "weapon_hegrenade", "Nadethrow", 1 ) // If the user throws a nade, we get the origin of it in the function
RegisterHam( Ham_Weapon_PrimaryAttack, "weapon_flashbang", "Nadethrow", 1 )
RegisterHam( Ham_Weapon_PrimaryAttack, "weapon_smokegrenade", "Nadethrow", 1 )
}
public touch_nade(nade, id)
{
new CsTeams:hitTeam = cs_get_user_team(id)
if(Ownerteam == hitTeam)
{
return
}
if(!get_cvar_num("amx_nslap"))
{
return
}
entity_set_edict(nade, EV_ENT_aiment, id)
user_slap(id, get_cvar_num("nslap_dmg"), 0)
entity_set_int(nade, EV_INT_sequence, 0)
}
public Nadethrow()
{
pev(pev_owner, owner)
Ownerteam = cs_get_user_team(owner)
}