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

TutorMSG


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
#8 SickneSS
BANNED
Join Date: Sep 2008
Location: Here
Old 02-07-2011 , 09:21   TutorMSG
Reply With Quote #1

Well,I need some help with this...Look,I've hooked the first spawn of a player and show a msg,but some players can't see the message inside the tutor.Why is this?

Code...

Code:
#include <amxmodx> #include <hamsandwich> /* Pragma */ #pragma semicolon 1 /* Definition */ #define TASK_TUTOR  1337 /* Messages */ new TutorStart; new TutorEnd; /* Colors */ enum {     RED = 1,     GREEN,     BLUE,     YELLOW }; /* Boolean */ new bool:FirstSpawn[33]; public plugin_init() {     /* Plugin Registration */     register_plugin("Welcome MSG","0.0.1","#8 SickneSS");         /* Ham Registration */     RegisterHam(Ham_Spawn,"player","HamSpawnPlayer",1); } public plugin_cfg() {     /* Messages */     TutorStart = get_user_msgid("TutorText");     TutorEnd = get_user_msgid("TutorClose"); } public client_putinserver(id) FirstSpawn[id] = true; public HamSpawnPlayer(id) {     if(FirstSpawn[id])     {         message_begin(MSG_ONE_UNRELIABLE,TutorStart,_,id);         write_string("Welcome dude! :3");         write_byte(0);         write_short(0);         write_short(0);         write_short(1<<RED);         message_end();                 FirstSpawn[id] = false;         set_task(10.0,"cmdRemoveTutor",id+TASK_TUTOR);     } } public cmdRemoveTutor(id) {     id -= TASK_TUTOR;         message_begin(MSG_ALL,TutorEnd,_,id);     message_end(); }         public client_disconnect(id) {     if(FirstSpawn[id] || task_exists(id+TASK_TUTOR))     {         FirstSpawn[id] = false;         remove_task(id+TASK_TUTOR);     } }

Last edited by #8 SickneSS; 02-07-2011 at 11:07.
#8 SickneSS is offline
Send a message via MSN to #8 SickneSS Send a message via Skype™ to #8 SickneSS
Destro-
Veteran Member
Join Date: Jun 2010
Location: $me->location();
Old 02-07-2011 , 09:42   Re: TutorMSG
Reply With Quote #2

In your native language:
http://www.amxmodx-es.org/forums/tema-INC-message-tutor

pd:This broke the .res of player.

pd2:sorry for my English .
__________________
Destro- is offline
#8 SickneSS
BANNED
Join Date: Sep 2008
Location: Here
Old 02-07-2011 , 10:56   Re: TutorMSG
Reply With Quote #3

It's necessary to use the include? I made the same with this method,and I don't know why is not working. :/
#8 SickneSS is offline
Send a message via MSN to #8 SickneSS Send a message via Skype™ to #8 SickneSS
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 02-07-2011 , 10:57   Re: TutorMSG
Reply With Quote #4

Quote:
Originally Posted by #8 SickneSS View Post
It's necessary to use the include? I made the same with this method,and I don't know why is not working. :/
Are you trying this on CS 1.6?
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
#8 SickneSS
BANNED
Join Date: Sep 2008
Location: Here
Old 02-07-2011 , 11:01   Re: TutorMSG
Reply With Quote #5

Quote:
Originally Posted by meTaLiCroSS View Post
Are you trying this on CS 1.6?
nope
#8 SickneSS is offline
Send a message via MSN to #8 SickneSS Send a message via Skype™ to #8 SickneSS
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-07-2011 , 11:03   Re: TutorMSG
Reply With Quote #6

Are you sure about your "FirstSpawn" thing ? I would hook Ham_Spawn as post + is_user_alive().
__________________
Arkshine is offline
#8 SickneSS
BANNED
Join Date: Sep 2008
Location: Here
Old 02-07-2011 , 11:07   Re: TutorMSG
Reply With Quote #7

Quote:
Originally Posted by Arkshine View Post
Are you sure about your "FirstSpawn" thing ? I would hook Ham_Spawn as post + is_user_alive().
It works for me.
#8 SickneSS is offline
Send a message via MSN to #8 SickneSS Send a message via Skype™ to #8 SickneSS
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-07-2011 , 11:11   Re: TutorMSG
Reply With Quote #8

You still need to check if the user is alive before checking FirstSpawn[id].
__________________
fysiks is offline
#8 SickneSS
BANNED
Join Date: Sep 2008
Location: Here
Old 02-07-2011 , 11:17   Re: TutorMSG
Reply With Quote #9

Quote:
Originally Posted by fysiks View Post
You still need to check if the user is alive before checking FirstSpawn[id].
Ok I'll try.
#8 SickneSS is offline
Send a message via MSN to #8 SickneSS Send a message via Skype™ to #8 SickneSS
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 21:36.


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