[FilterScript] C-Shoutbox - Ingame Shoutbox.
#1

Introduction

Eh, I forgot to release this. This is pretty much what the title says. This is a ingame shoutbox. A shoutbox is pretty much a global chat. Where you can chat with other users, and so on. This is very customizable and easy to use.

Features

  • Ability to customize your shoutbox
  • Easy to use
  • Fun (Well personally it was fun)
  • Chats are logged
Presentation

[ame]http://www.youtube.com/watch?v=28GoBUUtVfA[/ame]

Custom Functions (List)
  • native OnPlayerReadShouts(playerid);
  • native OnPlayerSendShout(playerid, text[]);
  • native ClearShoutBox();
Custom Functions (Example)

pawn Код:
public OnPlayerReadShouts(playerid) {
      new string[128];
      GetPlayerName(playerid, string, 24);
      format(string, 128, "%s is reading the shouts.", string);
      SendClientMessageToAll(MY_COLOR, string);
      return 1;
}
pawn Код:
public OnPlayerSendShout(playerid, text[]) {
      new string[128];
      GetPlayerName(playerid, string, 24);
      format(string, 128, "%s send a message at the shoutbox.", string);
      SendClientMessageToAll(MY_COLOR, string);
      return 1;
}
There's no need for a ClearShoutBox function example, it's self-explanatory.

Customization - C-Shoutbox.pwn

Editing the maximum messages

To edit the maximum messages shown on the shoutbox, edit this line to your desire:

pawn Код:
#define MAX_MESSAGES    (20)
The default was 20 obviously.

Editing the command name

Edit the command in this line below:

pawn Код:
#define SHOUTBOX_CMD "/shoutbox"
Editing the dialog id

To edit the dialog ID so it doesn't inflict with your GM's dialogs edit this line:

pawn Код:
#define DIALOG_CHAT     (99)
Log

The shouts sent by others are stored into Shoutbox.log.

Notes

The shoutbox doesn't auto-refresh when someone sends a shout and you're looking at the shoutbox.

Download

Click me
Reply
#2

Nice one, albeit minor and an alternative to the current SA-MP chat field/box.
Reply
#3

You should make it a dialog instead, where it shows the output from your text in the next dialog so you don't have to do a command to open it again.
Reply
#4

Quote:
Originally Posted by KK
Посмотреть сообщение
You should make it a dialog instead, where it shows the output from your text in the next dialog so you don't have to do a command to open it again.
It is a dialog, if you want it to reshow under OnPlayerSendShout put: ShowShoutBoxForPlayer. Like this:

pawn Код:
public OnPlayerSendShout(playerid, text[]) {
      ShowShoutBoxForPlayer(playerid);
      return 1;
}
Reply
#5

Its cool.
Reply
#6

Everyone is considering and focusing on the normal chat box. I do not see the point of this, but I think this is pretty useful for Staff Meeting.

Al though, staff can also use the main chat box to discuss and chat together. But it's a well-made script. Well done.
Reply
#7

I recommend two things.

1. It expands as their is more text, Instead of it being so long at start
2. When you enter something into the Chatbox it comes back up with updates.
Reply
#8

Quote:
Originally Posted by ••• ĤБĶБM •••
Посмотреть сообщение
Everyone is considering and focusing on the normal chat box. I do not see the point of this, but I think this is pretty useful for Staff Meeting.

Al though, staff can also use the main chat box to discuss and chat together. But it's a well-made script. Well done.
One person isn't everyone.
Reply
#9

http://pastebin.com/yj9eHmks

Untested, I'm half asleep. Whenever someone commits a shout, it now calls ShowShoutBoxForPlayer(x) for all players who have the shoutbox active.
Reply
#10

Quote:
Originally Posted by Calgon
Посмотреть сообщение
http://pastebin.com/yj9eHmks

Untested, I'm half asleep. Whenever someone commits a shout, it now calls ShowShoutBoxForPlayer(x) for all players who have the shoutbox active.
Heh, thanks for the time. Also shouldn't this:

pawn Код:
if(x < MAX_PLAYERS)
    {
        if(IsPlayerConnected(x) && playerShoutBox[x] != 0) ShowShoutBoxForPlayer(x);
        x++;
    }
Be this:

pawn Код:
while(x < MAX_PLAYERS)
    {
        if(IsPlayerConnected(x) && playerShoutBox[x] != 0) ShowShoutBoxForPlayer(x);
        x++;
    }
?
Reply
#11

Quote:
Originally Posted by Carlton
Посмотреть сообщение
Heh, thanks for the time. Also shouldn't this:

pawn Код:
if(x < MAX_PLAYERS)
    {
        if(IsPlayerConnected(x) && playerShoutBox[x] != 0) ShowShoutBoxForPlayer(x);
        x++;
    }
Be this:

pawn Код:
while(x < MAX_PLAYERS)
    {
        if(IsPlayerConnected(x) && playerShoutBox[x] != 0) ShowShoutBoxForPlayer(x);
        x++;
    }
?
Oops, could swear I put that.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)