18.07.2015, 01:17
(
Последний раз редактировалось Abagail; 22.11.2015 в 21:14.
)
This is a very simple plugin I made within around 15-30 minutes. It basically allows you to change the color of your console & execute commands via system. I have only compiled the plugin for windows, but if someone wants to make it work for linux that'd be cool aswell.
As of the second version(the version that starts on github; it's more of a C++ functions for PAWN than a plugin allowing you to execute system commands and change the color of the console: I have already started adding some more cool functions.
Example:
![](http://i.imgur.com/dLNzeEf.png)
The plugin itself contains around 7 functions:
Natives:
SetConsoleColor - Allows you to change the color of the console(through "color" in the system function).
systemEx - Allows you to execute a raw system function.
getDirectory - Allows you to get the directory samp-server is running in.
cleanConsole - Clears the console box.
printfEx - Allows you to print text in a specific color.
Installation:
Plugin:
1. Upload the "color.dll" file to your plugins folder.
2. Open server.cfg and add "color(or color.dll)" to the plugins line(create the line if not already there).
Include:
1. Upload the "color.inc" file to your pawno/includes folder.
2. Include "color.inc" in your script.
Example Script:
Colors:
HINT: You can simply put "HELP" in the color parameter to view help regarding the "color" command. The same applies when an invalid color is entered.
0 = Black
1 = Blue
2 = Green
3 = Aqua
4 = Red
5 = Purple
6 = Yellow
7 = White
8 = Gray
9 = Light Blue
A = Light Green
B = Light Aqua
C = Light Red
D = Light Purple
E = Light Yellow
F = Bright White
Bugs / Issues:
None have been reported.
Download:
Pre-compiled plugin for windows & include
Source
Github(Source + Pre-compiled plugin for windows)
As of the second version(the version that starts on github; it's more of a C++ functions for PAWN than a plugin allowing you to execute system commands and change the color of the console: I have already started adding some more cool functions.
Example:
![](http://i.imgur.com/dLNzeEf.png)
The plugin itself contains around 7 functions:
pawn Код:
native SetConsoleColor(color[]);
native systemEx(cmd[]);
native getDirectory(directory[]);
native cleanConsole();
native printfEx(string[], color);
native setTextColor(color);
SetConsoleColor - Allows you to change the color of the console(through "color" in the system function).
systemEx - Allows you to execute a raw system function.
getDirectory - Allows you to get the directory samp-server is running in.
cleanConsole - Clears the console box.
printfEx - Allows you to print text in a specific color.
Installation:
Plugin:
1. Upload the "color.dll" file to your plugins folder.
2. Open server.cfg and add "color(or color.dll)" to the plugins line(create the line if not already there).
Include:
1. Upload the "color.inc" file to your pawno/includes folder.
2. Include "color.inc" in your script.
Example Script:
pawn Код:
#include <a_samp>
#include <color>
#include <sscanf2>
public OnRconCommand(cmd[])
{
new operation[24], color[24];
if(!sscanf(cmd, "s[24]s[24]", operation, color))
{
if(strcmp(operation, "color", true) == 0)
{
SetConsoleColor(color);
}
else if(strcmp(operation, "cmd", true) == 0)
{
systemEx(color);
}
}
return 1;
}
HINT: You can simply put "HELP" in the color parameter to view help regarding the "color" command. The same applies when an invalid color is entered.
0 = Black
1 = Blue
2 = Green
3 = Aqua
4 = Red
5 = Purple
6 = Yellow
7 = White
8 = Gray
9 = Light Blue
A = Light Green
B = Light Aqua
C = Light Red
D = Light Purple
E = Light Yellow
F = Bright White
Bugs / Issues:
None have been reported.
Download:
Pre-compiled plugin for windows & include
Source
Github(Source + Pre-compiled plugin for windows)