[Ayuda] Timer de los *****
#1

Bueno, aqui el ultimo problema que se me presenta para administrar y guardado de datos tengo otra solucion y mas eficiente.

Ahora tengo que solventar el error que me tiene harto de hace meses para dar el "Aprobado" a mi Gamemode.

El problema es el siguiente:

El timer va dpm, la verdad, pero no se porque a los ids >= 1 no les afecta el timer se les hace invisible dos timers:

Timer1:

Код:
public clock()
{
  new string[256];
  new string2[256];
 	for(new i = 0; i <= 50; i++)
	{
		if(IsPlayerConnected(i))
		{
  		new Score = PlayerInfo[i][pCash];
		  new ScoreX = PlayerInfo[i][pScore];
		  	format(string,sizeof(string),"Dinero: %d $~n~Puntos: %d", Score,ScoreX);
			TextDrawSetString(Stats[i],string);
  			new Score3 = BCurrentCheckpoints[b(i)];
			format(string2, sizeof(string2),"Checkpoints: %d", Score3);
			TextDrawSetString(StatsXX[i], string2);
			SetPlayerScore(i, PlayerInfo[i][pScore]);
		}
	}
	return 1;
}
Timer 2:
Код:
public CustomPickups2()
{
  new string[256];
 	for(new i = 0; i <= 50; i++)
	{
		if(IsPlayerConnected(i))
		{
		  /*if(JugadorEnLaCiudad[i] == true)
		  {
		    if(!IsPlayerInAnyVehicle(i))
		    {
		      SendClientMessage(i, COLOR_GRAD3, "No estas en un coche, has sido kickeado, vuelve a entrar");
		      Kick(i);
		    }
		  }*/
			if (PlayerToPoint(3.0, i, 1081.01, -1764.13, 12.96))
			{// Taller de Tunning
				GameTextForPlayer(i, "~y~Zona Time Atack~n~~g~ Escribe /timeatack y selecciona entrar para entrar al time Atack", 5000, 5);
			}
			if(PlayerToPoint(7.0,i,2067.37,-1831.33,13.20) || PlayerToPoint(7.0,i,488.01,-1740.63,10.80) || PlayerToPoint(7.0,i,1025.72,-1025.92,31.75))
			{
				GameTextForPlayer(i, "~y~Taller Reparaciones~n~~g~ Escriba /reparar para arreglar tu coche.", 5000, 5);
			}
			if(PlayerToPoint(3.0, i,3892.3936,-2624.1099,1377.2710))//Opciones
			{
			  GameTextForPlayer(i, "~y~Opciones del Juego~n~~g~ En Construccion", 5000, 5);
			}
			if(PlayerToPoint(3.0, i,3832.0266,-2614.8284,1377.2845))//Tienda
			{
			  GameTextForPlayer(i, "~y~Tienda de Prestaciones~n~~g~ En Construccion.", 5000, 5);
			}
			new Float:VidaDelVehiculo;
			new veh;
			veh = GetPlayerVehicleID(i);
			GetVehicleHealth(veh, VidaDelVehiculo);
			if(VidaDelVehiculo < 500)
			{
			  new tmpcar = GetPlayerVehicleID(i);
				RepairVehicle(tmpcar);
			}
		}
	}
	return 1;
}
Y en el ongamemodeinit:
Код:
pickuptimer2 = SetTimer("CustomPickups2", 1000, 1);
	pickuptimer3 = SetTimer("clock", 200, 1);
Si alguien tiene una idea, porque me esta poniendo ya de los nervios totalmente, y no puedo pasar al 90% de mi gamemode y terminar el Panel de Control del Usuario para el servidor.

Muchas gracias. Porfavor no trolladas.
Reply
#2

Proba con SetTimerEx

Код:
pickuptimer2 = SetTimerEx("CustomPickups2", 1000, 0,"d",playerid);
pickuptimer3 = SetTimerEx("clock", 200, 0,"d",playerid);
Reply
#3

En vez de esto:

pawn Код:
for(new i = 0; i <= 50; i++)
prueba a poner esto otro:

pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
Reply
#4

Quote:
Originally Posted by GROVE4L
Proba con SetTimerEx

Код:
pickuptimer2 = SetTimerEx("CustomPickups2", 1000, 0,"d",playerid);
pickuptimer3 = SetTimerEx("clock", 200, 0,"d",playerid);

Eso daria mucho lag.

Y lo tuyo CristianTDj era como estava pero nada....
Reply
#5

no se si funcione pero intenta bajar un valor al timer,
o sea que quede
pawn Код:
for(new i=-1; i<50; i++){
ya que si el timer no anda para los id 0 entonces esto deberia (segun mi idea) permitirte que funcione, aun que deberia funcionar igual para todos como estaba (incluso el id 0);
Reply
#6

Puedes mostrar el textdraw que creas?
ej:
Create....
Reply
#7

Quote:
Originally Posted by the_chaoz
no se si funcione pero intenta bajar un valor al timer,
o sea que quede
pawn Код:
for(new i=-1; i<50; i++){
ya que si el timer no anda para los id 0 entonces esto deberia (segun mi idea) permitirte que funcione, aun que deberia funcionar igual para todos como estaba (incluso el id 0);
El timer anda al id 0 pero a partir del 1 no, pero voi a probar eso.
Reply
#8

Quote:
Originally Posted by Sergio_team
Quote:
Originally Posted by the_chaoz
no se si funcione pero intenta bajar un valor al timer,
o sea que quede
pawn Код:
for(new i=-1; i<50; i++){
ya que si el timer no anda para los id 0 entonces esto deberia (segun mi idea) permitirte que funcione, aun que deberia funcionar igual para todos como estaba (incluso el id 0);
El timer anda al id 0 pero a partir del 1 no, pero voi a probar eso.
No vн eso, podrнa funcionar. Avнsanos si va bien.
Reply
#9

Quote:
Originally Posted by CristianTdj
Quote:
Originally Posted by Sergio_team
Quote:
Originally Posted by the_chaoz
no se si funcione pero intenta bajar un valor al timer,
o sea que quede
pawn Код:
for(new i=-1; i<50; i++){
ya que si el timer no anda para los id 0 entonces esto deberia (segun mi idea) permitirte que funcione, aun que deberia funcionar igual para todos como estaba (incluso el id 0);
El timer anda al id 0 pero a partir del 1 no, pero voi a probar eso.
No vн eso, podrнa funcionar. Avнsanos si va bien.
Lo he probado pero nada. Mi propio script se esta riendo de mi -.-
Reply
#10

Quote:
Originally Posted by Sergio_team
Quote:
Originally Posted by CristianTdj
Quote:
Originally Posted by Sergio_team
Quote:
Originally Posted by the_chaoz
no se si funcione pero intenta bajar un valor al timer,
o sea que quede
pawn Код:
for(new i=-1; i<50; i++){
ya que si el timer no anda para los id 0 entonces esto deberia (segun mi idea) permitirte que funcione, aun que deberia funcionar igual para todos como estaba (incluso el id 0);
El timer anda al id 0 pero a partir del 1 no, pero voi a probar eso.
No vн eso, podrнa funcionar. Avнsanos si va bien.
Lo he probado pero nada. Mi propio script se esta riendo de mi -.-
No. Eso pasa a todos.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)