forward CountDownEx(pid, Float:Dis, Float:_Xi,Float: _Yi, Float:_Zi);
public CountDownEx(pid, Float:Dis, Float:_Xi,Float: _Yi, Float:_Zi)
{
for(new i; i < SLOTS; ++i)
{
if(IsPlayerConnected(i) && i != pid && IsPlayerInRangeOfPoint(i, Dis, _Xi, _Yi, _Zi))
{
if(Count[i] == 0)
{
GameTextForPlayer(i, "Go Go Go]", 1000, 3);
Count[i] = 5;
return 0;
}
if(Count[i] == 5)
{
format(string, sizeof(string),"[INFO]: %s[ID:%i] Iniciou uma contagem!", GetNick(pid), pid);
SendClientMessageToAll(-1, string);
}
GameTextForPlayer(i, rvalstr(Count[i]), 1000, 3);
PlayerPlaySound(i, 1056, 0,0,0);
Count[i] --;
SetTimerEx("CountDownEx", 1000, false, "iffff", i, Dis, Float:_Xi,Float: _Yi, Float:_Zi);
}
}
return 1;
}
SetTimerEx("CountDownEx", 1000, false, "iffff", i, Dis, Float:_Xi,Float: _Yi, Float:_Zi);
SetTimerEx("CountDownEx", 1000, false, "iffff", pid, Dis, Float:_Xi,Float: _Yi, Float:_Zi);
forward CountDownEx(pid, Float:Dis, Float:_Xi,Float: _Yi, Float:_Zi);
public CountDownEx(pid, Float:Dis, Float:_Xi,Float: _Yi, Float:_Zi)
{
for(new i; i < SLOTS; ++i)
{
if(IsPlayerConnected(i) && IsPlayerInRangeOfPoint(i, Dis, _Xi, _Yi, _Zi))
{
if(Count[i] == 0)
{
GameTextForPlayer(i, "Go Go Go]", 1000, 3);
Count[i] = 5;
return 0;
}
if(Count[i] == 5)
{
format(string, sizeof(string),"[INFO]: %s[ID:%i] Iniciou uma contagem!", GetNick(pid), pid);
SendClientMessageToAll(-1, string);
}
GameTextForPlayer(i, rvalstr(Count[i]), 1000, 3);
PlayerPlaySound(i, 1056, 0,0,0);
Count[i] --;
SetTimerEx("CountDownEx", 1000, false, "iffff", i, Dis, Float:_Xi,Float: _Yi, Float:_Zi);
}
}
return 1;
}
nгo funcionou.
eu quero que quando chamo esta public, ele mostrarб a contagem sу para quem estiver perto do player, no caso PID. |
forward CountDownEx(pid, Float:Dis, Float:_Xi,Float: _Yi, Float:_Zi);
public CountDownEx(pid, Float:Dis, Float:_Xi,Float: _Yi, Float:_Zi)
{
new x = 0;
for(new i; i < SLOTS; ++i)
{
if(IsPlayerConnected(i) && IsPlayerInRangeOfPoint(i, Dis, _Xi, _Yi, _Zi))
{
if(Count[i] == 0)
{
GameTextForPlayer(i, "Go Go Go]", 1000, 3);
Count[i] = 5;
x = i;
continue;
}
if(Count[i] == 5)
{
format(string, sizeof(string),"[INFO]: %s[ID:%i] Iniciou uma contagem!", GetNick(pid), pid);
SendClientMessageToAll(-1, string);
}
GameTextForPlayer(i, rvalstr(Count[i]), 1000, 3);
PlayerPlaySound(i, 1056, 0,0,0);
Count[i] --;
x = i;
}
}
if(Count[x] != 5) SetTimerEx("CountDownEx", 1000, false, "iffff", pid, Dis, Float:_Xi,Float: _Yi, Float:_Zi);
return 1;
}
forward ClockDown(playerid);
public ClockDown(playerid)
{
new Float:Pos[3], string[128];
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
for(new i = 0; i <= MAX_PLAYERS; ++i)
{
if(IsPlayerConnected(i))
{
if(!IsPlayerInRangeOfPoint(i,5.0,Pos[0],Pos[1],Pos[2]))
if(Count[i] == 0)
{
GameTextForPlayer(i,"Go Go Go", 1000, 3);
Count[i] =5
return 0;
}
format(string,sizeof(string),"%d",Count[i]);
GameTextForPlayer(i,string, 1000, 3);
PlayerPlaySound(i, 1056, 0,0,0);
SetTimerEx("ClockDown",1000,false,"fff",Pos[0],Pos[1],Pos[2]);
return Count[i] --;
}
}
return true;
}