16.01.2012, 18:46 
	(
 Последний раз редактировалось Gh05t_; 01.02.2012 в 23:09.
)
	
	
		Instructions:
1. Download the application.
2. Extract the application to the directory containing the server console (samp-server.exe).
3. Execute the console application.
Downloads:
http://www.sendspace.com/file/22agl0
http://www.mediafire.com/?d3s8zi6b75b2dfi
Source:
	
	
	
	
1. Download the application.
2. Extract the application to the directory containing the server console (samp-server.exe).
3. Execute the console application.
Downloads:
http://www.sendspace.com/file/22agl0
http://www.mediafire.com/?d3s8zi6b75b2dfi
Source:
Код:
#include <iostream>
#include <windows.h>
#include <tlhelp32.h>
int ProcessHANDLE(char *process)
{
    int icount (0); HANDLE hpoint (NULL); PROCESSENTRY32 process2;
    if((hpoint = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0)) == INVALID_HANDLE_VALUE) return -1;
    process2.dwSize=sizeof(PROCESSENTRY32);
    while((Process32Next(hpoint, &process2)) == TRUE) if(stricmp(process2.szExeFile,process) == 0)  ++icount;
    CloseHandle(hpoint);
    return icount;
}
int main(void)
{
    ShellExecute(NULL, NULL, "samp-server", NULL, NULL, SW_SHOWNORMAL);
    std::cout << "console executed..." << std::endl;
    char *ProcessName = "samp-server.exe";
    int ireturn = ProcessHANDLE(ProcessName);
    int iminute (0), isecond (0), ihour (0);
    if(ireturn != -1)
    if(ireturn != 1) return 0; 
    else if(ireturn == 1) do
    {
        Sleep(1000);
        isecond++;
        if(isecond == 60) { iminute++; isecond = 0;}
        if(iminute == 60) { ihour++; iminute = 0; }
        printf("time: %dh, %dm, %ds\n", ihour, iminute, isecond);
        int ireturn2 = ProcessHANDLE(ProcessName);
        if(ireturn2 == 0) 
        { 
              isecond = 0; iminute = 0; ihour = 0;
              std::cout << "console terminated..." << std::endl; 
              ShellExecute(NULL, NULL, "samp-server", NULL, NULL, SW_SHOWNORMAL);
              std::cout << "console executed..." << std::endl; 
       }
    } while (true); 
}




	
. Great job buddy!