Raised This Month: $ Target: $400
 0% 

Again input line too long error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bibu
Veteran Member
Join Date: Sep 2010
Old 07-22-2011 , 14:48   Re: Again input line too long error
Reply With Quote #1

How I said, it happend after I edited to the one from post 6.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-22-2011 , 14:52   Re: Again input line too long error
Reply With Quote #2

Quote:
Originally Posted by Hunter-Digital View Post
Still, I think add() could work instead of formatex() aswell... but I never used it =)
You can't use add() if you need to put anything in it (%s, %d, etc.).

Quote:
Originally Posted by bibu View Post
How I said, it happend after I edited to the one from post 6.
Time to show the full code.
__________________
fysiks is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 07-22-2011 , 17:13   Re: Again input line too long error
Reply With Quote #3

Quote:
Originally Posted by bibu View Post
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 View Post
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.
__________________
Hunter-Digital is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:00.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode