←  Pytania

AMXX.pl: Support AMX Mod X i SourceMod

»

Przekształcenie na html da rade?

Zablokowany

Skull3D - zdjęcie Skull3D 27.03.2011

Czy dałoby radę ten kod:

public cbPlayerInfoMenu(id, menu, item) {
		if(item == MENU_EXIT)
		{
			menu_destroy(menu);
			moneyMenu(id);
			return;
		}
		
		static _access, authid[35], callback;
		menu_item_getinfo(menu, item, _access, authid, sizeof(authid) - 1, _, _, callback);
		menu_destroy(menu);
		
		new player = find_player("c", authid);
		if(!is_user_connected(player)) {
			moneyMenu(id);
			return;
		}
		
		new name[32];
		get_user_name(player, name, sizeof(name) - 1);
		
		static motd[2500];
		new len = copy(motd, sizeof(motd) - 1, "<html>");
		
		len += format(motd[len], sizeof(motd) - len - 1, "<style type=^"text/css^"> body { background-image:url(http://i47.tinypic.com/xf50k5.png/); color:#FF8F00 } </style>");
			len += format(motd[len], sizeof(motd) - len - 1, 	"<b><font size=^"4^">Nazwa:</font></b> %s<br><br>", name);
			len += format(motd[len], sizeof(motd) - len - 1, 	"<b><font size=^"4^">Pieniadze:</font></b> %i<br><br>", idmm[player]);
			
			len += format(motd[len], sizeof(motd) - len - 1, 	"<b>Extra Zycie:</b> %d/%d (%d/%d HP)<br>",idhealth[player], max_health, idhealth[player] * number_health, max_health * number_health);
			len += format(motd[len], sizeof(motd) - len - 1, 	"<br>");
			
			len += format(motd[len], sizeof(motd) - len - 1, 	"<b>Odbicie Ataku:</b> %d/%d (%d%%/%d%%)<br>",idarmor[player], max_armor, idarmor[player] * chance_armor, max_armor * chance_armor);
			len += format(motd[len], sizeof(motd) - len - 1, 	"<br>");
			
			len += format(motd[len], sizeof(motd) - len - 1, 	"<b>Reduktor FallDamage:</b> %d/%d (%d%%/%d%%)<br>",idfalldmg[player], max_falldmg, idfalldmg[player] * percent_falldmg, max_falldmg * percent_falldmg);
			len += format(motd[len], sizeof(motd) - len - 1, 	"<br>");
			
			len += format(motd[len], sizeof(motd) - len - 1, 	"<b>Odrodzenie:</b> %d/%d (T: %d%%/%d%% CT: %d%%/%d%%)<br>",idrespawn[player], max_respawn, idrespawn[player] * chance_respawnt,max_respawn *  chance_respawnt,idrespawn[player] * chance_respawnct, max_respawn *  chance_respawnct);
			len += format(motd[len], sizeof(motd) - len - 1, 	"<br>");
			
			len += format(motd[len], sizeof(motd) - len - 1, 	"<b>Super HE:</b> %d/%d (From 1 to %d/%d)<br>",idsuperhe[player], max_superhe, idsuperhe[player] * distance_superhe, max_superhe * distance_superhe);
			len += format(motd[len], sizeof(motd) - len - 1, 	"<br>");
			
			len += format(motd[len], sizeof(motd) - len - 1, 	"<b>Bonusowa Kasa:</b> %d/%d ($%d/$%d)<br>",idbonus[player], max_bonus, idbonus[player] * number_bonus, max_bonus * number_bonus);
			len += format(motd[len], sizeof(motd) - len - 1, 	"<br>");
			
			len += format(motd[len], sizeof(motd) - len - 1, 	"<b>Anty Zamrazacz:</b> %d/%d (%d%%/%d%%)<br>",idnosmoke[player], max_nosmoke, idnosmoke[player] * percent_nosmoke, max_nosmoke * percent_nosmoke);
			len += format(motd[len], sizeof(motd) - len - 1, 	"<br>");
			
			len += format(motd[len], sizeof(motd) - len - 1, 	"<b>Ciche Chodzenie:</b> %d/%d<br>",idwalk[player], max_walk);
			len += format(motd[len], sizeof(motd) - len - 1, 	"<br>");
			
			len += format(motd[len], sizeof(motd) - len - 1, 	"<b>Anty Oslepiacz:</b> %d/%d<br>",idnoflash[player], max_noflash);
			len += format(motd[len], sizeof(motd) - len - 1, 	"<br>");
			
			len += format(motd[len], sizeof(motd) - len - 1, 	"<b>Brak bolu po uderzeniu:</b> %d/%d<br>",idshock[player], max_shock);
			len += format(motd[len], sizeof(motd) - len - 1, 	"<br>");
			
			len += format(motd[len], sizeof(motd) - len - 1, 	"<b>Odpychajacy HE:</b> %d/%d (%d%%/%d%%)<br>",idhe[player], max_he, idhe[player] * chance_he, max_he * chance_he);
			len += format(motd[len], sizeof(motd) - len - 1, 	"<br>");
			
			len += format(motd[len], sizeof(motd) - len - 1, 	"<b>Granat Oslepiajacy:</b> %d/%d (%d%%/%d%%)<br>",idflash[player], max_flash, idflash[player] * chance_flash, max_flash * chance_flash);
			len += format(motd[len], sizeof(motd) - len - 1, 	"<br>");
			
			len += format(motd[len], sizeof(motd) - len - 1, 	"<b>Granat Zamrazajacy:</b> %d/%d (%d%%/%d%%)<br>",idsmoke[player], max_smoke, idsmoke[player] * chance_smoke, max_smoke * chance_smoke);
			len += format(motd[len], sizeof(motd) - len - 1, 	"<br>");
			
			len += format(motd[len], sizeof(motd) - len - 1,	"</body>");
			len += format(motd[len], sizeof(motd) - len - 1, 	"</html>");
			
			show_motd(id, motd, "MoneyMod Player Info");
			
			playerInfoMenu(id);
		}

Przekształcić na html chodzi mi np. z tym pobieraniem typu:
np.
"<b>Granat Zamrazajacy:</b> %d/%d (%d%%/%d%%)<br>",idsmoke[player], max_smoke, idsmoke[player] * chance_smoke, max_smoke * chance_smoke);
Dam plus.
Odpowiedz

  • +
  • -
Portek - zdjęcie Portek 27.03.2011

A weź to napisz jeszcze raz, tylko po polsku... Zapewne się da, ale nie do końca wiem o co chodzi.
Odpowiedz

  • +
  • -
Niscree - zdjęcie Niscree 27.03.2011

ale to jest html
więc co ty chcesz przekształcać Oo ?
Odpowiedz

Skull3D - zdjęcie Skull3D 27.03.2011

to było zawarte w sma
tak?
Dałem całego publica i chodzi mi o to czy da się z sma przejść na html że później damy takiego publica

	public cbPlayerInfoMenu(id, menu, item) {
				show_motd (id,"mmplayerinfo.txt","MoneyMod Player Info")
		}


Tylko niewiem czy w html działają takie znaczki np.:

<b>Granat Zamrazajacy:</b> %d/%d (%d%%/%d%%)<br>",idsmoke[player], max_smoke, idsmoke[player] * chance_smoke, max_smoke * chance_smoke);

Najbardziej chodzi mi o te
idsmoke[player], max_smoke, idsmoke[player] * chance_smoke, max_smoke * chance_smoke);
czy będą działać w html i jak to zrobić?
Plus to wiadome za pomoc.
Odpowiedz

  • +
  • -
Niscree - zdjęcie Niscree 27.03.2011

nie wiem całkiem o co ci chodzi :D

ale to:
idsmoke[player], max_smoke, idsmoke[player] * chance_smoke, max_smoke * chance_smoke);

nie jest html
Odpowiedz

Skull3D - zdjęcie Skull3D 27.03.2011

o właśnie niscree trochę czaisz chodzi mi o to żeby sprawdzać coś tam czyli to:
%d/%d (%d%%/%d%%)

w html
ale do tego jest to potrzebne (niewiem jak to sie nazywa)
idsmoke[player], max_smoke, idsmoke[player] * chance_smoke, max_smoke * chance_smoke);
Odpowiedz

  • +
  • -
Portek - zdjęcie Portek 27.03.2011

to było zawarte w sma
tak?
Dałem całego publica i chodzi mi o to czy da się z sma przejść na html że później damy takiego publica

	public cbPlayerInfoMenu(id, menu, item) {
				show_motd (id,"mmplayerinfo.txt","MoneyMod Player Info")
		}


Tylko niewiem czy w html działają takie znaczki np.:

<b>Granat Zamrazajacy:</b> %d/%d (%d%%/%d%%)<br>",idsmoke[player], max_smoke, idsmoke[player] * chance_smoke, max_smoke * chance_smoke);

Najbardziej chodzi mi o te
idsmoke[player], max_smoke, idsmoke[player] * chance_smoke, max_smoke * chance_smoke);
czy będą działać w html i jak to zrobić?
Plus to wiadome za pomoc.

Jeśli dobrze rozumiem, chcesz to przenieść z pluginu który generuje motd w locie, do pliku "mmplayerinfo.txt" który defacto będzie zawierał to samo? Tylko po co? Nie prześlesz w taki sposób danych do motd, musiał być to zrobić poprzez php'a - przesłać dane poprzez iframe (pobierając via $_GET), a następnie też poprzez iframe wyświetlić stronę która ma się znaleźć w w/w pliku (chodzi o to że ten plik musi zawierać ramkę, w której będzie to co musi się znajdować w tym pliku). Tylko po co tak kombinować i robić to na około? Dochodzi czas załadowania się ramki i przetworzenia skryptu, a więc też chwilowy lag (skok pingu, związany z załadowaniem strony i ew. obrazków).
Odpowiedz

Skull3D - zdjęcie Skull3D 27.03.2011

Ok można zamknąć.
Dałem plusy za najważniejsze info.
Thx
Odpowiedz

  • +
  • -
Qimax - zdjęcie Qimax 27.03.2011

Hehe dobre ale sam musisz to napisać.
Da sie zrobić by nadipisywała to tak jak w statach diablo moda np:D
Odpowiedz
Zablokowany