Raised This Month: $ Target: $400
 0% 

New Plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kal2004
Junior Member
Join Date: Jul 2005
Old 10-30-2005 , 11:41   New Plugin
Reply With Quote #1

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
kal2004 is offline
Send a message via MSN to kal2004
Charr
Senior Member
Join Date: Jul 2005
Location: Long Island, New York, U
Old 10-30-2005 , 12:02  
Reply With Quote #2

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 }
__________________
Charr is offline
Send a message via AIM to Charr Send a message via MSN to Charr
kal2004
Junior Member
Join Date: Jul 2005
Old 10-30-2005 , 13:54  
Reply With Quote #3

Thanks very much it has compiled, will go and test it now!! fingers crossed, this is only my 2nd plugin!!
kal2004 is offline
Send a message via MSN to kal2004
kal2004
Junior Member
Join Date: Jul 2005
Old 10-30-2005 , 15:18  
Reply With Quote #4

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
kal2004 is offline
Send a message via MSN to kal2004
Zenith77
Veteran Member
Join Date: Aug 2005
Old 10-30-2005 , 15:20  
Reply With Quote #5

cvars are not commands
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
kal2004
Junior Member
Join Date: Jul 2005
Old 10-30-2005 , 15:32  
Reply With Quote #6

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??
kal2004 is offline
Send a message via MSN to kal2004
Zenith77
Veteran Member
Join Date: Aug 2005
Old 10-30-2005 , 15:47  
Reply With Quote #7

Quote:
Originally Posted by Zenith77
cvars are not commands

register_clcmd()
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
Batman/Gorlag
Senior Member
Join Date: Aug 2005
Old 10-30-2005 , 16:12  
Reply With Quote #8

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")
__________________
GRR If only the amxmod programming were in Java.....
Java and C used to be two different languages, now Java is turning into another C. My logevent plugin
Batman/Gorlag is offline
kal2004
Junior Member
Join Date: Jul 2005
Old 10-30-2005 , 16:50  
Reply With Quote #9

????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?
kal2004 is offline
Send a message via MSN to kal2004
Batman/Gorlag
Senior Member
Join Date: Aug 2005
Old 10-30-2005 , 16:53  
Reply With Quote #10

www.amxmodx.org/doc/source/scripting/index.htm
__________________
GRR If only the amxmod programming were in Java.....
Java and C used to be two different languages, now Java is turning into another C. My logevent plugin
Batman/Gorlag 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 23:58.


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