AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Solved] String formatted incorrectly (https://forums.alliedmods.net/showthread.php?t=189446)

Torge 07-07-2012 10:03

[Solved] String formatted incorrectly
 
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!

ConnorMcLeod 07-07-2012 10:29

Re: String formatted incorrectly
 
Should be another string.
Please attach the .sma and show the full error.

Diegorkable 07-07-2012 10:48

Re: String formatted incorrectly
 
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.

Torge 07-07-2012 12:15

Re: String formatted incorrectly
 
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 ^^

lucas_7_94 07-07-2012 12:25

Re: String formatted incorrectly
 
add debug to see the line.

Bugsy 07-07-2012 12:26

Re: String formatted incorrectly
 
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);


Torge 07-07-2012 13:22

Re: String formatted incorrectly
 
Quote:

Originally Posted by Bugsy (Post 1745431)
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 :x

@lucas_7_94
Thank you too ^^


All times are GMT -4. The time now is 12:13.

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