Quote:
Originally Posted by bibu
After those fixes, the plugin has now an infinite loop for the compilation. It doesn't finish at all.
|
That code works just fine, the problem is elsewhere... most likely a while() loop or a hook.
Code used to test:
Code:
#include <amxmodx>
public plugin_init()
{
register_srvcmd("test", "test")
}
public test()
{
new len
new msg[2048]
new szTitle[64]
copy(szTitle, charsmax(szTitle), "WTF")
len += formatex(msg[len], charsmax(msg) - len, "<html><body bgcolor=^"#2b2b2b^"><p style=^"text-align: center;^">")
len += formatex(msg[len], charsmax(msg) - len, "<span style=^"color: #3399ff; font-family: 'trebuchet ms', geneva;^"><strong>")
len += formatex(msg[len], charsmax(msg) - len, "<img src=^"http://mynet.net/cs.png^" alt=^"^" width=^"403^" height=^"51^" />")
len += formatex(msg[len], charsmax(msg) - len, "<h1>%s</h1><table border=^"1^"style=^"font-family: 'trebuchet ms'; font-size: 10px;^">", szTitle)
len += formatex(msg[len], charsmax(msg) - len, "<tr><td><b>Rank</b></td><td>")
len += formatex(msg[len], charsmax(msg) - len, "<b>Name</b></td><td><b>Total Score</b></td>")
len += formatex(msg[len], charsmax(msg) - len, "<td><b>Zombies Killed</b></td><td><b>Nemesis's Killed</b></td>")
len += formatex(msg[len], charsmax(msg) - len, "<td><b>Survivor: Zombies Killed</b></td><td><b>Knife: Zombies Killed</b></td>")
len += formatex(msg[len], charsmax(msg) - len, "<td><b>Human's Infected</b></td><td><b>Nemesis: Human's Killed</b></td>")
len += formatex(msg[len], charsmax(msg) - len, "<td><b>Survivor's Killed</b></td>")
len += formatex(msg[len], charsmax(msg) - len, "<td><b>Human's Killed</b></td></tr>")
server_print(msg)
}
Quote:
Originally Posted by fysiks
You can't use add() if you need to put anything in it (%s, %d, etc.).
|
I knew that but obviously I forgot to mention it, still, I think add() is a bit faster than formatex() just because it doesn't have the format thing... hmm, I think copy() would work too.
__________________