Raised This Month: $ Target: $400
 0% 

String formatted incorrectly


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
At3u
Member
Join Date: Feb 2013
Location: On the Moon
Old 04-25-2013 , 10:04   String formatted incorrectly
Reply With Quote #1

Edit: Done

Last edited by At3u; 05-09-2013 at 11:32.
At3u is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 04-25-2013 , 10:08   Re: String formatted incorrectly
Reply With Quote #2

You are not formatting your strings correctly. You have a %s in them but don't pass any value to it
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
At3u
Member
Join Date: Feb 2013
Location: On the Moon
Old 04-25-2013 , 10:11   Re: String formatted incorrectly
Reply With Quote #3

Done. Thx

Last edited by At3u; 05-09-2013 at 11:31.
At3u is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 04-25-2013 , 10:24   Re: String formatted incorrectly
Reply With Quote #4

Enable debug and it will tell you exactly where the error is
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
At3u
Member
Join Date: Feb 2013
Location: On the Moon
Old 04-25-2013 , 10:37   Re: String formatted incorrectly
Reply With Quote #5

Whit debug enabled:


String formatted incorrectly - parameter 4 (total 3)
[AMXX] Displaying debug trace (plugin "CooL_Live.amxx")
AMXX] Run time error 25: parameter error
[AMXX] [0] colorchat.inc::ColorChat (line 37)
[AMXX] [1] 5j3vx4pm.sma.p::mesaj1 (line 64)
String formatted incorrectly - parameter 4 (total 3)
[AMXX] Displaying debug trace (plugin "CooL_Live.amxx")
[AMXX] Run time error 25: parameter error
AMXX] [0] colorchat.inc::ColorChat (line 37)
[AMXX] [1] 5j3vx4pm.sma.p::mesaj2 (line 69)
String formatted incorrectly - parameter 4 (total 3)
[AMXX] Displaying debug trace (plugin "CooL_Live.amxx")
[AMXX] Run time error 25: parameter error
[AMXX] [0] colorchat.inc::ColorChat (line 37)
[AMXX] [1] 5j3vx4pm.sma.p::mesaj4 (line 84)
At3u is offline
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 04-25-2013 , 10:38   Re: String formatted incorrectly
Reply With Quote #6

Code:
public mesaj1(id) {     client_cmd(0,"spk ^"life in three seconds^"");     ColorChat(id, GREEN, "[^x03 %s^x04 ]^x01 |---------------^x04 LiVE !^x01 ---------------|"); } public mesaj2(id) {     ColorChat(id, GREEN, "[^x03 %s^x04 ]^x01 |---------------^x04 LiVE !^x01 ---------------|"); } public mesaj3(id) {     ColorChat(id, GREEN, "[^x03 %s^x04 ]^x01 |---------------^x04 LiVE !^x01 ---------------|"); }

You need to add an extra argument to the function, which is the string %s will be replaced by.
Backstabnoob is offline
At3u
Member
Join Date: Feb 2013
Location: On the Moon
Old 04-25-2013 , 17:40   Re: String formatted incorrectly
Reply With Quote #7

Solved

Last edited by At3u; 05-09-2013 at 11:31.
At3u is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 04-25-2013 , 21:33   Re: String formatted incorrectly
Reply With Quote #8

change this
Code:
public say_live(id) {     server_cmd("sv_restart 3")     set_task(0.1,"mesaj1",id)     set_task(0.2,"mesaj2",id)     set_task(0.3,"mesaj4",id)     return PLUGIN_CONTINUE; }

to this

Code:
public say_live(id, lvl, cid) {     if(!cmd_access(id, lvl, cid, 2)         return PLUGIN_HANDLED;         server_cmd("sv_restart 3")     set_task(0.1,"mesaj1",id)     set_task(0.2,"mesaj2",id)     set_task(0.3,"mesaj4",id)     return PLUGIN_CONTINUE; }
__________________
Blizzard_87 is offline
At3u
Member
Join Date: Feb 2013
Location: On the Moon
Old 04-26-2013 , 04:30   Re: String formatted incorrectly
Reply With Quote #9

Edit: Solved

Last edited by At3u; 04-26-2013 at 04:35.
At3u 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 10:58.


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