19.11.2012, 19:44
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:
ini file:
(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; }
Код:
Re=<meta http-equiv="refresh" content="2" > font1=<font size="5" color="red"> font2=<font size="4" color="yellow"> fontend=</font>