thanks for all the replys,
i changed the code to this
Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#define PLUGIN "Test rip ammo"
#define VERSION "1.1 rc1"
#define AUTHOR "TEST"
#define free 10
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
set_task(float(free),"steal_ammo",_,_,_,"b")
}
public steal_ammo(){
for (new i = 0; i <= get_maxplayers(); i++) {
if (is_user_alive(i) && is_user_connected(i) && !is_user_bot(i) && !is_user_hltv(i)) {
cs_set_weapon_ammo(i,0)
new clip, ammo, wid = get_user_weapon(i, clip,ammo)
cs_set_user_bpammo(i,cs_get_weapon_id (wid),0)
set_hudmessage(255, 255, 255, 0.11, 0.31, 0, 6.0, 12.0)
show_hudmessage(i, "Oh no! The grim reaper has killed all your ammo ;P")
}
}
return PLUGIN_HANDLED
}
i borrowed the user id code from Cheesy Peteza's AFk Kicker
however i now get the following error
Code:
[CSTRIKE] Non-player entity 1 out of range
[AMXX] Run time error 10 (plugin "test.amxx") - debug not enabled!
[AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
i have also set amx_debug to "2"
thanks in advance
Xcalibar