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

[HELP] with favult.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ShLuMieL
Senior Member
Join Date: Jul 2010
Old 01-10-2014 , 07:34   [HELP] with favult.
Reply With Quote #1

Hello all.
I tried to save more then 1 thing in favult system.
and I got this error:
Error: Number of arguments does not match definition on line 66

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fvault>

#define PLUGIN "Plug-in"
#define VERSION "1.0"
#define AUTHOR "AUTHOR."

new gXp[33], gHealth[33], gArmor[33], gGravity[33], authid[35];
new 
gXpKill 5;

new const 
gVaultName[] = "Favult-Saver";

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event"DeathMsg""EventDeathMsg""a" );

}

public 
client_authorized(id)
{
    if( !
is_user_hltv(id) && !is_user_bot(id) )
    {
        
LoadXp(id);
    }
}

public 
EventDeathMsg(id)
{
    new 
killer read_data);
    new 
victim read_data);
    
    if( 
killer == victim || ! is_user_connectedkiller ) || ! is_user_connectedvictim ) )
    {
        return 
PLUGIN_HANDLED;
        
//return;
    
}

    
gXp[killer] += gXpKill
    gHealth
[killer] += gXpKill 2
    gArmor
[killer] += gXpKill 3
    gGravity
[killer] += gXpKill 4
    
    SaveXp
(killer)
    
    return 
PLUGIN_HANDLED;
}

public 
LoadXp(id)
{
    new 
authid[35];
    
get_user_authid(idauthidsizeof(authid) - 1);
    
    new 
data[16], szXp[8], szHealth[8], szArmor[8], szGravity[8];
    if( 
fvault_get_data(gVaultNameauthiddatasizeof(data) - 1))
    {
        
strbreakdataszXpsizeofszXp ) - 1szHealthsizeofszHealth ) - 1szArmorsizeof(szArmor) - 1szGravitysizeof(szGravity) - 1);
        
        
gXp[id] = str_to_num(szXp);
        
gHealth[id] = str_to_num(szHealth);
        
gArmor[id] = str_to_num(szArmor);
        
gGravity[id] = str_to_num(szGravity);
        
        return;
    }
    else
    {
        
gXp[id] = 0;
        
gHealth[id] = 0;
        
gArmor[id] = 0;
        
gGravity[id] = 0;
        
        return;
    }
}


public 
SaveXp(id)
{
    new 
authid[35];
    
get_user_authid(idauthidsizeof(authid) - 1);
    
    new 
data[32];
    
formatexdatasizeofdata ) - 1"%d %d %d %d"gXp[id], gHealth[id], gArmor[id], gGravity[id]);
    
    
fvault_set_data(gVaultNameauthiddata);
    
    return;

what I should to do to fix it?

Thank's.

Last edited by ShLuMieL; 01-10-2014 at 07:35.
ShLuMieL is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 01-10-2014 , 07:39   Re: [HELP] with favult.
Reply With Quote #2

The issue isn't related to fvault. You use strbreak() incorrectly - your supposed to use it to in order to obtain 2 substrings ( or 2 pieces of data for that matter ). You should be using parse() instead.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
ShLuMieL
Senior Member
Join Date: Jul 2010
Old 01-10-2014 , 07:42   Re: [HELP] with favult.
Reply With Quote #3

Can you give me example please.
ShLuMieL is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 01-10-2014 , 07:46   Re: [HELP] with favult.
Reply With Quote #4

Just replace strbreak with parse .
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
ShLuMieL
Senior Member
Join Date: Jul 2010
Old 01-10-2014 , 07:51   Re: [HELP] with favult.
Reply With Quote #5

Thank's your amazing !
ShLuMieL 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 22:11.


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