Raised This Month: $ Target: $400
 0% 

Module: ProcessX


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 03-07-2009 , 15:33   Module: ProcessX
Reply With Quote #1

All I am here to do is to post the modules to the people who want them.
Uptades/New modules/Request can be found at DivinityX.no-ip.org/forum.
Don't bother visiting at this point. Divinity doesn't have any new modules nor any updates unless requested.
I am not Divinity, don't ban me.

This module is pretty powerful. It can cause just as much damage ( if used incorrectly ) as it can create freedom. Only the plugin creator can decide what these plugins will do. DivinityX creates no limitations.
If you use this incorrectly, to harm the server in any way or exploiting/accessing things you should not have access to you are most likely to get banned by your server provider, if not worse... ( Sued for example )
NEVER use a plugin with missing source code that requires this module to run.
DivinityX takes NO responsibility.

With that said, here you go:



ProcessX:
PHP Code:
#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(ProcessIDName[], len);
/* Gets the path and filename of the process.

* Returns 1 on success. Otherwise 0.

*/
native GetProcessFilename(ProcessIDFilename[], 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(ProcessIDPriority); 
Attached Files
File Type: inc ProcessX.inc (1.9 KB, 341 views)
File Type: zip ProcessX Source.zip (35.8 KB, 240 views)
File Type: dll ProcessX_amxx.dll (52.5 KB, 311 views)
File Type: sma Get Plugin or Get Source (SamplePlugin.sma - 1057 views - 3.0 KB)

Last edited by [ --<-@ ] Black Rose; 03-28-2009 at 07:47.
[ --<-@ ] Black Rose is offline
culd
Member
Join Date: Aug 2009
Old 09-25-2009 , 15:39   Re: Module: ProcessX
Reply With Quote #2

How Could you list all processes by name and id?
culd is offline
MadwiX
Junior Member
Join Date: Jan 2012
Old 01-13-2013 , 20:02   Re: Module: ProcessX
Reply With Quote #3

How would I set process of the server executing the plugin on high with this?
MadwiX is offline
Menethil
Senior Member
Join Date: Aug 2011
Old 01-14-2013 , 08:32   Re: Module: ProcessX
Reply With Quote #4

PHP Code:
#include <amxmodx>
#include <ProcessX>
#include <ExecuteX>


#if defined _ProcessX_included
new ServerPID;
#endif


public plugin_init() {

    
ServerPID GetServerProcessID()

    if ( 
GetProcessPriority(ServerPID) != PRI_HIGH )
        
SetProcessPriority(ServerPIDPRI_HIGH)


Last edited by Menethil; 01-14-2013 at 08:32.
Menethil is offline
MadwiX
Junior Member
Join Date: Jan 2012
Old 01-14-2013 , 21:27   Re: Module: ProcessX
Reply With Quote #5

Is there any chance for a linux version of this?
MadwiX is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:48.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode