View Single Post
Caypen
New Member
Join Date: Nov 2017
Old 11-19-2017 , 11:13   Re: Plugin work by time
Reply With Quote #3

Quote:
Originally Posted by xFlane View Post
this method is not really protecting something because changing the server time will bypass it,
but anyway.

PHP Code:
UsagecheckForTimeLicense( { 29112017 }, "The plugin is no longer valid." ); // Plugin is valid until the 29/11/2017. ( inside OnPluginStart ). 
PHP Code:
stock void checkForTimeLicense(int[] time, const char[] Error)
{
    
int timeNum GetTime();
    
char times[3][5]; 
    
    
FormatTime(times[0], 5"%d"timeNum); // day
    
FormatTime(times[1], 5"%m"timeNum); // month
    
FormatTime(times[2], 5"%Y"timeNum); // year
    
    
int timesf time[0] + time[1] * 30 time[2] * 365;
    
timeNum StringToInt(times[0]) + StringToInt(times[1]) * 30 StringToInt(times[2]) * 365;
    
    if( 
timesf timeNum )
    {
        
SetFailState(Error);
    }

Thanks for the example, did a little differently. I made an active binding to the database, the plugin is attached to the kernel, the kernel sends a request for the validity of the date, if the date is not valid, cancels the launch
Caypen is offline