Raised This Month: $ Target: $400
 0% 

colorchat embedded


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 09-22-2012 , 15:17   colorchat embedded
Reply With Quote #1

I'm trying to write a plugin with colorchat that you don't have to compile locally.
I tried writing it myself, but to no avail.
Then i tried C/P and the same thing happens.

When i do client_print_color(0 it crashes the server saying "Server Shutting down." I looked in the error logs and there was nothing. My assumption is that its one of the messages being sent improperly and resulting in the crash.

My question toyou....what is the fix?
Other than "just use the include"

P.S. As you can tell from my code I wish to print a red message if stated from a terrorist (this includes CT reader) - this functionality is why i need the colorchat, and not simply use a SayText message; which would print Blue to CT and Red to T when using the team color code.

Attached is what i have so far.
Attached Files
File Type: sma Get Plugin or Get Source (liver_brass.sma - 517 views - 15.3 KB)
__________________
What an elegant solution to a problem that doesn't need solving....
Liverwiz is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-22-2012 , 15:49   Re: colorchat embedded
Reply With Quote #2

All you have to do is copy the contents of the .inc file into the .sma in place of the #include statement. It's that simple.

According to your comment, you edited Connors code. Don't.
__________________

Last edited by fysiks; 09-22-2012 at 15:50.
fysiks is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 09-22-2012 , 16:05   Re: colorchat embedded
Reply With Quote #3

I first attempted to edit connor's code. Then i copy and pasted. Now it is not working.
Both had similar outcomes when trying to print to everyone.
__________________
What an elegant solution to a problem that doesn't need solving....
Liverwiz is offline
f55z55p
BANNED
Join Date: Sep 2012
Old 09-22-2012 , 17:43   Re: colorchat embedded
Reply With Quote #4

Quote:
Originally Posted by fysiks View Post
All you have to do is copy the contents of the .inc file into the .sma in place of the #include statement. It's that simple.

According to your comment, you edited Connors code. Don't.
if you do #include then it automatically add contents of the inc file inside the sma.
f55z55p is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-22-2012 , 18:01   Re: colorchat embedded
Reply With Quote #5

Quote:
Originally Posted by f55z55p View Post
if you do #include then it automatically add contents of the inc file inside the sma.
This response clearly shows that you didn't actually read the request.

Quote:
Originally Posted by Liverwiz View Post
I first attempted to edit connor's code. Then i copy and pasted. Now it is not working.
Both had similar outcomes when trying to print to everyone.
If it works in the include and you do what I say then it will work. Your current code does not reflect what I've suggested.
__________________

Last edited by fysiks; 09-22-2012 at 18:02.
fysiks is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 09-22-2012 , 18:08   Re: colorchat embedded
Reply With Quote #6

Quote:
Originally Posted by f55z55p View Post
if you do #include then it automatically add contents of the inc file inside the sma.
Thank you for that maddeningly irrelevant factoid. That, actually, in most cases, is misleading.
Only stocks of include files are actually added to your amxx on compile from sma. Otherwise it is just a library of how to use natives in other plugins.
But nice try....

Quote:
Originally Posted by fysiks View Post
If it works in the include and you do what I say then it will work. Your current code does not reflect what I've suggested.
O.o wow. I forgot to check the enum values that i re-wrote. Connor's enum doesn't have GREEN in it. -_-
I try again...
__________________
What an elegant solution to a problem that doesn't need solving....

Last edited by Liverwiz; 09-22-2012 at 18:10.
Liverwiz is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-22-2012 , 18:26   Re: colorchat embedded
Reply With Quote #7

Quote:
Originally Posted by Liverwiz View Post
Thank you for that maddeningly irrelevant factoid. That, actually, in most cases, is misleading.
Only stocks of include files are actually added to your amxx on compile from sma. Otherwise it is just a library of how to use natives in other plugins.
But nice try....
His "factoid" is accurate and not misleading. After all includes are inserted into the code (verbatim), the compiler then skips stock functions (regardless of where they were located, in includes or in the main plugin) that remain unused.
__________________
fysiks is offline
f55z55p
BANNED
Join Date: Sep 2012
Old 09-22-2012 , 18:30   Re: colorchat embedded
Reply With Quote #8

Quote:
Originally Posted by Liverwiz View Post
Thank you for that maddeningly irrelevant factoid. That, actually, in most cases, is misleading.
Only stocks of include files are actually added to your amxx on compile from sma. Otherwise it is just a library of how to use natives in other plugins.
But nice try....



O.o wow. I forgot to check the enum values that i re-wrote. Connor's enum doesn't have GREEN in it. -_-
I try again...
are you kidding me?
All functions what you use inside of inc will added into your sma.
If you add example amxmodx.inc then all of it inside will go to your sma.
natives like you see are only functions names inside of the inc, they are actually based on script who created this native, native functions code stay in plugin who created the native.

also you can copy your inside of sma to inc file and just write inside of sma #include thatinc
and its working fine.

If you see that user in allied modders is newbie then that does not meant that he cant script or dont understand anything.

@fysiks my inglish is not so well, im sorry for misunderstanding, i still dont get it.
Edit: fysiks was faster.

Last edited by f55z55p; 09-22-2012 at 18:31.
f55z55p is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 09-22-2012 , 19:39   Re: colorchat embedded
Reply With Quote #9

I always love to get chewed out for being incorrect....
__________________
What an elegant solution to a problem that doesn't need solving....
Liverwiz is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-23-2012 , 02:04   Re: colorchat embedded
Reply With Quote #10

PHP Code:
#define id<%1>        (1 << (%1 % 31))            // This is the bit mask for a user's ID 
??????????????????

Did you meant something like that ?

PHP Code:
#define MaskEnt(%0)    ( 1<<(%0 & 31) ) 

Dunno if <%1> works for macros, anyway it would be better to name it to something else than 'id'
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 09-23-2012 at 02:09.
ConnorMcLeod 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 08:16.


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