C-Shoutbox - Ingame Shoutbox. -
Carlton - 16.08.2010
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:
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
Re: C-Shoutbox - Ingame Shoutbox. -
Calgon - 16.08.2010
Nice one, albeit minor and an alternative to the current SA-MP chat field/box.
Re: C-Shoutbox - Ingame Shoutbox. -
KK - 16.08.2010
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.
Re: C-Shoutbox - Ingame Shoutbox. -
Carlton - 16.08.2010
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;
}
Re: C-Shoutbox - Ingame Shoutbox. -
lolumadd - 17.08.2010
Its cool.
Re: C-Shoutbox - Ingame Shoutbox. -
••• ĤБĶБM ••• - 17.08.2010
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.
Re: C-Shoutbox - Ingame Shoutbox. -
MisterTickle - 17.08.2010
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.
Re: C-Shoutbox - Ingame Shoutbox. -
Carlton - 17.08.2010
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.
Re: C-Shoutbox - Ingame Shoutbox. -
Calgon - 17.08.2010
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.
Re: C-Shoutbox - Ingame Shoutbox. -
Carlton - 17.08.2010
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++;
}
?
Re: C-Shoutbox - Ingame Shoutbox. -
Calgon - 17.08.2010
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.