[Tool/Web/Other] live player stats in webpage
#1

I make small code for live viewing the playerstats on a webpage. + using a random own host webserver.
(html code in pawno)
Maybe useful for a little/homehosted server?

[ame]http://www.youtube.com/watch?v=zAJw7FUKjPk[/ame]

pwn:
Код:
new maininfo[5000];

forward WebInfo();
public WebInfo()
{
	maininfo="";
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
		{
        new str1[600],str2[600],str3[600],str4[600];

        new Float:health;
    	GetPlayerHealth(i,health);
  		format(str1,sizeof(str1),"%s%s%sname: %s<br>%s",dini_Get("html.txt","background"),dini_Get("html.txt","Re"),dini_Get("html.txt","font1"),GetPlyName(i),dini_Get("html.txt","fontend"));
  		format(str2,sizeof(str2),"%s  Money: %d<br>",dini_Get("html.txt","font2"),GetPlayerMoney(i));
  		format(str3,sizeof(str3),"  Score: %d<br>%s",GetPlayerScore(i));
  		format(str4,sizeof(str4),"  Health: %f<br>%s",health,dini_Get("html.txt","fontend"));
  		format(maininfo,sizeof(maininfo),"%s<br>%s%s%s%s",maininfo,str1,str2,str3,str4);
  		printf(maininfo);
  		}
	}

	fremove("/mainino.html");
 	new File:log = fopen("/mainino.html", io_write); // Open the file
    if(log)
    {
        fwrite(log, maininfo); // Write to the file (\r\n is for a new line)
        fclose(log); // Close the file
    }
    return 1;
}
ini file:

Код:
Re=<meta http-equiv="refresh" content="2" >
font1=<font size="5" color="red">
font2=<font size="4" color="yellow">
fontend=</font>
Reply


Messages In This Thread
live player stats in webpage - by maxtorcd55 - 19.11.2012, 19:44
Re: live player stats in webpage - by x96664 - 19.11.2012, 19:57
Re: live player stats in webpage - by MarkzD - 19.11.2012, 20:08
Respuesta: live player stats in webpage - by [CG]Milito - 19.11.2012, 20:16
Re: live player stats in webpage - by Patrick - 19.11.2012, 20:46
Re: live player stats in webpage - by gamer931215 - 19.11.2012, 21:00
Re: live player stats in webpage - by SiraBots - 19.11.2012, 21:18
Re: live player stats in webpage - by maxtorcd55 - 19.11.2012, 21:25
Re: live player stats in webpage - by SchurmanCQC - 19.11.2012, 21:28
Re: live player stats in webpage - by maxtorcd55 - 19.11.2012, 21:32

Forum Jump:


Users browsing this thread: 1 Guest(s)