#include <a_samp> forward test(playerid); new timer; new count = 120; public OnPlayerCommandText(playerid, cmdtext[]) { if(strcmp("/startcount", cmdtext, true, 11) == 0) { timer = SetTimerEx("test", 1000, 1, "d", playerid); return 1; } } public test(playerid) { count--; new string[24]; format(string, sizeof(string), "Please wait: %d", count); return GameTextForPlayer(playerid, string, 100, 5); }
#include <a_samp>
forward test(playerid);
new timer;
new count = 120;
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/startcount", cmdtext, true, 11) == 0)
{
timer = SetTimerEx("test", 1000, 0, "d", playerid);
return 1;
}
}
public test(playerid)
{
count--;
new string[24];
format(string, sizeof(string), "Please wait: %d", count);
return GameTextForPlayer(playerid, string, 100, 5);
}
#include <a_samp>
forward test(playerid);
new timer;
new count = 120;
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/startcount", cmdtext, true, 11) == 0)
{
timer = SetTimerEx("test", 1000, 1, "d", playerid);
return 1;
}
return 1;
}
public test(playerid)
{
count--;
if(count==0)
{
KillTimer(timer);
GameTextForPlayer(playerid,"~r~Go Go Go",2000,5);
}else{
new string[24];
format(string, sizeof(string), "Please wait: %d", count);
return GameTextForPlayer(playerid, string, 100, 5);
}
return 1;
}
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; GangZoneFlashForAll(ZoneInfo[z][z_id], GetTeamColor(t)); ZoneTakeOverTime[z] = 0; } } } else { if(GetMembersInZone(z, ZoneTakeOverTeam[z]) > 0) { ZoneTakeOverTime[z]++; if(ZoneTakeOverTime[z] >= 120) { GangZoneStopFlashForAll(ZoneInfo[z][z_id]); 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; } } } }
it works i give you +rep but can you help me to add this count to my turf system means when player stay in gang zone it flash and i want
in the same time the textdraw of count shows this is piece of turf system Код:
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; GangZoneFlashForAll(ZoneInfo[z][z_id], GetTeamColor(t)); ZoneTakeOverTime[z] = 0; } } } else { if(GetMembersInZone(z, ZoneTakeOverTeam[z]) > 0) { ZoneTakeOverTime[z]++; if(ZoneTakeOverTime[z] >= 120) { GangZoneStopFlashForAll(ZoneInfo[z][z_id]); 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; } } } } |
#include <a_samp>
forward test(playerid);
new timer;
new count = 120;
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/startcount", cmdtext, true, 11) == 0)
{
timer = SetTimerEx("test", 1000, 1, "d", playerid);
return 1;
}
return 1;
}
public test(playerid)
{
count--;
if(count==0)
{
KillTimer(timer);
GameTextForPlayer(playerid,"~r~Go Go Go",2000,5);
}else{
new string[24];
format(string, sizeof(string), "Please wait: %d", count);
GameTextForPlayer(playerid, string, 100, 5);
return 1;
}
return 1;
}
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;
}
D:\Documents and Settings\Lanix\Desktop\TDM BETA\pawno\include\dutils.inc(309) : warning 219: local variable "count" shadows a variable at a preceding level D:\Documents and Settings\Lanix\Desktop\TDM BETA\pawno\include\dutils.inc(329) : warning 219: local variable "count" shadows a variable at a preceding level D:\Documents and Settings\Lanix\Desktop\TDM BETA\pawno\include\dutils.inc(348) : warning 219: local variable "count" shadows a variable at a preceding level D:\Documents and Settings\Lanix\Desktop\TDM BETA\gamemodes\SFTDM.pwn(1229) : warning 219: local variable "count" shadows a variable at a preceding level D:\Documents and Settings\Lanix\Desktop\TDM BETA\gamemodes\SFTDM.pwn(1295) : error 017: undefined symbol "playerid" D:\Documents and Settings\Lanix\Desktop\TDM BETA\gamemodes\SFTDM.pwn(1296) : error 017: undefined symbol "playerid" D:\Documents and Settings\Lanix\Desktop\TDM BETA\gamemodes\SFTDM.pwn(1309) : error 017: undefined symbol "playerid" D:\Documents and Settings\Lanix\Desktop\TDM BETA\gamemodes\SFTDM.pwn(3600) : warning 219: local variable "count" shadows a variable at a preceding level Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 3 Errors.
hmm,i got this
Код:
D:\Documents and Settings\Lanix\Desktop\TDM BETA\pawno\include\dutils.inc(309) : warning 219: local variable "count" shadows a variable at a preceding level D:\Documents and Settings\Lanix\Desktop\TDM BETA\pawno\include\dutils.inc(329) : warning 219: local variable "count" shadows a variable at a preceding level D:\Documents and Settings\Lanix\Desktop\TDM BETA\pawno\include\dutils.inc(348) : warning 219: local variable "count" shadows a variable at a preceding level D:\Documents and Settings\Lanix\Desktop\TDM BETA\gamemodes\SFTDM.pwn(1229) : warning 219: local variable "count" shadows a variable at a preceding level D:\Documents and Settings\Lanix\Desktop\TDM BETA\gamemodes\SFTDM.pwn(1295) : error 017: undefined symbol "playerid" D:\Documents and Settings\Lanix\Desktop\TDM BETA\gamemodes\SFTDM.pwn(1296) : error 017: undefined symbol "playerid" D:\Documents and Settings\Lanix\Desktop\TDM BETA\gamemodes\SFTDM.pwn(1309) : error 017: undefined symbol "playerid" D:\Documents and Settings\Lanix\Desktop\TDM BETA\gamemodes\SFTDM.pwn(3600) : warning 219: local variable "count" shadows a variable at a preceding level Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 3 Errors. |