[Ajuda] tempo nгo aparece. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: Non-English (
https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (
https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (
https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] tempo nгo aparece. (
/showthread.php?tid=451246)
tempo nгo aparece. -
Cromado - 16.07.2013
tavo tentando com que o tempo que ele fosse preso por pm apareci-se mais nгo estб aparecendo pq?
pawn Код:
forward presotempo(playerid);
public presotempo(playerid)
{
for(new i=0;i<MAX_PLAYERS;i++){
if(Preso[playerid] == 1)
{
return 0;
}
if(dini_Int(file, "Preso") == 1)
{
format(file2,sizeof(file2),"~r~Tempo ~n~ ~g~Preso: ~w~%d",Preso[i]);
GameTextForPlayer(playerid,file2,2000,6);
if(Preso[i]>= 5)//aqui indicia o tempo preso 5 minutos
{
if(Preso[playerid] == 0)
{
Preso[playerid] = 0;
GameTextForPlayer(playerid, "~w~ Solto", 5000, 6);
SpawnPlayer(playerid);
}
}
}
return 1;
}
}
Re: tempo nгo aparece. -
mau.tito - 16.07.2013
Por que dentro da callback vocк ta usando um loop de max_players ??
Re: tempo nгo aparece. -
Cromado - 17.07.2013
jб retirei e tbm nгo e esse o problema ;/
Re: tempo nгo aparece. -
Gleisson_. - 17.07.2013
Topo
pawn Код:
new Tempo,
DiminuirTempo[MAX_PLAYERS];
Crie:
pawn Код:
forward TempoPreso(playerid); public TempoPreso(playerid) {
if(Tempo == 0) {
KillTimer(DiminuirTempo[playerid]);
GameTextForPlayer(playerid, "~g~Solto!", 3000, 3);
return 1;
}
format(iString, sizeof(iString), "Restante: %d", Tempo);
GameTextForPlayer(playerid, iString, 1000, 3);
Tempo --;
return 1;
}
SetTimerEx a ser usado para diminuir o tempo:
pawn Код:
DiminuirTempo[playerid] = SetTimerEx("TempoPreso", 1000, true, "i", playerid);