AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   colorchat embedded (https://forums.alliedmods.net/showthread.php?t=196551)

Liverwiz 09-22-2012 15:17

colorchat embedded
 
1 Attachment(s)
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.

fysiks 09-22-2012 15:49

Re: colorchat embedded
 
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.

Liverwiz 09-22-2012 16:05

Re: colorchat embedded
 
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.

f55z55p 09-22-2012 17:43

Re: colorchat embedded
 
Quote:

Originally Posted by fysiks (Post 1804166)
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.

fysiks 09-22-2012 18:01

Re: colorchat embedded
 
Quote:

Originally Posted by f55z55p (Post 1804214)
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 (Post 1804174)
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.

Liverwiz 09-22-2012 18:08

Re: colorchat embedded
 
Quote:

Originally Posted by f55z55p (Post 1804214)
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 (Post 1804222)
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...

fysiks 09-22-2012 18:26

Re: colorchat embedded
 
Quote:

Originally Posted by Liverwiz (Post 1804225)
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.

f55z55p 09-22-2012 18:30

Re: colorchat embedded
 
Quote:

Originally Posted by Liverwiz (Post 1804225)
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.

Liverwiz 09-22-2012 19:39

Re: colorchat embedded
 
I always love to get chewed out for being incorrect....

ConnorMcLeod 09-23-2012 02:04

Re: colorchat embedded
 
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'


All times are GMT -4. The time now is 08:16.

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