Raised This Month: $ Target: $400
 0% 

Noobie at scripting..


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Shaitan
BANNED
Join Date: Oct 2005
Location: Over there
Old 12-31-2005 , 22:11   Noobie at scripting..
Reply With Quote #1

Alright.. I read the doc.. I have a question.. I read the Basic Plugin completely.. about the amx_hp plugin..
Code:
public plugin_init()
{
     register_plugin(PLUGIN, VERSION, AUTHOR)
     register_concmd("amx_hp", "cmd_hp", ADMIN_SLAY, "<target> ")
}

public cmd_hp(id, level, cid)
{
     return PLUGIN_HANDLED
}
Now, I understand register_plugin, thats obvious..
register_concmd.. I understand amx_hp.. I understand the admin level, and I understand the <target> for amx_help. I dont understand cmd_hp.. I think that its the command that is sent to the server.. Not sure though... But, That is only for health.. What if I want to make a completely different plugin, having nothing to do with health.. How do I find that?

Thnx.. Real noob at scripting.
Shaitan is offline
Send a message via AIM to Shaitan
Old 12-31-2005, 22:20
Sonic7145
This message has been deleted by Sonic7145.
SubFive
Senior Member
Join Date: Dec 2005
Location: USA
Old 12-31-2005 , 22:22  
Reply With Quote #2

The "cmd_hp" part is what is executed when someone uses amx_hp. In this case, return PLUGIN_HANDLED is executed when someone uses amx_hp, which means this plugin is useless.

Code:
public plugin_init() {      register_plugin(PLUGIN, VERSION, AUTHOR)      register_concmd("amx_hp", "cmd_hp", ADMIN_SLAY, "<target> ") } public cmd_hp(id, level, cid) {      return PLUGIN_HANDLED }
SubFive is offline
Shaitan
BANNED
Join Date: Oct 2005
Location: Over there
Old 12-31-2005 , 22:28  
Reply With Quote #3

I realize that. That was just a 'snippet' of the code You guys missed my question entirely.
Quote:
I dont understand cmd_hp.. I think that its the command that is sent to the server.. Not sure though... But, That is only for health.. What if I want to make a completely different plugin, having nothing to do with health.. How do I find that?
cmd_hp.. that is obviously health.. Um, where do I find others, that dont have to do with health.. Uh, as in, suppose I wnat to make a plugin that kicks.. I know all of you can tell me what it is, but is there a huge list of them?

Thnx
Shaitan is offline
Send a message via AIM to Shaitan
SubFive
Senior Member
Join Date: Dec 2005
Location: USA
Old 12-31-2005 , 22:35  
Reply With Quote #4

Notice the cmd_hp in the plugin initiation:
Code:
register_concmd("amx_hp", "cmd_hp", ADMIN_SLAY, "<target> ")

See how it matches the function below it, with:
Code:
public cmd_hp(id, level, cid)

The cmd_hp could be changed to anything, you could switch them both to say myfunction or function_1. It is just tieing the function with the command (amx_hp).
SubFive is offline
Shaitan
BANNED
Join Date: Oct 2005
Location: Over there
Old 12-31-2005 , 22:37  
Reply With Quote #5

OK, you solved that problem.. How about,
In another plugin, there is something like

cs_get_user_money

or something like that.. I dont know how to make these plugins work...
Maybe Im missing something..
Please help
Shaitan is offline
Send a message via AIM to Shaitan
SubFive
Senior Member
Join Date: Dec 2005
Location: USA
Old 12-31-2005 , 22:57  
Reply With Quote #6

Im assuming you want to figure out how much money a given user has?

Code:
#include <amxmodx> #include <cstrike> public plugin_init() {     register_clcmd("say /money","cmd_money",ADMIN_USER) } public cmd_money(id) {     new Money = cs_get_user_money(id);     // do what you want with the money here, maybe client_print or something }
SubFive is offline
Shaitan
BANNED
Join Date: Oct 2005
Location: Over there
Old 12-31-2005 , 22:57  
Reply With Quote #7

bump
Shaitan is offline
Send a message via AIM to Shaitan
VEN
Veteran Member
Join Date: Jan 2005
Old 01-01-2006 , 05:39  
Reply With Quote #8

Read http://www.amxmodx.org/doc first.
VEN is offline
Shaitan
BANNED
Join Date: Oct 2005
Location: Over there
Old 01-01-2006 , 13:25  
Reply With Quote #9

Quote:
Alright.. I read the doc.. I have a question.. I read the Basic Plugin completely.. about the amx_hp plugin..
I did.

Ok, now instead of cmd_health, you are using cmd_money. Is there a huge list of those? Or, is that perhaps a var that you create? I dont understand it. Please help
Shaitan is offline
Send a message via AIM to Shaitan
Des12
Senior Member
Join Date: Jan 2005
Old 01-01-2006 , 15:28  
Reply With Quote #10

http://www.amxmodx.org/funcwiki.php
__________________
-Dest Romano

www.JustRP.com
A TSRP Server

Quote:
Originally Posted by Brad
Don't you go be bringing reality into this.
Des12 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 16:12.


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