Raised This Month: $ Target: $400
 0% 

First Plug. Need Help. Be Gentle.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
smdobay
Member
Join Date: Feb 2005
Old 02-18-2005 , 00:03   First Plug. Need Help. Be Gentle.
Reply With Quote #1

So then, I recently switched over my cs server from AMX mod to AMXX. However, some of the old plugs I used to have weren't available for amxx, and since I like a challenge, I decided to write some of them myself rather than converting them (which I don't know how to do anyway ).

The first plugin I was trying to make was an amx_money command for admins of level h. Example:

amx_money Player 16000 ;Entered into the console.

So I read a bunch of stickes (this is my first small coding, but by no means my first time coding) and a few tutorials and came up with this:

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun> public plugin_init() {    register_plugin("AmxxMoney","0.1","smdobay")    register_concmd("amx_money","money",ADMIN_LEVEL_H,"amx_money") } public money(id,level,cid) {      if (!cmd_access(id, level, cid, 0)) {       if (read_argc() < 2) {             console_print(id,"[AMXX] You must specify a user")             return PLUGIN_HANDLED           }       new user[32], amount, uid       read_argv(1,user,32)      read_argv(2,amount)       uid = find_player("bh",user)       if (uid == 0) {           console_print(id,"[AMXX] Invalid User Id")           return PLUGIN_HANDLED       }       client_cmd(id,"echo Player Granted Funds")                   cs_set_user_money(id,amount)           return PLUGIN_HANDLED      }       }

(In the preview my indentations aren't correct, but they are in the .sma file. I'm not that sloppy )

However, when I compiled it (no errors, just a warning about not returning a value), the server doesn't recognize amx_money as a command. And yes, before you ask, I did put it into my plugins.ini.

Thoughts? Help? Suggestions?

P.S. Rather than simply setting their money, it would be cool if I could set it to add on, but I don't know the funtion for returning a player's funds.
smdobay 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:21.


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