Raised This Month: $32 Target: $400
 8% 

[FIX] Error: Number of arguments does not match definition on line 75 and 87


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
QuickDroLLL
Senior Member
Join Date: Dec 2021
Location: AMX Mod X Land
Old 05-14-2022 , 08:25   [FIX] Error: Number of arguments does not match definition on line 75 and 87
Reply With Quote #1

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <engine>
#include <hamsandwich>

#define PLUGIN         "[JBE] Screw Driver"
#define VERSION     "0.1"
#define AUTHOR         "Godzilla"

native jbe_get_user_money(id);

#define BALISONG_DAMAGE        2.0 // Damage
#define COST                    500 // Item cost

#define SOUND_PICKUP            "items/gunpickup2.wav"

new const Balisong_Model[][] =
{
    
"models/v_balisong.mdl",
    
"models/p_balisong.mdl"
}

new const 
Balisong_Sound[][] = 
{
    
"weapons/balisong_deploy.wav",
    
"weapons/balisong_hitwall.wav",
    
"weapons/balisong_slash.wav",
    
"weapons/balisong_hit.wav",
    
"weapons/balisong_hit.wav"
}

new 
bool:g_balisong[33]
new 
bool:g_hidden_balisong[33]

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
register_forward(FM_EmitSound"fw_EmitSound")

    
RegisterHam(Ham_TakeDamage,         "player",             "fw_TakeDamage",         false)
    
RegisterHam(Ham_Killed,             "player",             "PlayerKilled",             true)
    
RegisterHam(Ham_Item_Deploy,         "weapon_knife",     "fw_Item_Deploy_Post",    true)
    
    
register_clcmd("radio2""HiddenBalisong")
    
register_clcmd("say /balisong""BuyBalisong")
}

public 
plugin_precache()
{
    for(new 
0sizeof Balisong_Modeli++)
        
precache_model(Balisong_Model[i])

    for(new 
0sizeof Balisong_Soundi++)
        
precache_sound(Balisong_Sound[i])

    
precache_sound(SOUND_PICKUP)
}

public 
plugin_natives()
{
    
register_native("jbe_give_balisong""GiveBalisong"1)
    
register_native("jbe_get_balisong""GetBalisong"1)
}

public 
BuyBalisong(id)
{
    if(
g_balisong[id])
        return

    if(
jbe_get_user_money(id) < COST)
        return

    
jbe_get_user_money(idjbe_get_user_money(id) - COST)
    
GiveBalisong(id)
}

public 
GiveBalisong(id)
{
    if(
g_balisong[id])
        return

    if(
jbe_get_user_money(id) < COST)
        return

    
jbe_get_user_money(idjbe_get_user_money(id) - COST)

    if(
get_user_weapon(id) == CSW_KNIFE)
    {
        
set_pev(idpev_viewmodel2Balisong_Model[0])
        
set_pev(idpev_weaponmodel2Balisong_Model[1])
        
set_pdata_float(id830.955)
    }
    
g_balisong[id] = true
    g_hidden_balisong
[id] = false

    engfunc
(EngFunc_EmitSoundidCHAN_BODYSOUND_PICKUP1.0ATTN_NORM0PITCH_NORM)
    
message_begin(MSG_ONEget_user_msgid("WeapPickup"), {0,0,0}, id
    
write_byte(29)
    
message_end()
}

public 
GetBalisong(id)
    return 
g_balisong[id]
    
public 
HiddenBalisong(id)
{
    if(!
is_user_alive(id) || !g_balisong[id])
        return

    if(
get_user_weapon(id) != CSW_KNIFE)
        return

    if(
g_hidden_balisong[id])
        
g_hidden_balisong[id] = false
    
else g_hidden_balisong[id] = true
    
    set_pdata_float
(id830.955)

    if(
user_has_weapon(idCSW_KNIFE))
        
ExecuteHamB(Ham_Item_Deployfind_ent_by_owner(-1"weapon_knife"id))

    
engclient_cmd(id"weapon_knife")
    
emessage_begin(MSG_ONEget_user_msgid("CurWeapon"), _id)
    
ewrite_byte(1)
    
ewrite_byte(CSW_KNIFE)
    
ewrite_byte(-1)
    
emessage_end()
}

public 
fw_EmitSound(idchannel, const sample[], Float:volumeFloat:attnflagspitch)
{
    if(
is_user_connected(id) && g_balisong[id] && !g_hidden_balisong[id]) 
    {
        if(
sample[8] == 'k' && sample[9] == 'n' && sample[10] == 'i' && sample[11] == 'f' && sample[12] == 'e')
        {
            switch(
sample[17])
            {
                case 
'l':     emit_sound(idchannelBalisong_Sound[0], volumeattnflagspitch)         // knife_deploy1.wav
                
case 'w':     emit_sound(idchannelBalisong_Sound[1], volumeattnflagspitch)         // knife_hitwall1.wav
                
case 's':     emit_sound(idchannelBalisong_Sound[2], volumeattnflagspitch)         // knife_slash(1-2).wav
                
case 'b':     emit_sound(idchannelBalisong_Sound[3], volumeattnflagspitch)         // knife_stab.wav
                
default:     emit_sound(idchannelBalisong_Sound[4], volumeattnflagspitch)         // knife_hit(1-4).wav
            
}
            return 
FMRES_SUPERCEDE
        
}
    }
    return 
FMRES_IGNORED
}

public 
fw_Item_Deploy_Post(weapon_ent)
{
    static 
owner;
    
owner pev(weapon_entpev_owner)

    if(
is_user_alive(owner) && g_balisong[owner])
    {
        if(!
g_hidden_balisong[owner])
        {
            
set_pev(ownerpev_viewmodel2Balisong_Model[0])
            
set_pev(ownerpev_weaponmodel2Balisong_Model[1])
            
set_pdata_float(owner830.955)
        }
    }
}

public 
fw_TakeDamage(victiminflictorattackerFloat:damage)
{
    if (
victim != attacker && is_user_connected(attacker))
    {
        if(
get_user_weapon(attacker) == CSW_KNIFE)
        {
            if(
g_balisong[attacker] && !g_hidden_balisong[attacker])
                
SetHamParamFloat(4damage BALISONG_DAMAGE)
        }
    }
}

public 
PlayerKilled(victimattacker)
{
    if(!
is_user_connected(victim))
        return 
HAM_IGNORED

    
if(!g_balisong[victim])
        return 
HAM_IGNORED

    g_balisong
[victim] = false
    g_hidden_balisong
[victim] = false

    
return HAM_IGNORED

can someone fix this error that i get from compile this sma file
QuickDroLLL is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-14-2022 , 08:50   Re: [FIX] Error: Number of arguments does not match definition on line 75 and 87
Reply With Quote #2

Show the error maybe?
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
QuickDroLLL
Senior Member
Join Date: Dec 2021
Location: AMX Mod X Land
Old 05-14-2022 , 09:44   Re: [FIX] Error: Number of arguments does not match definition on line 75 and 87
Reply With Quote #3

Quote:
Originally Posted by OciXCrom View Post
Show the error maybe?
the error in title
QuickDroLLL is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-14-2022 , 10:03   Re: [FIX] Error: Number of arguments does not match definition on line 75 and 87
Reply With Quote #4

jbe_get_user_money() has only one argument, the plugin uses 2.
I imagine it should be jbe_set_user_money() that uses 2.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
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 12:24.


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