Code: Select all
#if defined _ProcessX_included
#endinput
#endif
#define _ProcessX_included
/* Gets Process ID of the calling HL server.
*
* Returns ProcessID.
*
*/
native GetServerProcessID();
/* Checks if a process is running.
*
* Returns 1 if the process is open or 0 if it isn't.
*
*/
native IsProcessOpen(ProcessID);
/* Closes a process.
*
* Returns 1 on success. Otherwise 0.
*
*/
native CloseProcess(ProcessID);
/* Finds a process by its name.
*
* If pos is specified function will not return any process with the ProcessID lower than pos.
* Returns 1 on success. Otherwise 0.
*
*/
native FindProcessByName(const ProcessName[], pos = 0);
/* Gets the name of a process.
*
* Returns 1 on success. Otherwise 0.
*
*/
native GetProcessName(ProcessID, Name[], len);
/* Gets the path and filename of the process.
*
* Returns 1 on success. Otherwise 0.
*
*/
native GetProcessFilename(ProcessID, Filename[], len);
#define PRI_IDLE 0 // Not recommended. Runs when system is idle, comparable to a screensaver.
#define PRI_BELOWNORMAL 1
#define PRI_NORMAL 2
#define PRI_ABOVENORMAL 3
#define PRI_HIGH 4
#define PRI_REALTIME 5 // Not recomended, may cause system instability.
stock TABLE_PRIORITY[][] = {
"Idle",
"Below Normal",
"Normal",
"Above Normal",
"High",
"Realtime"
};
/* Converts a priority class number into a string.
*
* num
* Priority class num.
* Returned by GetProcessPriority.
*
*/
#define /**/ sPriority(%0) TABLE_PRIORITY[%0]
/*The comment signs was only used to colour the function in PAWN studio.*/
/* Gets the current priority class of a process.
*
* Returns a value between 0 and 7.
* 0 = Failure.
* 1-6 = Different priority classes.
* 7 = Unknown.
*
*/
native GetProcessPriority(ProcessID);
/* Sets the priority class of a process.
*
* Returns 1 on success. Otherwise 0.
*
*/
native SetProcessPriority(ProcessID, Priority);