Raised This Month: $ Target: $400
 0% 

some newbie questions :o


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
blaah
Member
Join Date: Jun 2004
Location: germany
Old 07-04-2004 , 15:44   some newbie questions :o
Reply With Quote #1

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
__________________
blaah is offline
Send a message via ICQ to blaah
 



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 14:48.


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