AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] with favult. (https://forums.alliedmods.net/showthread.php?t=233128)

ShLuMieL 01-10-2014 07:34

[HELP] with favult.
 
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.

hornet 01-10-2014 07:39

Re: [HELP] with favult.
 
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.

ShLuMieL 01-10-2014 07:42

Re: [HELP] with favult.
 
Can you give me example please.

hornet 01-10-2014 07:46

Re: [HELP] with favult.
 
Just replace strbreak with parse .

ShLuMieL 01-10-2014 07:51

Re: [HELP] with favult.
 
Thank's your amazing !


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

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