AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   New Plugin (https://forums.alliedmods.net/showthread.php?t=20008)

kal2004 10-30-2005 11:41

New Plugin
 
Hi guys can anyone help me fix the following errors in my plug?

:Error:
Code:
php0KVblO.sma(69) : error 029: invalid expression, assumed zero  php0KVblO.sma(97) : warning 203: symbol is never used: "check_say"


:Code:
Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun> #include <engine> #define USING_STEAM 1 // comment this line if your using WON CS 1.5 #define MESSAGES 4 #define MAX_NAME_LENGTH 32 #define MAX_PLAYERS 32 #define MAX_TEXT_LENGTH 192 public plugin_init() {     register_plugin("'Z'","0.1","AMXX")     register_cvar("amx_kalssounds","1") } // Kal's Fun Sounds by Kal2005 //---------------------------- new kals_msg[MESSAGES][] = {     "Cha'mone",     "Check Me!" } new kals_sound[MESSAGES][] = {     "misc/kals/chamone.wav",     "misc/kals/checkme.wav" } new bool:ids[33] public kalssounds(id,level,cid) //---------------------------------------------------------------------------------------------- public check_say(id) {     if (!ids[id]) return PLUGIN_CONTINUE     new said[32]     read_args(said,31)     remove_quotes(said)     for (new i=0; i<MESSAGES; i++)         if(equal(said,kals_msg[i]))             return PLUGIN_CONTINUE     new ran = random_num(0,MESSAGES-1)     client_cmd(id,"say %s",kals_msg[ran])     if (get_cvar_num("amx_kalssounds")) client_cmd(id,"spk %s",kals_sound[ran])     return PLUGIN_HANDLED } //---------------------------------------------------------------------------------------------- public client_putinserver(id) {     ids[id] = false } //---------------------------------------------------------------------------------------------- public plugin_modules() {     require_module("fun")     require_module("cstrike") }

please help, i am a n00b at this stuff.

Thanks
Kal

Charr 10-30-2005 12:02

Try this:
Your defiend MESSAGES was too large
Code:
#include <amxmodx> #include <amxmisc> /* Dont Need these Modules //#include <cstrike> //#include <fun> //#include <engine> */ #define USING_STEAM 1 // comment this line if your using WON CS 1.5 #define MESSAGES 2 #define MAX_NAME_LENGTH 32 #define MAX_PLAYERS 32 #define MAX_TEXT_LENGTH 192 public plugin_init() {     register_plugin("'Z'","0.1","AMXX")     register_cvar("amx_kalssounds","1") } // Kal's Fun Sounds by Kal2005 //---------------------------- new kals_msg[MESSAGES][]= {     "Cha'mone",     "Check Me!" } new kals_sound[MESSAGES][] = {     "misc/kals/chamone.wav",     "misc/kals/checkme.wav" } new bool:ids[33] //public kalssounds(id,level,cid) //---------------------------------------------------------------------------------------------- public check_say(id) {     if (!ids[id]) return PLUGIN_CONTINUE         new said[32]     read_args(said,31)     remove_quotes(said)     for (new i=0; i<MESSAGES; i++)         if(equal(said,kals_msg[i]))             return PLUGIN_CONTINUE         new ran = random_num(0,MESSAGES-1)     client_cmd(id,"say %s",kals_msg[ran])     if (get_cvar_num("amx_kalssounds"))         client_cmd(id,"spk %s",kals_sound[ran])         return PLUGIN_HANDLED } //---------------------------------------------------------------------------------------------- public client_putinserver(id) {     ids[id] = false }

kal2004 10-30-2005 13:54

Thanks very much it has compiled, will go and test it now!! fingers crossed, this is only my 2nd plugin!!

kal2004 10-30-2005 15:18

have tried to test but it doesn't work, when i type the command amx_kalssounds 1 it says unknown command! and doesn't play the sound files.

please help

Zenith77 10-30-2005 15:20

cvars are not commands

kal2004 10-30-2005 15:32

it doesn't show in amx_help either!! how can i get this to work??

i have also tried to debug but it wont debug it either??

Zenith77 10-30-2005 15:47

Quote:

Originally Posted by Zenith77
cvars are not commands


register_clcmd()

Batman/Gorlag 10-30-2005 16:12

Here's register_clcmd() more detailed:

register_clcmd("what you type in the console", "name of the function your plugin will perform", Set restrictions as to who should use the command, "Supply help text, so it appears in amx_help")

kal2004 10-30-2005 16:50

????I am a n00b at this dont forget, this is what i have but it still isn't working????

Code:
public plugin_init() {     register_plugin("'Z'","0.1","AMXX")     register_cvar("amx_kalssounds","1")     register_clcmd("say","cha'mone")

can you tell me exactly what i need to add or remove etc?
help text?

Batman/Gorlag 10-30-2005 16:53

www.amxmodx.org/doc/source/scripting/index.htm


All times are GMT -4. The time now is 23:58.

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