20.02.2016, 03:57
(
Последний раз редактировалось illuminati2; 23.02.2016 в 08:59.
)
Hello SA-MP Forums, today I gonna release my Advanced Chat include, this include will make you control chat in all ways with just some few call backs and functions. I've added two optional features in it, Flood Protection & Random Color. Gonna explain how to change them below. Firstly you've to type this at the top of your script.
Now you'll be able to use all the includes functions and callbacks on your script. I've made this include in the simplest way so beginners and newbies won't be facing any problems while using it.
Callbacks
Functions
ToggleChat(bool: Toggle);
Description: Allow/Dis Allow players to use the chat feature.
Example:
ClearChat();
Description: Clear the chat like as it was when the server started.
Example:
ToggleChatID(bool: Toggle);
Description: Allow/Dis Allow Showing ID beside the player's name.
Example:
TogglePlayerChat(playerid, bool: Toggle);
Description: Allow a specified player to chat or disallow him to.
Example:
TempPlayerMute(playerid, minutes);
Description: Mute a specified player for the minutes you set.
Example:
SendPlayerMessageInPointToAll(playerid, msg[], Float:distance, Float
, Float:y, Float:z);
Description: Send a auto message from a player in a specified point to everyone.
Example:
I found it useful so I added it.
Settings
Example (Simple, Not Including All Finctions!)
Pastebin Link
http://pastebin.com/13sHNQc7
This is a BETA version, if you found any bugs feel free to PM me or post it in here!
PHP код:
#include <AdvancedChat>
Callbacks
PHP код:
forward OnChatInit();
forward OnChatEnabled();
forward OnChatDisabled();
forward OnPlayerMuted(playerid);
forward OnPlayerUnMuted(playerid);
PHP код:
ToggleChat(bool: Toggle);
ClearChat();
ToggleChatID(bool: Toggle);
TogglePlayerChat(playerid, bool: Toggle);
TempPlayerMute(playerid, minutes);
SendPlayerMessageInPointToAll(playerid, msg[], distance, Float:x, Float:y, Float:z);
Description: Allow/Dis Allow players to use the chat feature.
Example:
PHP код:
ToggleChat(true); // this will allow players to use chat.
//Put this somewhere
Description: Clear the chat like as it was when the server started.
Example:
PHP код:
ClearChat(); // This will clear the chat.
//Put this somewhere
Description: Allow/Dis Allow Showing ID beside the player's name.
Example:
PHP код:
ToggleChatID(true); // this will allow showing ID beside player's name.
//Put this somewhere
Description: Allow a specified player to chat or disallow him to.
Example:
PHP код:
TogglePlayerChat(playerid, false); // This will make the player not able to chat.
//Put this somewhere in a command
Description: Mute a specified player for the minutes you set.
Example:
PHP код:
TempPlayerMute(playerid, 2); // This will mute the player for 2 minutes.
//Put this somewhere in a command

Description: Send a auto message from a player in a specified point to everyone.
Example:
PHP код:
SendPlayerMessageInPointToAll(playerid, "Hello, I'm in 0.0, 0.0, 0.0 Coordinates!", 5, 0.0, 0.0, 0.0);
//Put this somewhere in a command
Settings
PHP код:
#define RandColor // Comment This line if you want to disable the random colors.
#define FloodProtection 1 //Set it to 0 if you want to disable the anti Flood.
#define MAX_CHAT_LENGHT 128 //Max chat lenght that will appear (More words won't be seen)
PHP код:
#include <a_samp>
#include <AdvancedChat>
#include <zcmd>
public OnGameModeInit()
{
ToggleChat(true); // This will allow players to chat, set it to false if you
//don't want to use chat.
ToggleChatID(true); // This will allow players to chat with their ID beside
//their name.
return 1;
}
CMD:muteme(playerid, params[])
{
TogglePlayerChat(playerid, false); // Now the player won't be able to chat.
return 1;
}
CMD:unmuteme(playerid, params[])
{
TogglePlayerChat(playerid, true); // Now the player will be able to chat.
return 1;
}
http://pastebin.com/13sHNQc7
This is a BETA version, if you found any bugs feel free to PM me or post it in here!