Hello all, i would like to make a simple plugin.
Respawn player on connect, when player connected and selected team, he should be respawned. How to make it?
I have simple script, but it doesn't work all time, sometimes it's works sometimes no. And idk why...
Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <hamsandwich>
#define PLUGIN "Spawn on connect"
#define VERSION "1.0"
#define AUTHOR "aaarnas"
new client_validate[33]
public plugin_init()
register_plugin(PLUGIN, VERSION, AUTHOR)
public client_connect(id)
client_validate[id] = 0
public client_command(id) {
new cmd[20]
read_argv(0, cmd, charsmax(cmd))
if(equal(cmd, "jointeam")) client_validate[id]++
else if(equal(cmd, "joinclass")) client_validate[id]++
if(client_validate[id] == 2) set_task(0.3, "spawn_player", id)
}
public spawn_player(id) if(!is_user_alive(id)) ExecuteHamB(Ham_CS_RoundRespawn, id)