12.08.2015, 19:06
i fail to make it textdraw but chek this if you like it tell me o.o:
PHP код:
forward gangzonetimer(playerid);
new timer1[MAX_PLAYERS];
new count = 120;
public ZoneUpdate()
{
for(new z=0; z < MAX_ZONES; z++)
{
if(ZoneTakeOverTeam[z] == -1)
{
for(new t=0; t < MAX_TEAMS; t++)
{
if(t == ZoneInfo[z][z_team]) continue;
if(GetMembersInZone(z, t) >= 1)
{
ZoneTakeOverTeam[z] = t;
timer1[playerid] = SetTimerEx("gangzonetimer", 1000, 1, "d", playerid);
GameTextForPlayer(playerid, "~r~Gang Zone War CountDown Started", 1000, 0);
ZoneTakeOverTime[z] = 0;
}
}
}
else
{
if(GetMembersInZone(z, ZoneTakeOverTeam[z]) > 0)
{
ZoneTakeOverTime[z]++;
if(ZoneTakeOverTime[z] >= 120)
{
GangZoneStopFlashForAll(ZoneInfo[z][z_id]);
KillTimer(timer1[playerid]);
GangZoneShowForAll(ZoneInfo[z][z_id], GetTeamColor(ZoneTakeOverTeam[z]));
ZoneInfo[z][z_team] = ZoneTakeOverTeam[z];
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(GetPlayerZone(i) == z && gTeam[i] == ZoneTakeOverTeam[z])
{
SetPlayerScore(i, GetPlayerScore(i) + 2);
pInfo[i][pKills] += 2;
GameTextForPlayer(i, "~g~Turf ~r~taken over~n~~b~~h~+2 score", 6000, 3);
}
}
}
ZoneTakeOverTeam[z] = -1;
ZoneTakeOverTime[z] = 0;
}
}
else
{
ZoneTakeOverTeam[z] = -1;
GangZoneStopFlashForAll(ZoneInfo[z][z_id]);
ZoneTakeOverTime[z] = 0;
}
}
}
}
public gangzonetimer(playerid)
{
count--;
if(count==0)
{
GameTextForPlayer(playerid, "~b~Gang Zone War Ended.", 1000, 0);
KillTimer(timer1[playerid]);
}else{
new string[120];
format(string, sizeof(string), "~b~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~%d", count);
GameTextForPlayer(playerid, string, 1000, 3);
return 1;
}
return 1;
}
