Why use server_cmd with slap? Use user_slap with id. Your plugin will not always work like that.
PHP Code:
#include <amxmodx>
#include <amxmisc>
#define TASK_SLAP 545543
#define TIME_SLAP 3000.0
public plugin_init()
register_plugin("Auto Slap on X Seconds", "1.0", "OciXCrom")
public client_putinserver(id)
{
new TASK = TASK_SLAP + id
if(task_exists(TASK)) remove_task(TASK)
set_task(TIME_SLAP, "slapEveryone", TASK, _, _, "b")
}
public slapEveryone(TASK)
{
new id = TASK - TASK_SLAP
user_slap(id, 0)
}