22.11.2014, 22:36
Hola a todos. Hace un tiempo alguien paso una funcion para leer el contenido de un archivo txt. Dentro de ese txt tiene varios nombre, entonces al usar el comando X se abre en una Box una lista con los names que estan alli.
Hasta alli todo bien. pero me gustaria agregarle algo al lado del nombre. Y no se como hacer, por que no le veo q lleve %s
Aqui el codigo
Es como un comando de Admin online. Pero en vez q aparezcan solo los conectados. aparecen todos los de la lista del .txt
EDITO
Es asi como se ve el comando (Ver imagen)
Edito 2
Vi un codigo. q detecta si el jugador esta on o off. Entonces sale al lado del name un texto diciento el estado.


Este es el codigo y me gustaria implementarlo al comando Admins
Hasta alli todo bien. pero me gustaria agregarle algo al lado del nombre. Y no se como hacer, por que no le veo q lleve %s
Aqui el codigo
PHP код:
CMD:admins(playerid, params[])
{
new f[256];
if(GZJugador[playerid][PGang] > 0)
{
format(f, 256, "Admins/%d.txt",PlayerInfo[playerid][pAdmin]);
new File:Warns = fopen(f, io_read);
if(!Warns) return 0;
new str[128],warnstr[500],len;
while((len = fread(Warns,str)))
{
str[len] = 0;
strcat(warnstr,str);
}
fclose(Warns);
if(warnstr[0] != EOS)
{
ShowPlayerDialog(playerid, 0, 0, "Total Admins", warnstr, "Ok", "");
}
}
return 1;
}
EDITO
Es asi como se ve el comando (Ver imagen)
Edito 2
Vi un codigo. q detecta si el jugador esta on o off. Entonces sale al lado del name un texto diciento el estado.


Este es el codigo y me gustaria implementarlo al comando Admins
Quote:
if(strcmp(cmd, "/leaders", true) == 0) { new file = ini_openFile("gamefiles/log/leaders.ini"); ini_getString(file,"MARYA",pLeaders[0]); new ttextt[32]; if(IsPlayerConnected(GetPlayerID(pLeaders[0]))) { ttextt = "[{22ff00}Online{F2EEF0}]"; } else if(!IsPlayerConnected(GetPlayerID(pLeaders[0]))) { ttextt = "[{ff001c}Offline{F2EEF0}]"; } format(string, sizeof(string), "Мэрия: %s %s", pLeaders[0],ttextt); ShowPlayerDialog(playerid,8822,DIALOG_STYLE_MSGBOX ,"Лидеры организаций",string,"Скрыть",""); ini_closeFile(file); return 1; } |