Module: ProcessX

Adding Modules to help with scripting/coding plugins.
User avatar
Archive-Poster
Posts: 1209
Gender:
United States of America

Module: ProcessX

Post by Archive-Poster »

ProcessX:

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);
Attachments
ProcessX Source.zip
(35.8 KiB) Downloaded 5 times
ProcessX_SamplePlugin.sma.zip
(1.34 KiB) Downloaded 9 times
ProcessX_amxx.dll.zip
(27.13 KiB) Downloaded 4 times
ProcessX.inc.zip
(964 Bytes) Downloaded 4 times

Who is online

Users browsing this forum: No registered users and 0 guests