Raised This Month: $ Target: $400
 0% 

arguments does not match definition


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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