hey guys i'm having problem with this.. i want to detect the weapons of players if it has this specific weapon (example M249) and if that player has that weapon this commands will run but only on that player that has that specific weapon..and it checks that weapon after each player spawn, because my server gives weapons auto when respawn and also has resapwn, ..thanks
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <engine>
#define PLUGIN "M249"
#define VERSION "1.0"
#define AUTHOR "razieljohn619"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
set_task(5.0, "hasWeapon");
}
public hasWeapon(id, weapid){
new weapons[32], wnum
get_user_weapons(id, weapons, wnum)
for(new i = 0; i < wnum; i++){
if(weapons[i] == weapid) return 1
}
return 0
}
if(user_has_weapon(id, CSW_M249)){
entity_set_int(weapon, EV_INT_iuser4, 1)
set_task(0.01, "//commands..")
{
else
}
set_task(0.01, "//commands2..")
}
public //commands..(id)
{
//commands..
}
public //commands2..(id)
{
//commands..
}
and also if player does not have that weapon the commands2 will run only on that player but if it has,. the commands.. will run on that player..hope you guys understand. i'm really hoping that this will work
and the errors are:
Code:
invalid declaration or something
unmatched closing brace
__________________