Raised This Month: $ Target: $400
 0% 

arguments does not match definition


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
demortion
Junior Member
Join Date: Aug 2013
Old 09-07-2013 , 05:20   arguments does not match definition
Reply With Quote #1

I'm Using Jailbreak Extended version for my Steam Cs server
it has coin option instead money or jailbreak pack
for that i have created a function it would give players coins via admin console command i've done everything correctly
my api is correct but its still showing an error -number of arguments does not match definition
i hope you can understand help me
my code

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <cs-store>

public plugin_init()
{
register_plugin("Admin Money coins","0.10","DM");
register_clcmd("amx_givecoin","cmd_givecoins" ,ADMIN_KICK,"<player> <amount> - gives specified player New coins");
}

public cmd_givecoins(id,level,cid)
{
// no access
if(!cmd_access(id,level,cid,3))
return PLUGIN_HANDLED;

// grab arguments
new arg[32], arg2[32];
read_argv(1,arg,32);
read_argv(2,arg2,31);

// get player and validate
new player = cmd_target(id,arg,2);
if(!player) return PLUGIN_HANDLED;

// get coins and set it
new amount = str_to_num(arg2);
set_user_coins(player,get_user_coins(player)+ amount);

// get names
new playerName[32], adminName[32];
get_user_name(player,playerName,31);
get_user_name(id,adminName,31);

// get authids for log
new playerAuthid[32], adminAuthid[32];
get_user_authid(player,playerAuthid,31);
get_user_authid(id,adminAuthid,31);

log_amx("Give coin: ^"%s<%d><%s><>^" gave ^"%s<%d><%s><>^" $%i",adminName,get_user_userid(id),adminAuth i d,playerName,get_user_userid(player),playerAu thid,amount);

switch(get_cvar_num("amx_show_activity"))
{
case 2: client_print(0,print_chat,"ADMIN %s: give %s $%i",adminName,playerName,amount);
case 1: client_print(0,print_chat,"ADMIN: give %s $%i",playerName,amount);
}

console_print(id,"* Gave %s $%i",playerName,amount);

return PLUGIN_HANDLED;
}

and i know that im not good in scripting anyways -Beginner

Last edited by demortion; 09-07-2013 at 05:26.
demortion is offline
simanovich
AlliedModders Donor
Join Date: Jun 2012
Location: Israel
Old 09-07-2013 , 14:09   Re: arguments does not match definition
Reply With Quote #2

Complites fine:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <cs-store>

public plugin_init(){
    
register_plugin("Admin Money coins","0.10","DM");
    
register_clcmd("amx_givecoin","cmd_givecoins" ,ADMIN_KICK,"<player> <amount> - gives specified player New coins");
}

public 
cmd_givecoins(id,level,cid){
    
    
// no access
    
if(!cmd_access(id,level,cid,3))
        return 
PLUGIN_HANDLED;

    
// grab arguments
    
new arg[32], arg2[32];
    
read_argv(1,arg,32);
    
read_argv(2,arg2,31);
    
    
// get player and validate
    
new player cmd_target(id,arg,2);
    if(!
player) return PLUGIN_HANDLED;
    
    
// get coins and set it
    
new amount str_to_num(arg2);
    
set_user_coins(player,get_user_coins(player) + amount);
    
    
// get names
    
new playerName[32], adminName[32];
    
get_user_name(player,playerName,charsmax(playerName));
    
get_user_name(id,adminName,charsmax(adminName));
    
    
// get authids for log
    
new playerAuthid[32], adminAuthid[32];
    
get_user_authid(player,playerAuthid,31);
    
get_user_authid(id,adminAuthid,31);
    
    
log_amx("Give coin: ^"%s<%d><%s><>^" gave ^"%s<%d><%s><>^" $%i",adminName,get_user_userid(id),adminAuthid,playerName,get_user_userid(player),playerAuthid,amount);
    
    switch(
get_cvar_num("amx_show_activity"))
    {
        case 
2client_print(0,print_chat,"ADMIN %s: give %s $%i",adminName,playerName,amount);
        case 
1client_print(0,print_chat,"ADMIN: give %s $%i",playerName,amount);
    }
    
    
console_print(id,"* Gave %s $%i",playerName,amount);

    return 
PLUGIN_HANDLED;

__________________
simanovich is offline
demortion
Junior Member
Join Date: Aug 2013
Old 09-08-2013 , 00:22   Re: arguments does not match definition
Reply With Quote #3

not working for me sad can you mail me the amxx file thank you anyways if its working for you
demortion is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-08-2013 , 04:09   Re: arguments does not match definition
Reply With Quote #4

Quote:
Originally Posted by demortion View Post
not working for me sad can you mail me the amxx file thank you anyways if its working for you
What doesn't work? Giving you the .amxx file won't make it magically work.
__________________
fysiks is offline
demortion
Junior Member
Join Date: Aug 2013
Old 09-08-2013 , 12:56   Re: arguments does not match definition
Reply With Quote #5

^the purpose behind this is to find solution bro not this ! ? ?
demortion is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-08-2013 , 15:05   Re: arguments does not match definition
Reply With Quote #6

Quote:
Originally Posted by demortion View Post
^the purpose behind this is to find solution bro not this ! ? ?
Your statement doesn't make any sense. You should answer my question.
__________________
fysiks 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 19:09.


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