Raised This Month: $ Target: $400
 0% 

Try-outs : Need help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
santa
Member
Join Date: Nov 2005
Old 11-25-2005 , 23:34   Try-outs : Need help
Reply With Quote #1

Well. I tried writing up a plugin that is based on anson's admin broadcasting except that I looked at his as an example and try creating my own and see if it would work.

Compiler giving me lotsa errors. Someone tell me what did I went wrong ^^ I can only learn from mistakes x_x
Attached Thumbnails
Click image for larger version

Name:	errors.gif
Views:	181
Size:	27.0 KB
ID:	4678  
santa is offline
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 11-25-2005 , 23:57  
Reply With Quote #2

1st mistake. Wheres the source?
Freecode is offline
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 11-26-2005 , 00:01  
Reply With Quote #3

How can we help you fix the mistakes without the thing you had mistakes on... the plugin... dun dun dun!
Peli is offline
Send a message via MSN to Peli
santa
Member
Join Date: Nov 2005
Old 11-26-2005 , 00:03  
Reply With Quote #4

Oh yes yes, almost forgot about that ^^

The way I do this is through the scripting tutorial and taking a look once in a while at anson's script.

Edit: First error solved =P I included 2 plugin_init previously

Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #define PLUGIN "New Plugin" #define VERSION "1.0" #define AUTHOR "Author" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_concmd("amx_message", "msgbroadcast", ADMIN_LEVEL_A, "user Broadcast message")     } public send_message(message[]) {     new msg[64]     format (msg, 63, "%s", message)     client_print(0, print_center, "%s", msg) } public msgbroadcast(id) {     if (!(get_user_flags(id)&ADMIN_LEVEL_A)) {         console_print(id, "[AMXX] You donot have the access")         return PLUGIN_HANDLED                 new message[64]         new msglen = read_argv(1, message, 63)                 if (equali(message "")) {             console_print(id, "[AMXX] Message cannot be blank")             client_print(id, "[AMXX] Message cannot be blank")         }         return PLUGIN_HANDLED }

didnt include any credits whatsoever though.. figured if i cant handle such simple stuff.. x_x

The attachment is the original plugin made by anson
Attached Files
File Type: sma Get Plugin or Get Source (adminbroadcast.sma - 716 views - 2.6 KB)
santa is offline
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 11-26-2005 , 00:32  
Reply With Quote #5

if (equali(message "")) << missing a ,
Freecode is offline
santa
Member
Join Date: Nov 2005
Old 11-26-2005 , 00:38  
Reply With Quote #6

Didn't seem to make any difference - 4 errors still shown.
santa is offline
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 11-26-2005 , 00:39  
Reply With Quote #7

if (!(get_user_flags(id)&ADMIN_LEVEL_A)) { << missing a closing bracket
Freecode is offline
santa
Member
Join Date: Nov 2005
Old 11-26-2005 , 00:44  
Reply With Quote #8

It worked.. Did solve one error message..

"unreachable code" error now is gone

but it's replaced by loose indentation error

and the other error messages still appear.. I need more help please.. Thank you for being patient ^^

Edit: Loose indentation error fixed. But the rest still appears.
santa is offline
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 11-26-2005 , 00:51  
Reply With Quote #9

post updated code and error log
Freecode is offline
santa
Member
Join Date: Nov 2005
Old 11-26-2005 , 00:54  
Reply With Quote #10

Here goes.

Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #define PLUGIN "New Plugin" #define VERSION "1.0" #define AUTHOR "Author" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_concmd("amx_message", "msgbroadcast", ADMIN_LEVEL_A, "user Broadcast message")     } public send_message(message[]) {     new msg[64]     format (msg, 63, "%s", message)     client_print(0, print_center, "%s", msg) } public msgbroadcast(id) {     if (!(get_user_flags(id)&ADMIN_LEVEL_A)) {         console_print(id, "[AMXX] You donot have the access")         return PLUGIN_HANDLED     }         new message[64]     new msglen = read_argv(1, message, 63)         if (equali(message "")), {         console_print(id, "[AMXX] Message cannot be blank")         client_print(id, "[AMXX] Message cannot be blank")     }     return PLUGIN_HANDLED
Attached Thumbnails
Click image for larger version

Name:	smalltest_errors.jpg
Views:	146
Size:	52.1 KB
ID:	4680  
santa 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 14:42.


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