Raised This Month: $ Target: $400
 0% 

Connect/Disconnect message


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dizzy
Veteran Member
Join Date: Jun 2004
Location: Massachusetts
Old 05-06-2006 , 12:37   Connect/Disconnect message
Reply With Quote #1

Hey, I went to a server this morning and saw a plugin where when a user connected, it said

Dizzy connected

it was green just like above... (0,255,0)

I gave a try at making a replica of this, since I could find one in the search...

I get 6 errors when compiling...

Code:
#include <amxmodx> public plugin_init() {     register_plugin("Connect/Disconnect Messages","0.1","Dizzy");     register_cvar("amx_connect_message", "%name% connected.");     register_cvar("amx_disconnect_message", "%name% disconnected.");     register_cvar("amx_cdm","1"); } public client_putinserver(id) {     new user[32], len;     user[0] = id;     len = get_user_name(id,user[1],31);     set_task(1.0, "connect_message", 0, user,len + 2);     return PLUGIN_CONTINUE; } public client_disconnect(id) {     new user[32], len;     user[0] = id;     len = get_user_name(id, user[1], 31);     set_task(1.0, "disconnect_message", 0, user, len + 2);     return PLUGIN_CONTINUE; } public connect_message(user[]) {       if (get_cvar_num("amx_cdm")!=0)     {         new message[192];         get_cvar_string("amx_connect_message", message, 191);         replace(message, 191, "%name%", user[1]);         message_begin(MSG_ONE, get_user_msgid("SayText"), {0,255,0}, id);         write_byte(id);         write_string("message colored text");         message_end();         return PLUGIN_CONTINUE;     }     return PLUGIN_CONTINUE; } public disconnect_message(user[]) {     if (get_cvar_num("amx_cdm")!=0)     {         new message[192];         get_cvar_string("amx_disconnect_message", message, 191);         replace(message, 191, "%name%", user[1]);         message_begin(MSG_ONE, get_user_msgid("SayText"), {0,255,0}, id);         write_byte(id);         write_string("message colored text");         message_end();         return PLUGIN_CONTINUE;     }     return PLUGIN_CONTINUE; }

The errors are:
Code:
//// amx_connection.sma
// C:\HLDS\cstrike\addons\amxmodx\scripting\amx_connection.sma(36) : error 017:
undefined symbol "id"
// C:\HLDS\cstrike\addons\amxmodx\scripting\amx_connection.sma(37) : error 017:
undefined symbol "id"
// C:\HLDS\cstrike\addons\amxmodx\scripting\amx_connection.sma(37) : error 088:
number of arguments does not match definition
// C:\HLDS\cstrike\addons\amxmodx\scripting\amx_connection.sma(52) : error 017:
undefined symbol "id"
// C:\HLDS\cstrike\addons\amxmodx\scripting\amx_connection.sma(53) : error 017:
undefined symbol "id"
// C:\HLDS\cstrike\addons\amxmodx\scripting\amx_connection.sma(53) : error 088:
number of arguments does not match definition
//
// 6 Errors.
// Could not locate output file compiled\amx_connection.amx (compile failed).
Help please
Dizzy is offline
Send a message via AIM to Dizzy
P34nut
AMX Mod X Beta Tester
Join Date: Feb 2006
Location: Netherlands
Old 05-06-2006 , 12:48  
Reply With Quote #2

why can i found a connect announce plugin with search and you not :S http://forums.alliedmods.net/showthread.php?p=163726

But the error in your plugin is that you used id in the connect_message and in the disconnect_message function..
Quote:
message_begin(MSG_ONE, get_user_msgid("SayText"), {0,255,0}, id);
write_byte(id);
write_string("message colored text");
message_end();
and
Code:
 public client_putinserver(id) {     new TaskData[1]     TaskData[0] = id     set_task(1.0, "connect_message", 0, TaskData, 1)     return PLUGIN_CONTINUE; } public client_disconnect(id) {     new TaskData[1]     TaskData[0] = id     set_task(1.0, "disconnect_message", 0, TaskData, 1);     return PLUGIN_CONTINUE; }
__________________
All you need to change the world is one good lie and a river of blood
P34nut is offline
Dizzy
Veteran Member
Join Date: Jun 2004
Location: Massachusetts
Old 05-06-2006 , 12:58  
Reply With Quote #3

ahhh, I only found ones with HUD messages, didn't see v3x's

I'll use his
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 05:13.


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