Compile fails for some reason.
Code:
Error: Number of arguments does not match definition on line 25
The Line referred is above the commented area regarding
This Line Above Causes Compile Error
PHP Code:
#include <amxmodx>
#include <fun>
#include <hamsandwich>
#include <engine>
public plugin_init()
{
register_event("StatusValue", "event_status_value", "be", "1=2")
RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_knife", "AttackTest")
}
//Bot Fire (V1)
public event_status_value(id)
{
new target = read_data(2)
if (!target) // if player not aimed at target then we stop else continue
return
if (get_user_team(id) != get_user_team(target))
{
if ( is_user_bot(id) )
{
new szWp[24]
get_weaponname(get_user_weapon(id), szWp, 23);
new ent = find_ent_by_owner(-1, szWp);
//This Line Above Causes Compile Error//
if(ent > 0) AttackTest(ent)
}
}
}
public AttackTest(ent)
{
ExecuteHamB(Ham_Weapon_PrimaryAttack, ent)
}
Any idea what the issue may be? Thanks for your help by the way, I appreciate it!
EDIT: if I put "id" at the end of the conflicting line, it compiles, but it also Crashes the server once the bot looks at a player with No Error being logged!