hi,
i want to write a little, useless plugin, that allows to spend each other 1$.
as i don't have written any other plugins before i tryed to put some code together and to get it running.

now i have some questions:
- how can i put a counter in there, to check how often someone spends money
- how can i change the concmd so that there must be at least 2 arguments instead of 3
Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
public plugin_init(){
register_plugin("Spendmoney","0.1","Jens")
//register_clcmd("say a", "give")
register_concmd("amx_spend","give", ADMIN_LEVEL_A,"<nick> OR <#userid>")
}
public give(id,level,cl){
if (!cmd_access(id,level,cl,3)){
return PLUGIN_HANDLED
}
new frst[32], name2[32], name[32]
read_argv(1,frst,31)
new player = cmd_target(id,frst)
if (!player) return PLUGIN_HANDLED
get_user_name(id,name,31)
get_user_name(player,name2,31)
cs_set_user_money(player,cs_get_user_money(player)+1,1)
set_hudmessage(6,13,28,0.05,0.86,2, 3.0, 2.0, 0.2, 3.0, 1)
show_hudmessage(0, "%s spendet %s $1,00..", name, name2)
client_print(id,print_chat,"Yeah! Du hast %s $1,00 gespendet..",name2)
return PLUGIN_HANDLED
}
beginnig is always hard
__________________