about the for loops. It's actually quite simple.
PHP Code:
new players[32]; // To hold the players id.
new pnum; // The amount of players.
new tempid; // To store the temporary player ids
get_players(players, pnum); // Counts the players
for(i = 0; i < pnum; i++)
{
// i < pnum means as long as i smaller then the amount of players, it continues to loop
tempid = players[i] // store the temporary id in a var
if(!is_user_alive(tempid))// If he is dead, skip him
continue;
set_user_health(tempid, 100); // Just an example
}
Respawn thing:
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#pragma semicolon 1
public plugin_init()
{
register_plugin("respawn", "1.0", "Drekes");
register_clcmd("say respawn", "cmd_respawn");
}
public cmd_respawn(id)
{
if(get_user_team(id) != 1 || get_user_team(id) != 2)
{
new userid = get_user_userid(id);
server_cmd("amx_kick %i ^"Don't try to respawn when you are not in a team^"", userid);
return PLUGIN_HANDLED;
}
ExecuteHamB(Ham_CS_RoundRespawn, id);
return PLUGIN_HANDLED;
}
Not tested but should work
__________________