AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Connect/Disconnect message (https://forums.alliedmods.net/showthread.php?t=28057)

Dizzy 05-06-2006 12:37

Connect/Disconnect message
 
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 :)

P34nut 05-06-2006 12:48

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; }

Dizzy 05-06-2006 12:58

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

I'll use his :)


All times are GMT -4. The time now is 05:13.

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