new string[XXX];
format(string, sizeof(string), "Tiempo %s", "Aqui que Coloco?");//alli como hago xD
GameTextForPlayer(playerid, string, 3000, 1);//<<<<---osea para colocar el tiempo que de ejemplo son 3000 = 3segundos.
new string[128], day, month, year, minute, hour, second;
Getdate(year,month,day);
Gettime(hour, minute, second);
format(string, sizeof(string), "%d - %s \n Hora: %d:%d", day, month,hour, minute);
GameTextForPlayer(playerid, string, 3000, 1);
format(string, sizeof(string), "Estas en coma en el hospital, faltan %s segundos para regenerar", Aqui que pongo.);
GameTextForPlayer(playerid, string, 3000, 1);//Quiero Colocar los segundos que son los 3 que salen alli <<..
GameTextForPlayer(playerid, "Hola, desaparecere en 3 segundos.", 3000, 1);
new string[45], //45 = al nъmero de letras. (Normalmente, se pone aproximadamente, pero nunca puede ser menor que el tamaсo total del mensaje.
nombre[24]; // 24 = Mбximo de caracteres del nombre de un jugador
GetPlayerName(playerid, nombre, 24); //Obtenemos el nombre de 'playerid'
format(string, sizeof(string), "Tu nombre es %s", nombre); //%s es para insertar una cadena de texto **.
GameTextForPlayer(playerid, string", 3000, 1);
|
Originally Posted by SA-MP Wiki
Format Strings
Placeholder Meaning %b Inserts a number at this position in binary radix %c Inserts a single character. %d Inserts an integer (whole) number %f Inserts a floating point number. %i Inserts an integer. %s Inserts a string. %x Inserts a number in hexadecimal notation. %% Inserts the literal '%' |
GameTextForPlayer(playerid, string", 3000, 1);// <<<--- El Tiempo lo quiero colocar en '%d' Pero como es lo que quiero saber, el tiempo que uno coloca en este caso los 3000 = 3 Segundos
format(string, sizeof(string), "Tiempo estimado para salir del Hospital %d", ''Aqui que tengo que colocar para que salga el tiempo que yo coloque en el GameTextForPlayer);
new ConteoGlobal[2];
stock Conteo(segundos)
{
ConteoGlobal[0] = SetTimerEx("Conteo", 1000, true, "%d", segundos*1000);
ConteoGlobal[1] = segundos;
new string[10];
format(string, sizeof(string), "%d", ConteoGlobal[1]);
GameTextForAll(string, 1000, 1);
return 1;
}
forward Conteo(segundos);
public Conteo(segundos)
{
ConteoGlobal[1] = --;
if(ConteoGlobal[1] != 0)
{
new string[10];
format(string, sizeof(string), "%d", ConteoGlobal[1]);
GameTextForAll(string, 1000, 1);
}
else if(ConteoGlobal[1] == 0)
{
GameTextForAll("YA", 1000, 1);
KillTimer(ConteoGlobal[0]);
ConteoGlobal[0] = 0;
ConteoGlobal[1] = 0;
}
return 1;
}
Conteo(segundos);
//EJ:
Conteo(5);
/*
5
4
3
2
1
YA
*/
ConteoGlobal[1] = --;
forward Conteo(segundos);
public Conteo(segundos)
{
ConteoGlobal[1] = --;
if(ConteoGlobal[1] != 0)
{
new string[10];
format(string, sizeof(string), "~p~~h~Tiempo para salir del hospital ~w~%d", ConteoGlobal[1]);
GameTextForAll(string, 1000, 1);
}
//blablablablalba code code code
|
.__. Enserio todavia no me han Logrado entender? o no me e expresado entendible? No estoy haciendo un sistema de conteo, OSEA. Estoy Creando como un Timer para cuando uno muera, aparesca en el hospital por un cierto tiempo, y quiero que en ese cierto tiempo salga el GameTextForPlayer Contando los Segundos que le falta al player para salir del estado en Coma. їAhora si me entiendo? x_x
|