Raised This Month: $ Target: $400
 0% 

my first plugin... need some help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sp4rt4n
Senior Member
Join Date: Dec 2004
Old 01-26-2005 , 22:08   my first plugin... need some help
Reply With Quote #1

im trying to do a tutorial plugin that i found on a site...
keep in mind, this is my first one ever...
can someone help me?

Code:
#include <amxmodx> #include <amxmisc> #define ADMIN_TEXT ADMIN_USER public plugin_int() {     register_plugin ("Text Messaging!","1.1","UnKn0wNkIlLeR")     register_concmd("amx_test","amx_test", ADMIN_TEXT, "amx_text")     register_cvar("sv_text","1") } public amx_text(id) {     new string[200], string[3]     read_argv(1,string,2);     read_argv(2,string,199);     if(!get_cvar_num("sv_text"))     return PLUGIN_HANDLED;         switch(str_to_num(string))     {         case 0: client_print(0,print_chat,"[AMX] %s", string2)         case 1: client_print(0,print_center,"[AMX] %s", string2)         case 2: client_print(0,print_console,"[AMX] %s", string2)         case 3: client_print(0,print_notify,"[AMX] %s", string2)     }       return PLUGIN_HANDLED; }

and heres the errors:

/home/users/amxmodx/tmp/okct1j20.sma(15) : error 021: symbol already defined: "string"
/home/users/amxmodx/tmp/okct1j20.sma(22) : error 017: undefined symbol "string2"
/home/users/amxmodx/tmp/okct1j20.sma(22 -- 23) : warning 202: number of arguments does not match definition
/home/users/amxmodx/tmp/okct1j20.sma(22 -- 23) : error 001: expected token: ",", but found "case"
/home/users/amxmodx/tmp/okct1j20.sma(23) : error 017: undefined symbol "string2"
/home/users/amxmodx/tmp/okct1j20.sma(23) : fatal error 107: too many error messages on one line
Sp4rt4n is offline
Send a message via MSN to Sp4rt4n
Sp4rt4n
Senior Member
Join Date: Dec 2004
Old 01-26-2005 , 22:14  
Reply With Quote #2

oh, would it help if instead of:

Code:
new string[200], string[3]

i put:

Code:
new string[200], string2[3]

??

PS: Sorry for double posting
Sp4rt4n is offline
Send a message via MSN to Sp4rt4n
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 01-26-2005 , 22:40  
Reply With Quote #3

Code:
#include <amxmodx>
#include <amxmisc>

#define ADMIN_TEXT ADMIN_USER

public plugin_int()
{
	register_plugin ("Text Messaging!","1.1","UnKn0wNkIlLeR")
	register_concmd("amx_test","amx_test", ADMIN_TEXT, "amx_text")
	register_cvar("sv_text","1")
}

public amx_text(id)
{
	new string2[200], string[32]
	read_argv(1,string,31);
	read_argv(2,string2,199);
	if(!get_cvar_num("sv_text")) return PLUGIN_HANDLED;

	switch(str_to_num(string))
	{
		case 0: client_print(0,print_chat,"[AMX] %s", string2)
		case 1: client_print(0,print_center,"[AMX] %s", string2)
		case 2: client_print(0,print_console,"[AMX] %s", string2)
		case 3: client_print(0,print_notify,"[AMX] %s", string2)
	}  
	return PLUGIN_HANDLED;
}
When you make a string2, define a freaken string2.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
Sp4rt4n
Senior Member
Join Date: Dec 2004
Old 01-26-2005 , 22:49  
Reply With Quote #4

sorry, i just started learning this stuff tonight...
Sp4rt4n is offline
Send a message via MSN to Sp4rt4n
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 01-27-2005 , 16:44  
Reply With Quote #5

Lol don't be too hard on him Suzuka , it's a pretty nice try for a first plugin.
Peli is offline
Send a message via MSN to Peli
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 19:18.


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