I want to put in this plugin time to start, and to end.. This is a plugin:
Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <cstrike>
const MAX_PLAYERS = 32;
new g_iRespawn[MAX_PLAYERS+1], g_TeamInfoCounter[MAX_PLAYERS+1], CsTeams:g_iPlayerTeam[MAX_PLAYERS+1];
new g_pCvarRespawnTime, g_pCvarRespawnDelay, g_pCvarMaxHealth;
public plugin_init()
{
register_plugin("Respawn Times", "0.0.1", "iBrazilian");
RegisterHam(Ham_Killed, "player", "fwdPlayerKilledPost", 1);
RegisterHam(Ham_Spawn, "player", "fwdPlayerSpawnPost", 1);
register_event("TeamInfo", "eTeamInfo", "a");
g_pCvarRespawnTime = register_cvar("amx_respawn_tickets", "30"); //Set to 0 for unlimited respawns
g_pCvarRespawnDelay = register_cvar("amx_respawn_delay", "3");
g_pCvarMaxHealth = register_cvar("amx_max_health", "100");
set_msg_block( get_user_msgid( "ClCorpse" ), BLOCK_SET );
}
public fwdPlayerKilledPost(iVictim, iKiller, iShoudlGib)
{
if(g_iRespawn[iVictim]++ < get_pcvar_num(g_pCvarRespawnTime) || get_pcvar_num(g_pCvarRespawnTime) == 0)
{
set_task(get_pcvar_float(g_pCvarRespawnDelay), "taskRespawnPlayer", iVictim);
}
return HAM_IGNORED;
}
public fwdPlayerSpawnPost(iClient)
{
if(is_user_alive(iClient))
{
set_pev(iClient, pev_health, get_pcvar_float(g_pCvarMaxHealth));
}
}
public taskRespawnPlayer(id)
{
if(is_user_connected(id) && !is_user_alive(id) && cs_get_user_team(id) != CS_TEAM_SPECTATOR) {
ExecuteHamB(Ham_CS_RoundRespawn, id)
return PLUGIN_HANDLED;
}
return PLUGIN_HANDLED;
}
public eTeamInfo()
{
new iClient = read_data(1);
new szTeam[2];
read_data(2, szTeam, charsmax(szTeam));
switch(szTeam[0])
{
case 'T':
{
if(g_TeamInfoCounter[iClient] == 2 || g_iPlayerTeam[iClient] == CS_TEAM_SPECTATOR)
{
set_task(get_pcvar_float(g_pCvarRespawnDelay), "taskRespawnPlayer", iClient);
}
g_iPlayerTeam[iClient] = CS_TEAM_T;
}
case 'C':
{
if(g_TeamInfoCounter[iClient] == 2 || g_iPlayerTeam[iClient] == CS_TEAM_SPECTATOR)
{
set_task(get_pcvar_float(g_pCvarRespawnDelay), "taskRespawnPlayer", iClient);
}
g_iPlayerTeam[iClient] = CS_TEAM_CT;
}
case 'S':
{
remove_task(iClient);
g_iPlayerTeam[iClient] = CS_TEAM_SPECTATOR;
}
}
}
And i want to put in, something like that... i try to put my self but not works..
Code:
new Float:RoundStartTime
#define TIME_INTERVAL 30.0
Wen the round start this plugin to be active for 30 second's, after 30 seconds to stop. And new round new 30 seconds to respawn. Thanks