I'm working on my first plugin, and its desiged to stack multiple people on the admin that gave the command. Heres my product, it compiles fine but the problem is it just does work, plain and simple. I have a feeling its a problem with the loop more than anything, but I'm stumped. Help is much appriciated.
Also 1 more question. I'm having trouble figuring out the difference between the commands
Code:
cmd_access(id,level,cid,1)
and
Code:
cmd_access(id,level,cid,0)
Thanks for all your help eXist.
Code:
#include <amxmodx>
#include <fun>
#include <amxmisc>
#define PLUGIN_NAME "Stack X"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "eXist`"
public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
register_concmd("amx_stackall", "stack_all", ADMIN_KICK, "user All Players in the server will be stacked upon the admin.")
public stack_all(id,level,cid)
{
if (!cmd_access(id,level,cid,1))
{
return PLUGIN_HANDLED
}
new players[32], origin[3], playercount, player, a
get_user_origin(id, origin, 0)
get_players(players, playercount, "a")
for (a=0; a<playercount, a++; )
{
player = players[a]
origin[2] = origin[2] + 50
set_user_origin(player, origin)
}
return PLUGIN_HANDLED
}