Raised This Month: $ Target: $400
 0% 

Plugin Problem.. :(


Post New Thread Reply   
 
Thread Tools Display Modes
Dizzy
Veteran Member
Join Date: Jun 2004
Location: Massachusetts
Old 12-17-2005 , 17:47  
Reply With Quote #51

ahhhh
Code:
read_args

not

Code:
read args

I also fixed the else thing you wanted me to fix

I got this now...

Code:
#pragma tabsize 0    /////////////////////////////////////////////    //AMX[X]MOD:                               //    //          Type Sounds                    //    //            By: Dizzy                    //    //                                         //    //CLCMDS:                                  //    //    holyshit                             //    //    lag                                  //    //    please                               //    //    nfs                                  //    //    stfu                                 //    //                                         //    //CONTACT:                                 //    //        <a href="mailto:[email protected]">[email protected]</a>   -E-mail //    //        AwP O AwP DiZzY          -AIM    //    ///////////////////////////////////////////// #include <amxmodx> new soundsCnt[33] public handle_say(id) {     if (soundsCnt[id] == 0)         {             client_print(id, print_center, "[Type Sounds]: Sorry, 0 Sounds Left, Wait Until Next Round!")             else client_print(id, print_center, "[Type Sounds]: %i Sound(s) Left!", soundsCnt)                 new said[64]                 read_args(said, 63)                 if (containi(said, "holyshit"))                     client_cmd(0, "spk misc/holyshit")                 else if (containi(said, "lagsux"))                     client_cmd(0, "spk misc/lagsux")                 else if (containi(said, "please"))                     client_cmd(0, "spk misc/please")                 else if (containi(said, "nfs"))                     client_cmd(0, "spk misc/nfs")                 else if (containi(said, "stfu"))                     client_cmd(0, "spk misc/stfu")                         soundsCnt[id]--         }     return PLUGIN_HANDLED } public changeround(id) {     soundsCnt[id] == 3         client_print(id, print_center, "[Type Sounds]: 3 Sounds Left!")             return PLUGIN_HANDLED } public plugin_precache() {     precache_sound("misc/holyshit.wav")     precache_sound("misc/lagsux.wav")     precache_sound("misc/please.wav")     precache_sound("misc/nfs.wav")     precache_sound("misc/stfu.wav") } public plugin_init() {     register_plugin("Type Sounds","1.0","Dizzy")     register_clcmd("say","handle_say")     register_event("ResetHUD","changeround","b") }
__________________
My Plugins

Purchase Mod - Stable
Type Sounds - Stable
Monster Spawner - Stable
Nade Giver - Maintenance
Dizzy is offline
Send a message via AIM to Dizzy
Dizzy
Veteran Member
Join Date: Jun 2004
Location: Massachusetts
Old 12-17-2005 , 17:53  
Reply With Quote #52

*Bows*

I finally have scripted this.

It compiles with no errors nor warnings

Here is the final code

Code:
#pragma tabsize 0    /////////////////////////////////////////////    //AMX[X]MOD:                               //    //          Type Sounds                    //    //            By: Dizzy                    //    //                                         //    //CLCMDS:                                  //    //    holyshit                             //    //    lag                                  //    //    please                               //    //    nfs                                  //    //    stfu                                 //    //                                         //    //CONTACT:                                 //    //        <a href="mailto:[email protected]">[email protected]</a>   -E-mail //    //        AwP O AwP DiZzY          -AIM    //    ///////////////////////////////////////////// #include <amxmodx> new soundsCnt[33] public handle_say(id) {     if (soundsCnt[id] == 0)             client_print(id, print_center, "[Type Sounds]: Sorry, 0 Sounds Left, Wait Until Next Round!")             else client_print(id, print_center, "[Type Sounds]: %i Sound(s) Left!", soundsCnt)                 new said[64]                 read_args(said, 63)                 if (containi(said, "holyshit"))                     client_cmd(0, "spk misc/holyshit")                 else if (containi(said, "lagsux"))                     client_cmd(0, "spk misc/lagsux")                 else if (containi(said, "please"))                     client_cmd(0, "spk misc/please")                 else if (containi(said, "nfs"))                     client_cmd(0, "spk misc/nfs")                 else if (containi(said, "stfu"))                     client_cmd(0, "spk misc/stfu")                         soundsCnt[id]--                                 return PLUGIN_HANDLED } public changeround(id) {     soundsCnt[id] = 3         client_print(id, print_center, "[Type Sounds]: 3 Sounds Left!")             return PLUGIN_HANDLED } public plugin_precache() {     precache_sound("misc/holyshit.wav")     precache_sound("misc/lagsux.wav")     precache_sound("misc/please.wav")     precache_sound("misc/nfs.wav")     precache_sound("misc/stfu.wav") } public plugin_init() {     register_plugin("Type Sounds","1.0","Dizzy")     register_clcmd("say","handle_say")     register_event("ResetHUD","changeround","b") }
__________________
My Plugins

Purchase Mod - Stable
Type Sounds - Stable
Monster Spawner - Stable
Nade Giver - Maintenance
Dizzy is offline
Send a message via AIM to Dizzy
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 12-17-2005 , 19:35  
Reply With Quote #53

You need to learn about { and }. They are your friends. You will dance many a night away with them.

If you're too lazy too read the whole thing, at least start at page 4 and read a few pages further.

http://www.compuphase.com/pawn/pawn-lang.pdf

You really should read the whole thing. Anyone that is new to Small should.
Brad is offline
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 12-17-2005 , 20:05  
Reply With Quote #54

Brad did you just read that to learn how to script?
Peli is offline
Send a message via MSN to Peli
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 12-17-2005 , 20:40  
Reply With Quote #55

I read that somewhere in the beginning. I also read the tutorial in the docs here. Read the stickies. Looked at other plugins that did things that I was interested in.

However, before all of that I spent many years programming in other languages and reading many books. Code Complete is a must, regardless of what language your program in.

I could say more but I need to watch my Detroit Pistons toy with the Bobcats.
Brad is offline
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 12-18-2005 , 02:27  
Reply With Quote #56

Lol okay, your a Pistons fan so am I, been a fan for many years.
Peli is offline
Send a message via MSN to Peli
Dizzy
Veteran Member
Join Date: Jun 2004
Location: Massachusetts
Old 12-18-2005 , 15:04  
Reply With Quote #57

Hmmm, Are you saying that at every "if" statement you should use { and close with }?

And it is redundant to use return PLUGIN_HANDLED at the end of every if statement when it can just be used at the end of the (id) thread?

I think I get what your saying

I will edit it more.
__________________
My Plugins

Purchase Mod - Stable
Type Sounds - Stable
Monster Spawner - Stable
Nade Giver - Maintenance
Dizzy is offline
Send a message via AIM to Dizzy
Dizzy
Veteran Member
Join Date: Jun 2004
Location: Massachusetts
Old 12-18-2005 , 15:15  
Reply With Quote #58

This compiles without any errors also...

=D

Code:
#pragma tabsize 0    /////////////////////////////////////////////    //AMX[X]MOD:                               //    //          Type Sounds                    //    //            By: Dizzy                    //    //                                         //    //CLCMDS:                                  //    //    holyshit                             //    //    lag                                  //    //    please                               //    //    nfs                                  //    //    stfu                                 //    //                                         //    //CONTACT:                                 //    //        <a href="mailto:[email protected]">[email protected]</a>   -E-mail //    //        AwP O AwP DiZzY          -AIM    //    ///////////////////////////////////////////// #include <amxmodx> new soundsCnt[33] public handle_say(id) {     if (soundsCnt[id] == 0)         {             client_print(id, print_center, "[Type Sounds]: Sorry, 0 Sounds Left, Wait Until Next Round!")         }             else         {             client_print(id, print_center, "[Type Sounds]: %i Sound(s) Left!", soundsCnt)                 new said[64]                 read_args(said, 63)                 if (containi(said, "holyshit"))                     client_cmd(0, "spk misc/holyshit")                 else if (containi(said, "lagsux"))                     client_cmd(0, "spk misc/lagsux")                 else if (containi(said, "please"))                     client_cmd(0, "spk misc/please")                 else if (containi(said, "nfs"))                     client_cmd(0, "spk misc/nfs")                 else if (containi(said, "stfu"))                     client_cmd(0, "spk misc/stfu")                         soundsCnt[id]--         }                                 return PLUGIN_HANDLED } public changeround(id) {     soundsCnt[id] = 3         client_print(id, print_center, "[Type Sounds]: 3 Sounds Left!")             return PLUGIN_HANDLED } public plugin_precache() {     precache_sound("misc/holyshit.wav")     precache_sound("misc/lagsux.wav")     precache_sound("misc/please.wav")     precache_sound("misc/nfs.wav")     precache_sound("misc/stfu.wav") } public plugin_init() {     register_plugin("Type Sounds","1.0","Dizzy")     register_clcmd("say","handle_say")     register_event("ResetHUD","changeround","b") }
__________________
My Plugins

Purchase Mod - Stable
Type Sounds - Stable
Monster Spawner - Stable
Nade Giver - Maintenance
Dizzy is offline
Send a message via AIM to Dizzy
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 15:21.


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