AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Noobie at scripting.. (https://forums.alliedmods.net/showthread.php?t=22649)

Shaitan 12-31-2005 22:11

Noobie at scripting..
 
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.

SubFive 12-31-2005 22:22

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 }

Shaitan 12-31-2005 22:28

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

SubFive 12-31-2005 22:35

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).

Shaitan 12-31-2005 22:37

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

SubFive 12-31-2005 22:57

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 }

Shaitan 12-31-2005 22:57

bump :)

VEN 01-01-2006 05:39

Read http://www.amxmodx.org/doc first.

Shaitan 01-01-2006 13:25

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 :( :(

Des12 01-01-2006 15:28

http://www.amxmodx.org/funcwiki.php


All times are GMT -4. The time now is 16:12.

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