Raised This Month: $51 Target: $400
 12% 

client_print at player spawn?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 12-28-2006 , 21:05   client_print at player spawn?
Reply With Quote #1

How can I do a client_print each time a player spawns? Please help
hlstriker is offline
The Specialist
BANNED
Join Date: Nov 2006
Old 12-28-2006 , 21:09   Re: client_print at player spawn?
Reply With Quote #2

Here
Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #define PLUGIN "print spawn" #define VERSION "1.0" #define AUTHOR "The Specialist" #define MAX_PLAYERS  32 new bool:g_restart_attempt[MAX_PLAYERS + 1]; public plugin_init()  {  register_plugin(PLUGIN, VERSION, AUTHOR);  register_event("ResetHUD", "event_hud_reset", "be");  register_clcmd("fullupdate", "clcmd_fullupdate") ;  register_event("TextMsg", "event_restart_attempt", "a", "2=#Game_will_restart_in"); } public clcmd_fullupdate() {  return 1; } public event_restart_attempt() {  new players[32], num;  get_players(players, num, "a");    for (new i; i < num; ++i)  {   g_restart_attempt[players[i]] = true;  } } public event_hud_reset(id) {  if (g_restart_attempt[id])  {   g_restart_attempt[id] = false;   return;  }  event_player_spawn(id) } public event_player_spawn(id) {  client_print(id,print_chat,"Hello Or Whatever");  return 0; }
The Specialist is offline
Send a message via AIM to The Specialist
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 12-28-2006 , 21:30   Re: client_print at player spawn?
Reply With Quote #3

Thanks very much! +karma
hlstriker is offline
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 12-30-2006 , 03:46   Re: client_print at player spawn?
Reply With Quote #4

Uh oh, I found I problem with that. Each time someone types "record <demoname>" in their console, it will display the message. No one is even being spawned? I don't know why it is doing this though.

Does anyone else know why it does this or how to fix it?
hlstriker is offline
Lord_Destros
Veteran Member
Join Date: Jul 2004
Location: With stupid.
Old 12-30-2006 , 04:00   Re: client_print at player spawn?
Reply With Quote #5

Quote:
Originally Posted by The Specialist View Post
Here
Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #define PLUGIN "print spawn" #define VERSION "1.0" #define AUTHOR "The Specialist" #define MAX_PLAYERS  32 new bool:g_restart_attempt[MAX_PLAYERS + 1]; public plugin_init()  {  register_plugin(PLUGIN, VERSION, AUTHOR);  register_event("ResetHUD", "event_hud_reset", "be");  register_clcmd("fullupdate", "clcmd_fullupdate") ;  register_event("TextMsg", "event_restart_attempt", "a", "2=#Game_will_restart_in"); } public clcmd_fullupdate() {  return 1; } public event_restart_attempt() {  new players[32], num;  get_players(players, num, "a");    for (new i; i < num; ++i)  {   g_restart_attempt[players[i]] = true;  } } public event_hud_reset(id) {  if (g_restart_attempt[id])  {   g_restart_attempt[id] = false;   return;  }  event_player_spawn(id) } public event_player_spawn(id) {  client_print(id,print_chat,"Hello Or Whatever");  return 0; }

???

Why do you register a client command and the event TxtMsg?

You should just need this
Code:
#include <amxmodx> #include <amxmisc> #define PLUGIN "print spawn" #define VERSION "1.0" #define AUTHOR "The Specialist" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_event("ResetHUD", "event_hud_reset", "be") } public event_hud_reset(id) {     client_print(id,print_chat,"Zomg hi %s",get_user_name(id)) }
__________________
Quote:
Originally Posted by Twilight Suzuka
Don't worry m'lord. The turtles day will come.
Lord_Destros is offline
Send a message via AIM to Lord_Destros
VEN
Veteran Member
Join Date: Jan 2005
Old 12-30-2006 , 04:03   Re: client_print at player spawn?
Reply With Quote #6

Lord_Destros: He used a snippet from my tutorial, refer to the "Code Snippets / Tutorials" for details.

Quote:
client_print(id,print_chat,"Zomg hi %s",get_user_name(id))
Actually should be something like that:
Quote:
new name[32]
get_user_name(id, name, 31)
client_print(id,print_chat,"Zomg hi %s",name)
hlstriker: You didn't compiled/installed the above script properly.
Refer to the articles for details:
http://wiki.amxmodx.org/index.php/Co...28AMX_Mod_X%29 - compiling plugins
http://wiki.amxmodx.org/index.php/Co...d_X#Installing - installing plugins

Last edited by VEN; 12-30-2006 at 04:07.
VEN is offline
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 12-30-2006 , 13:34   Re: client_print at player spawn?
Reply With Quote #7

Yeah I compiled and installed it correctly, maybe I worded what I said poorly.

The plugin works fine, but I found the message will show not only when you spawn, but ALSO when you type "record <demoname>" in the console. I think when you start recording a demo it resets the hud, which makes the message display when spawned and when you start recording.

My question is how would I block the message from showing when someone types "record <demoname>" in the console. This should ONLY show when a player spawns.
hlstriker is offline
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 12-30-2006 , 14:11   Re: client_print at player spawn?
Reply With Quote #8

Look in the client spawn tutorial.. You will find it is easy to hook a players spawn.
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
Lord_Destros
Veteran Member
Join Date: Jul 2004
Location: With stupid.
Old 12-30-2006 , 14:12   Re: client_print at player spawn?
Reply With Quote #9

Quote:
Originally Posted by VEN View Post
Lord_Destros: He used a snippet from my tutorial, refer to the "Code Snippets / Tutorials" for details.


Actually should be something like that:


hlstriker: You didn't compiled/installed the above script properly.
Refer to the articles for details:
http://wiki.amxmodx.org/index.php/Co...28AMX_Mod_X%29 - compiling plugins
http://wiki.amxmodx.org/index.php/Co...d_X#Installing - installing plugins
Meh, my bad yeah. One of the downsides of posting around midnight .
__________________
Quote:
Originally Posted by Twilight Suzuka
Don't worry m'lord. The turtles day will come.
Lord_Destros is offline
Send a message via AIM to Lord_Destros
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 12-30-2006 , 14:40   Re: client_print at player spawn?
Reply With Quote #10

Quote:
Originally Posted by SweatyBanana View Post
Look in the client spawn tutorial.. You will find it is easy to hook a players spawn.
I've searched around and could not find a spawn tutorial. I found some threads mentioning hooking the spawn function itself, but I don't have a clue how to hook functions. I need to learn that
hlstriker 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 15:14.


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