PHP Code:
public Action:Event_Round_Start(Handle:event, const String:name[], bool:dontBroadcast)
{
iTime = GetTime();
CreateTimer(60.0, GodOff);
for(new i = 1; i<=MaxClients;i++)
{
if(IsClientInGame(i) && IsPlayerAlive(i))
SetEntProp(i, Prop_Data, "m_takedamage", 0, 1);
}
}
public Action:GodOff(Handle:timer)
{
int iRoundTime = GetTime() - iTime;
if(iRoundTime == 60) // Checking again time for bugs
{
for(new i = 1; i<=MaxClients;i++)
{
SetEntProp(i, Prop_Data, "m_takedamage", 2, 1);
}
CreateTimer(90.0, GiveBeacon);
}
}
public Action:GiveBeacon(Handle:timer)
{
int iRoundTime = GetTime() - iTime;
if(iRoundTime == 150)
{
ServerCommand("sm_beacon @all");
CreateTimer(90.0, blabla...);
}
}
...
How can I optimize this code?
I know, i'm really a poor coder