PDA

View Full Version : [FilterScript] [FS]Second Chatbox!! =>Version 1.0<=


Sandra18[NL]
30/03/2008, 01:26 AM
Second Chatbox!!


What is it:

This filterscript creates a total new chatbox in the bottom-right corner of the screen.
The chatbox will use 15 or 30 textdraws. (depending on the line-mode you're using)
Messages will scoll from down to top.


What's wrong with the normal one? :s

Basically nothing, but sometimes it's annoying when you want to view for example a /command pages
Such command sometimes takes up all 10 lines in the normal chat, and when someone else is typing a message, you already lost the first line :s
So this filterscript prevent players from chatting in the normal chat, and instead their messages will be shown in this new chatbox.
For some people it's very useless, but it may be usefull for some (busy) servers.

There are 2 diffrent modes:

Single-lines
Double-lines


I recomment you to use the Double-line-mode:
Why? Because it allows you to type much longer messsages:
With Single-line mode your messages can not be longer than about 30 characters.
With Double lines, messages can be around 90 characters long.
Only with singlelines, 30 messages will be shown, doublelines (only) 15 (normal chat has 10 lines).

If a player connects, he/she can see the last 15 or 30 messages!


How to instal:

Download Chatbox.pwn
Place it in your 'filterscripts' folder
Open it, optionally you can comment or delete the line "#define AllowDoubleLines"
Compile it, run it as filterscript and you're ready to chat!


Commands:

/clearchat (rcon admin only)


Screenshots:

Double-Line-Mode:
http://img413.imageshack.us/img413/7469/samp171df9.th.jpg (http://img413.imageshack.us/my.php?image=samp171df9.jpg)

Single-Line-Mode:
http://img150.imageshack.us/img150/6735/samp172ss3.th.jpg (http://img150.imageshack.us/my.php?image=samp172ss3.jpg)

http://img244.imageshack.us/img244/6318/samp173uu8.jpg


Download:

- Chatbox.pwn (MediaFire) (http://www.mediafire.com/?9kjcmz2gcjj)
- Chatbox.pwn (MyFreeFilehosting.com) (http://myfreefilehosting.com/f/7602a15a59_0.01MB)

Known Bugs:
- When you restart your gamemode (with gmx) you may crash
- When you type after a messages 2 (or more) spaces, the message will not be shows :s
I fixed 1 space, but more are still buged.
If someone knows how fix this, help would be appreciated

Notes:

- This is the very first release, had not very much time to test with multiple players so there may be more bugs
- I think i will release a new version soon, including more configuration.
- The small lettersize of the messages may be problematic for some users with bad eyes, you can eventually change the lettersize in the filterscript by yourself. (Search for: "TextDrawLetterSize(Message[line], 0.20, 0.70);" (2x)

- I hope you will like this Filterscript, and if you're going to use this: PLEASE GIVE ME CREDITS!!!!
- I also would like to receive comments about this Filterscript. ;)

=>Sandra<=

Killerkid
30/03/2008, 01:38 AM
Very good, but you may want to remove ~n~ because it mess's up the chat .

ZeRo_Ldds
30/03/2008, 01:39 AM
Very nice good work!!! xD

GenerationX
30/03/2008, 01:46 AM
How can you do a like,

SendClientMessage(playerid,COLOR_BLUE,"You are Getting Hijacked Idiot");


How can you make any function Run in that Chat box :S

Killerkid
30/03/2008, 02:01 AM
SendChatMessage(playerid, "You are Getting Hijacked Idiot");
Do that.

Sandra18[NL]
30/03/2008, 02:06 AM
How can you do a like,
SendClientMessage(playerid,COLOR_BLUE,"You are Getting Hijacked Idiot");
How can you make any function Run in that Chat box :S


Uhh, i made this Filterscript to prevent such messages in the chat! :roll:

You can still use the normal chat,
but if you really really want it, use:
SendChatMessage(-1, "~b~You are Getting Hijacked Idiot");
But everybody will see that message.

You can use this function only inside this filterscript.
But if you're an experienced scripter, you can implement this filterscript in your own gamemode.
But im not going to explain.


Very good, but you may want to remove ~n~ because it mess's up the chat .

No possible yet, this fs has 15 diffrent textdraws, and each has it's own permanent position.
So if you're using double-lines mode and youre not typing 2 lines, it's inevitable to have space (~n~-like) between 2 lines. :s
Maybe i find a solution to this problem, till than.... :(


Very nice good work!!! xD

Thanks :D

FarePak
30/03/2008, 02:18 AM
What key do you press to talk in that chat...?
Is it the same? pressing the key "T" to have the chat box thing come up?

Sandra18[NL]
30/03/2008, 02:39 AM
What key do you press to talk in that chat...?
Is it the same? pressing the key "T" to have the chat box thing come up?


Yes, it's exactly like normal chatting, but now your message will not appear in normal chat, but in the second chat.


OMFG WOOOOOOOOOHOOOOOOOOO nice sandra!! :D

PS: why did you blank some of the text in the chatbox? :P

Well, it contained some private info :P

[BG]MR.C
30/03/2008, 02:47 AM
very cool will definitely try this out
thanks :)

sebihunter
30/03/2008, 06:34 AM
WOW! Really nice, maybe I gonna use it

Harry_Gaill
30/03/2008, 08:03 AM
Second Chatbox!!


Known Bugs:
- When you restart your gamemode (with gmx) you may crash
- When you type after a messages 2 (or more) spaces, the message will not be shows :s
I fixed 1 space, but more are still buged.
If someone knows how fix this, help would be appreciated



Well done, nice work. As for the highlighted part (effect that the server may crash on executing gmx), have you tried destroying textdraw on disconnecting yet? There was a sa-mp bug I believe, it might be that.

ps.: I haven't checked the source yet.

Edit: I just did, well try destroying the text draw under OnPlayerDisconnect. And/ or make a command which 1.) destroys text draw for everyone, 2.) calls GameModeExit();

[LDT]LuxurY
30/03/2008, 08:55 AM
wow. nice one! :P

Dark_Kostas
30/03/2008, 09:27 AM
PERFECT Idea.NICE :lol: :o :D ;) :) :P 8) :mrgreen: I want more happy emoticons.

aroma
30/03/2008, 10:44 AM
How can i delete some lines like 2 or 3 so it doesnt cross the line with my death icons ???

Rks25
30/03/2008, 11:02 AM
How can i delete some lines like 2 or 3 so it doesnt cross the line with my death icons ???


Yes, i also tested it, it crosses the death icons :D
And bummer of the bugs, i would i could fix it, but i can't :), cuz i tried some things which seemed me good, but didn't work out as it should be, but still i will try my best to do so!

aroma
30/03/2008, 12:31 PM
And mute wont work anymore ;)

P1nd3r
30/03/2008, 12:36 PM
OMFG!! Sandra ownz all. :D

g@k
30/03/2008, 01:53 PM
sandra you roxx, all your script are nice , i lov u :-[

Xzamer
28/04/2008, 02:17 PM
This doenst work for me :(
1.I have downloaded the PWN File
2.I opened it and deleted the text#define AllowDoubleLines
3.I opened Server.cfg and wrote in filterscripts: chatbox
4.Yes I have the PWN File in the Filterscripts
But when I start samp-server.exe it says: Loading filter script 'chatbox.amx'...
Unable to load filter script 'chatbox.amx'.
Loaded 2 filter scripts Please help me ;) BTW Sorry for my bad english

Rks25
28/04/2008, 02:19 PM
Would love it, if someone could help try to solve the bugs, i tried, didn't succeed!

Rksss

JaTochNietDan
28/04/2008, 02:28 PM
Sanda, I love you.

Aerobalance
28/04/2008, 02:29 PM
Sanda, I love you.


LOL
OMFG SO AWESOME I NEVER REALLY SPEAK IN CAPS! WOW THIS IS SO COOL! WOOT WOOT WOOT WOOT WOOT

JaTochNietDan
28/04/2008, 02:32 PM
Seriously...she makes fucking amazing scripts.

Rks25
28/04/2008, 02:33 PM
Seriously...she makes fucking amazing scripts.

Agree.

Aerobalance
28/04/2008, 02:34 PM
Seriously...she makes fucking amazing scripts.

Agree.


agree +2

ThePro
28/04/2008, 02:37 PM
agree +3

Rks25
28/04/2008, 02:40 PM
Does someone know to do solve bugs?

JaTochNietDan
28/04/2008, 02:43 PM
Does someone know to do solve bugs?

hmmm


Known Bugs:
- When you restart your gamemode (with gmx) you may crash

Hide, then Destroy the TextDraws OnFilterScriptExit

Relax
28/04/2008, 02:53 PM
oh very nice! tnx ;)

Rks25
28/04/2008, 02:54 PM
Known bugs:
-When you type after a messages 2 (or more) spaces, the message will not be shows
I fixed 1 space, but more are still buged.
If someone knows how fix this, help would be appreciated

JaTochNietDan
28/04/2008, 02:55 PM
Known bugs:
-When you type after a messages 2 (or more) spaces, the message will not be shows
I fixed 1 space, but more are still buged.
If someone knows how fix this, help would be appreciated

Don't know :s

Rks25
28/04/2008, 02:57 PM
Hide, then Destroy the TextDraws OnFilterScriptExit
Can you make 2 loops for this (hide and destro),
cuz in my gm i got 7 textdraws.

Maikel
28/04/2008, 03:38 PM
Elements ]


Seriously...she makes fucking amazing scripts.

Agree.


agree +2


Agree +3, Sandra, i want to give a mirror, but the web server is down.

Bpb
29/04/2008, 11:51 AM
not for russians :\

good for script messages, but not for chat

Zh3r0
29/04/2008, 02:54 PM
Hahahaaaaaaa.....I love it !@@!

tom_jonez
01/06/2008, 10:13 PM
Wow. This is amazing.

Im not using but it looks great.

Very good job Sandra!

Wash
02/06/2008, 04:10 AM
This is cool! Very useful for servers with many players.

Is there a spam protection and a max. message length protection?

Sandra18[NL]
02/06/2008, 09:14 AM
Wow. This is amazing.

Im not using but it looks great.

Very good job Sandra!


Thanks


This is cool! Very useful for servers with many players.

Is there a spam protection and a max. message length protection?


- Spam protection: No
- Max Message length protection: Yes

Wash
02/06/2008, 03:28 PM
Well Sandra I suggest you add a function that checks the previous length of a message, if it's the same then reject it because most spammers just use UP -> ENTER all the time.

SooNy_007
04/06/2008, 06:26 PM
Well done Sandra script I like very :mrgreen:

PiCtuRe
05/06/2008, 09:36 AM
nice one!

Homerman
05/06/2008, 11:08 AM
Yeah, very very very nice script!

pspleo
05/06/2008, 11:36 AM
holy shit this is nice 10/10


Elements ]


Seriously...she makes fucking amazing scripts.

Agree.


agree +2


Agree +3, Sandra, i want to give a mirror, but the web server is down.

Agrree +10 :o

SaW
05/06/2008, 12:33 PM
Awesome! How can you make good scripts like this? :P

Starting to use this on my server.

Sandra18[NL]
05/06/2008, 01:56 PM
Awesome! How can you make good scripts like this? :P


Well:

Having enough time
Having experience
You have to like learning things
Reading other scripts and learn from it
Don't give up if something doesn't work
If you want some function in your gamemode/filterscript, first try to make it yourself instead of always asking other people to make it for you.
Use the wiki
Release some of your work, let others give comments positive AND negative!! And learn from those negative comments.

Slash991
12/06/2008, 11:53 AM
2 things

1. how to decrease the number of lines shown??? (15 are too much for me)
2. can i encrease the text dimension?

Rks25
13/06/2008, 10:34 AM
ARe the bugs solved of this? Cuz i am getting sick of the sendclientmessages flood :P

edygangsta
15/06/2008, 06:12 AM
Really nice work =Sandra= ;) i will test it on my server >:D

Antironix
23/06/2008, 11:25 AM
I am using this FS now, I've implented it in my GM. Thanks for making this, I am to lazy :D

zthunderz
22/08/2008, 02:22 AM
nicee nice nice bug !gang like and problem spam 3 max 5 sec

martin149
23/08/2008, 09:05 PM
if(strcmp(text[len-1], " ", true)==0)

why " " ???

Leopard
23/08/2008, 09:06 PM
there is a not good bug... do ~n and everyone crash

NEW_IE
21/09/2008, 09:16 PM
Can it be modded so that only Police Members Can Use

HB
11/10/2008, 01:32 PM
Fixied.

Amit
11/10/2008, 08:39 PM
Very nice chat, good work :D

Only problem is if someone types "~t" without another "~" everyone crashes :!:

Jonte
12/10/2008, 10:59 AM
Nice!! ;)
But if i delet "#define AllowDoubleLines" i get an error.




C:\Users\sehlin\Desktop\sa-mp server\filterscripts\Chatbox.pwn(257) : error 017: undefined symbol "ID"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


1 Error.


Why?? :'(
I have try to fix it but i cant!! >:(

ReFuSeR
31/10/2008, 06:29 AM
Nice filterscript, I really don't see the use because we have a chatbox at the top already :( be I thought a little. I can use this in my admin script. do you mine???? The report system. all player reports goto that box. xD

SA_FAN
06/11/2008, 03:25 PM
I have a problem:
How can i write on it? the key " T " write on the standard chatbox. -.-
but looks nice =)

kingdutch
25/03/2009, 08:33 PM
Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Yeh whatever I'm just going to give feedback in case you want to fix those bugs :D

How did you solve the 1 space at the end?
Did you try putting that in a (for/while) loop to just go as long as there's a space on the end and remove it?

And for the whitespace line, I don't know how your positioning works, I hope you do it in a loop and not all static, always use the 1 line positioning. Then check the line lenght of the last text input, if it's more than you can handle on one line skip a line else just post it. Only problem is I think you'll have to iterate backwards starting at the bottom. So you have to reverse this process.
-----------------------------------------------
Starting at the bottom:
Check the last line, if it's bigger than 1 line, start at line 2 (Counting from bottom as 1) then just check if the next is 1 or two lines, if it's one line, write it out, if it's more than 1, just skip one line up and place it.
-----------------------------------------------------------

Hope I'm clear, I always get ideas while writing forum posts and I try to just write those out two, sometimes makes my posts messy.
Anyway, in theory this should allow for even bigger than 2 line texts
lines = roundUp(lineLength / maxLengthPerLine);
And just dump the message
if (lines > MaxLinesPerMSG);
Or cut it short if you want to be nice.


Hope I helped, seems to be a nice filterscript, I don't really like the placement though, I'd much rather just have a bigger chatbox in the upper left corner :D

Serbish
25/03/2009, 08:49 PM
Nice Chatbox...

TraNe15
26/09/2009, 09:43 PM
Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

OMG! 120 days.. Fs will be fossil xD

Ok ok my question is:
How can i erase lines.. i need just 3 lines

DokerJr
28/09/2009, 05:08 PM
Sandra ;)

Nice ChatBox :D
Good Work

coco
04/12/2009, 06:53 PM
Good Job :D

_Gangster_
04/12/2009, 08:52 PM
nice... tnx =]

Karkanos
05/01/2010, 12:45 AM
awesome

pierhs
05/01/2010, 10:04 AM
Nice

deniel95
10/04/2010, 06:15 PM
Hay can somebary tellmy how to setup to i need enter /o then txt Example /o MyTxT=/O Hay


???Plzz can somebary tellmy FAST???

deniel95
10/04/2010, 09:18 PM
anyone!?

Nemesys1995
28/07/2010, 09:18 PM
Hi!
I would like to ask such that he could be -this one like that accross to make shaping that when they join or they leave the new chatboxba writes it about the server then? IMPORTANT!
Greet too!

Excuse me for the bad correct writing! I am not English. :(

Mimic
28/07/2010, 09:22 PM
Nice Idea, looking forward to seeing the udpated versions

Hijolion
29/07/2010, 01:27 AM
WOW!! Nice, I thought of something like this but just happened to happen.

Mr187
29/07/2010, 05:33 AM
Nice Idea, looking forward to seeing the udpated versions
I don't believe he/she plans to update it, And its not really a "nice idea" that many text draws doing that kinda stuff on a server with 40-50 players is gonna be massive CPU usage.

Ninoslav
29/07/2010, 11:59 AM
WOW, this is very good! Brawo Sandra! :D

Nemesys1995
29/07/2010, 05:27 PM
But then, how could turn up to make? Be kind and help me because this does not hit me somehow. :(
I say thank you for your remarks until now!

Bull_BoY
06/11/2010, 05:54 AM
NIce u r gr8...

Forbidden
02/06/2011, 07:57 PM
Great work , this is cool

Phanto90
02/06/2011, 08:11 PM
30/03/2008
Bumping D: :picard:
And you can use colors in 0.3c normal chat, this topic was created before 0.3c version and has no use since then

Rob_Zero
03/06/2011, 09:44 AM
gonna use this

Dylan_Madigan69
19/03/2013, 12:05 AM
I have an idea for a 1.1. Make a cupple defines at the top for Dynamic colors or all one color, font style, and font size.