Raised This Month: $51 Target: $400
 12% 

[Solved] String formatted incorrectly


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Torge
Veteran Member
Join Date: Oct 2011
Old 07-07-2012 , 10:03   [Solved] String formatted incorrectly
Reply With Quote #1

Hey guys,

I have a problem with my little xp mod. If someone suicide, he'll lost 5 xp but my log say everytime
String formatted incorrectly - parameter 5 <total 4>.

Code:
PHP Code:
// Suicide ?
if (killer == victim)
{
    
client_print(victimprint_center"-%d"get_pcvar_num(cvar_suicide_xp));
        
    
// Save his lost xp
    
Save(victim);
        
    
// Remove xp
    
g_iExp[victim] -= get_pcvar_num(cvar_suicide_xp);

I can't find the problem please help!

Last edited by Torge; 07-07-2012 at 13:29.
Torge is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-07-2012 , 10:29   Re: String formatted incorrectly
Reply With Quote #2

Should be another string.
Please attach the .sma and show the full error.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Old 07-07-2012, 10:30
hornet
This message has been deleted by hornet. Reason: beaten to it
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 07-07-2012 , 10:48   Re: String formatted incorrectly
Reply With Quote #3

First take away his EXP, and only then save it. I know its not the problem of the string formatted incorrectly but a thing to look at.
__________________
My Projects:

Auto-Mix (Pug): 100%

Joined the Military (a soldier now) - Inactive
Diegorkable is offline
Torge
Veteran Member
Join Date: Oct 2011
Old 07-07-2012 , 12:15   Re: String formatted incorrectly
Reply With Quote #4

Attached.

Full error log:

Quote:
L 07/07/2012 - 15:58:04: Start of error session.
L 07/07/2012 - 15:58:04: Info (map "zm_dust2") (file "addons/amxmodx/logs/error_20120707.log")
L 07/07/2012 - 15:58:04: String formatted incorrectly - parameter 5 (total 4)
L 07/07/2012 - 15:58:05: [AMXX] Run time error 25 (plugin "zp_xp_mod.amxx") - debug not enabled!
L 07/07/2012 - 15:58:05: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
@Diegorkable
Ok and thanks!

btw: author name is Justin because it's my real name ^^

Last edited by Torge; 07-07-2012 at 13:32.
Torge is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 07-07-2012 , 12:25   Re: String formatted incorrectly
Reply With Quote #5

add debug to see the line.
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-07-2012 , 12:26   Re: String formatted incorrectly
Reply With Quote #6

Added debug in plugins.ini so you can find the exact function\line causing the error:

I noticed these need fixing:
Code:
client_print(killer, print_center, "+%d", g_szPrefix, get_pcvar_num(cvar_kill_xp));
...
client_print_color(0, print_chat, "^4%s^1 Round: ^4%i^1 ended. Get ready for the ^4next round^1!", g_szPrefix);
__________________
Bugsy is offline
Torge
Veteran Member
Join Date: Oct 2011
Old 07-07-2012 , 13:22   Re: String formatted incorrectly
Reply With Quote #7

Quote:
Originally Posted by Bugsy View Post
Added debug in plugins.ini so you can find the exact function\line causing the error:

I noticed these need fixing:
Code:
client_print(killer, print_center, "+%d", g_szPrefix, get_pcvar_num(cvar_kill_xp));
...
client_print_color(0, print_chat, "^4%s^1 Round: ^4%i^1 ended. Get ready for the ^4next round^1!", g_szPrefix);
Thanks! I wrote my code fast.. that's why I made stupid mistakes

@lucas_7_94
Thank you too ^^

Last edited by Torge; 07-07-2012 at 13:26.
Torge 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 08:05.


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