20.07.2015, 03:20
(
Последний раз редактировалось Abagail; 20.07.2015 в 14:08.
)
This plugin will roughly cover my C++ functions for PAWN plugin and some of it's function. I will try to be as fast and effective as possibly though it's a bit late here so there may be some typos and what not.
You can find the plugin thread here: https://sampforum.blast.hk/showthread.php?tid=582117
The github: https://github.com/Abagail/C-functions-in-PAWN
Functions:
Function explanations:
This simply allows you to change the color of the console. The command itself("color") has a help parameter which will pretty much explain everything about the actual command.
The primary(the first part of the color) specifies the foreground(text color in the console), and the second specifies the background(backdrop of the console)'s color.
Colors:
// 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
This simply allows you to execute a system command on your machine. You can simply define "system" as "systemEx" to make it more like C++,
This simply allows you to get the directory of the server. It sets the "directory" parameter to the directory. This uses the _getcwd function.
Example:
This simply cleans the console using the "CLS" system command.
This function basically does what it says. It copies one string to another destination string(namely the "dest" parameter). This function will overwrite any string already stored in the dest parameter.
This allows you to send any upcoming messages in the specified color(see the colors below the next function).
Allows you to print a singular message in the specified color(colors can be found below).
Colors
NOTE: This colors only apply to the printfEx and setTextColor functions!
UPDATE: All these functions for now simply return 1.
Another note: The primary purpose of this plugin is to add C++ functions otherwise unavailable in the PAWN implementation, though I am also adding cool functions that allow you to simply fuck around or clean things up. If you have any suggestions, I'd be glad to review them and possibly add your suggestion into the plugin.
Final Note: This plugin has been mainly optimized for windows and has not been(atleast not by me) been compiled for linux, yet.
You can find the plugin thread here: https://sampforum.blast.hk/showthread.php?tid=582117
The github: https://github.com/Abagail/C-functions-in-PAWN
Functions:
pawn Код:
native SetConsoleColor(color[]);
native systemEx(cmd[]);
native getDirectory(directory[]);
native cleanConsole();
native strcopy(string[], dest[]);
native printfEx(string[], color);
native setTextColor(color);
pawn Код:
native SetConsoleColor(color[]);
The primary(the first part of the color) specifies the foreground(text color in the console), and the second specifies the background(backdrop of the console)'s color.
Colors:
// 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
pawn Код:
native systemEx(cmd[]);
pawn Код:
#define system systemEx
pawn Код:
native getDirectory(directory[]);
Example:
pawn Код:
new string[128];
getDirectory(string);
printf("The current directory of the server is: %s", string);
pawn Код:
native cleanConsole();
pawn Код:
native strcopy(string[], dest[]);
pawn Код:
native setTextColor(color);
pawn Код:
native printfEx(string[], color);
Colors
NOTE: This colors only apply to the printfEx and setTextColor functions!
Код:
#define CONSOLE_COLOR_DARKBLUE 1 #define CONSOLE_COLOR_DARKDARKGREEN 2 #define CONSOLE_COLOR_DARKTEAL 3 #define CONSOLE_COLOR_DARKRED 4 #define CONSOLE_COLOR_DARKPINK 5 #define CONSOLE_COLOR_DARKYELLOW 6 #define CONSOLE_COLOR_GRAY 7 #define CONSOLE_COLOR_DARKGRAY 8 #define CONSOLE_COLOR_BLUE 9 #define CONSOLE_COLOR_GREEN 10 #define CONSOLE_COLOR_TEAL 11 #define CONSOLE_COLOR_RED 12 #define CONSOLE_COLOR_PINK 13 #define CONSOLE_COLOR_YELLOW 14 #define CONSOLE_COLOR_WHITE 15
Another note: The primary purpose of this plugin is to add C++ functions otherwise unavailable in the PAWN implementation, though I am also adding cool functions that allow you to simply fuck around or clean things up. If you have any suggestions, I'd be glad to review them and possibly add your suggestion into the plugin.
Final Note: This plugin has been mainly optimized for windows and has not been(atleast not by me) been compiled for linux, yet.