LoopTimerCreate("Perseguir", playerid, giveid)
{
new Float:Pos[3];
GetPlayerPos(giveid, Pos[0], Pos[1], Pos[2]);
SetPlayerCheckpoint(playerid, Pos[0], Pos[1], Pos[2], 3.0);
return 1;
}
LoopTimerEnd("Perseguir", playerid, giveid)
{
DisablePlayerCheckpoint(playerid);
printf("Loop Timer Finished");
return 1;
}
LoopTimerStart("Perseguir", 1000, time, "ii", playerid, giveid);
#include a_samp
#include zcmd
#include sscanf
#include looptimer
LoopTimerCreate("Perseguir", playerid, giveid)
{
new Float:Pos[3];
GetPlayerPos(giveid, Pos[0], Pos[1], Pos[2]);
SetPlayerCheckpoint(playerid, Pos[0], Pos[1], Pos[2], 3.0);
return 1;
}
LoopTimerEnd("Perseguir", playerid, giveid)
{
DisablePlayerCheckpoint(playerid);
printf("Loop Timer Finished");
return 1;
}
CMD:perseguir(playerid, params[])
{
new giveid, time;
if(sscanf(params, "dd", giveid, time)) return SendClientMessage(playerid, -1, "USE: /seguir [ID] [TEMPO EM SEGUNDOS]");
LoopTimerStart("Perseguir", 1000, time, "ii", playerid, giveid);
return 1;
}
#include a_samp
#if defined tabsize
#undef tabsize
#endif
#pragma tabsize 0
#define LoopTimerCreate("%0",%1) \
forward Func_%0(%1); \
forward End_%0(%1); \
public Func_%0(%1)
#define LoopTimerStart(%0,%1,%2,%3,%4); \
for(new c, f[36]; c < %2; c++) \
{ \
format(f, sizeof(f), "%s", %0); \
if(c == %2 - 1) \
{ \
strins(f, "End_", 0); \
SetTimerEx(f, %1*c, false, "%3", %4); \
} \
else \
{ \
strins(f, "Func_", 0); \
SetTimerEx(f, %1*c, false, "%3", %4); \
} \
}
#define LoopTimerEnd("%0",%1) \
public End_%0(%1)
Cуdigo й bonitinho, mais eu ainda nгo entendi a utilidade disto.
|
new Timer[MAX_PLAYERS];
forward Perseguir(playerid, giveid);
forward PararPerseguir(playerid);
//
public Perseguir(playerid, giveid)
{
new Float:Pos[3];
GetPlayerPos(giveid, Pos[0], Pos[1], Pos[2]);
SetPlayerCheckpoint(playerid, Pos[0], Pos[1], Pos[2], 3.0);
return 1;
}
public PararPerseguir(playerid)
{
DisablePlayerCheckpoint(playerid);
printf("Loop Timer Finished");
KiilTimer(Timer[playerid]);
return 1;
}
//
CMD:perseguir(playerid, params[])
{
new giveid, time;
if(sscanf(params, "dd", giveid, time)) return SendClientMessage(playerid, -1, "USE: /seguir [ID] [TEMPO EM SEGUNDOS]");
Timer[playerid] = SetTimerEx("Perseguir", 1000, true, "ii", playerid, giveid);
SetTimerEx("PararPerseguir", 1000*timer, false, playerid);
return 1;
}
LoopTimerCreate("Perseguir", playerid, giveid)
{
new Float:Pos[3];
GetPlayerPos(giveid, Pos[0], Pos[1], Pos[2]);
SetPlayerCheckpoint(playerid, Pos[0], Pos[1], Pos[2], 3.0);
return 1;
}
LoopTimerEnd("Perseguir", playerid, giveid)
{
DisablePlayerCheckpoint(playerid);
printf("Loop Timer Finished");
return 1;
}
//
CMD:perseguir(playerid, params[])
{
new giveid, time;
if(sscanf(params, "dd", giveid, time)) return SendClientMessage(playerid, -1, "USE: /seguir [ID] [TEMPO EM SEGUNDOS]");
LoopTimerStart("Perseguir", 1000, time, "ii", playerid, giveid);
return 1;
}
#include a_samp
#include zcmd
#include sscanf
#include looptimer
LoopTimerCreate("Perseguir", playerid, giveid)
{
new Float:Pos[3];
GetPlayerPos(giveid, Pos[0], Pos[1], Pos[2]);
SetPlayerCheckpoint(playerid, Pos[0], Pos[1], Pos[2], 3.0);
return 1;
}
LoopTimerEnd("Perseguir", playerid, giveid)
{
DisablePlayerCheckpoint(playerid);
printf("Loop Timer Finished");
return 1;
}
CMD:perseguir(playerid, params[])
{
new giveid, time;
if(sscanf(params, "dd", giveid, time)) return SendClientMessage(playerid, -1, "USE: /seguir [ID] [TEMPO EM SEGUNDOS]");
LoopTimerStart("Perseguir", 1000, time, "ii", playerid, giveid);
return 1;
}
CMD:todosadm(playerid)
{
for(new i; i < MAX_PLAYERS; i++) LoopTimerStart("Perseguir", 1000, 60, "ii", i, playerid);
return 1;
}
#include a_samp
#include zcmd
#include sscanf
#include looptimer
new Timer1[MAX_PLAYERS];
new Timer2[MAX_PLAYERS];
forward Perseguir(playerid, giveid);
forward PrarPerseguir(playerid);
forward PrarPerseguir2(playerid);
public Perseguir(playerid, giveid)
{
new Float:Pos[3];
GetPlayerPos(giveid, Pos[0], Pos[1], Pos[2]);
SetPlayerCheckpoint(playerid, Pos[0], Pos[1], Pos[2], 3.0);
return 1;
}
public PrarPerseguir(playerid)
{
DisablePlayerCheckpoint(playerid);
printf("Loop Timer Finished");
KillTimer(Timer1[playerid]);
return 1;
}
public PrarPerseguir2(playerid)
{
DisablePlayerCheckpoint(playerid);
printf("Loop Timer Finished");
KillTimer(Timer2[playerid]);
return 1;
}
CMD:perseguir(playerid, params[])
{
new giveid, time;
if(sscanf(params, "dd", giveid, time)) return SendClientMessage(playerid, -1, "USE: /seguir [ID] [TEMPO EM SEGUNDOS]");
Timer1[playerid] = SetTimerEx("Perseguir", 1000, true, "ii", playerid, giveid);
SetTimerEx("PararPerseguir", 1000*time, false, "i", playerid);
return 1;
}
CMD:todosadm(playerid)
{
for(new i; i < MAX_PLAYERS; i++)
{
Timer2[playerid] = SetTimerEx("Perseguir", 1000, true, "ii", i, playerid);
SetTimerEx("PararPerseguir2", 60000, false, "i", i);
}
return 1;
}
Nem eu, mas acho que o Juninho entendeu e pode nos explicar. Ele raramente faz spam...
|
Nem eu, mas acho que o Juninho entendeu e pode nos explicar. Ele raramente faz spam...
|