AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   First plugin mismatch (https://forums.alliedmods.net/showthread.php?t=22557)

Wolfe 12-30-2005 01:49

First plugin mismatch
 
Yes, i know this is a small very small and might be all wrong. But i am trying to learn amxx and have tryed to start it.

Code:

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_clcmd("pause","ADMIN_PAUSE","ADMIN_LEVEL_B")
}
public function(id)
{
new name [33]
get_user_name(id,name,1)

client_cmd(0,"spk goslow.wav")
client_print(0,print_chat,"[AMX]Server is in pause mode",name)

return PLUGIN_HANDLED
}

Ps its 1:50 am here so im a little tired

SubFive 12-30-2005 01:52

Nothing is calling your function named "function". For starters, change "ADMIN_PAUSE" to "function".

Code:
public plugin_init() {      register_plugin(PLUGIN, VERSION, AUTHOR)      register_clcmd("pause","function","ADMIN_LEVEL_B") } public function(id) { new name[33] get_user_name(id,name,1) client_cmd(0,"spk goslow.wav") client_print(0,print_chat,"[AMX]Server is in pause mode",name) return PLUGIN_HANDLED }

v3x 12-30-2005 01:54

Code:
 #include <amxmodx> #include <amxmisc> // You forgot your defines #define PLUGIN "My Plugin" #define VERSION "1.0" #define AUTHOR "Somebody" public plugin_init() {      register_plugin(PLUGIN, VERSION, AUTHOR)      register_clcmd("pause","function",ADMIN_LEVEL_B) } public function(id) {   // check access   if(!cmd_access(id,level,cid,1))     return PLUGIN_HANDLED   new name [33]   get_user_name(id,name,32) // length is 33-1 in this case   client_cmd(0,"spk goslow.wav")   client_print(0,print_chat,"[AMXX] Server is in pause mode",name)   return PLUGIN_HANDLED }
I'm off to bed.

Wolfe 12-30-2005 01:59

Thanks guys ill try this in the morning im also off to bed :roll:

VEN 12-30-2005 04:15

Do not try to register pause client command it already exist by default in CS and it can't be handled by this way.

v3x 12-30-2005 15:57

I was going to say something about that, but I was too tired/lazy to :P


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

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