Couple adjustments:
Event_arena_win_panel
Move - ResetPlayer(client) up a few lines to remove the second, unless for loop.
Delete - RemoveAnimeModel(client); and move it into Event_player_spawn - (fixes the invisible player model at the end of the round)
Timer_TimeUp
use this code for ending the round rather than suiciding
PHP Code:
public Action:Timer_TimeUp(Handle:timer, any:data)
{
if(!g_RoundOver)
ForceTeamWin(TEAM_RED);
g_RoundTimer = INVALID_HANDLE;
}
PHP Code:
stock ForceTeamWin (team)
{
new ent = FindEntityByClassname(-1, "team_control_point_master");
if (ent == -1)
{
ent = CreateEntityByName("team_control_point_master");
DispatchSpawn(ent);
AcceptEntityInput(ent, "Enable");
}
SetVariantInt(team);
AcceptEntityInput(ent, "SetWinner");
}
Touch
Do not hook touch for every player, rather hook the entity for the control point itself using this code:
PHP Code:
public Hook_OnEntitySpawned(entity)
{
decl String:propName[500];
GetEntPropString(entity, Prop_Data, "m_ModelName", propName, sizeof(propName));
if(StrEqual(propName, "models/props_gameplay/cap_point_base.mdl"))
SDKHook(entity, SDKHook_StartTouch, Hook_StartTouch);
}
You will need to use this code to hook ent spawning (which can be used for player spawning if you switch to the class change code already suggested)
PHP Code:
new bool:g_PointFound = false;
public OnEntityCreated(entity, const String:classname[])
{
if (!g_PointFound)
if (StrEqual(classname, "prop_dynamic") || StrEqual(classname, "prop_static"))
{
SDKHook(entity, SDKHook_Spawn, Hook_OnEntitySpawned);
g_PointFound = true;
}
}
__________________