Ok, I found a mistake in your code. You used if a lot of times without end statement. You should use elseif.
LUA:
function fResult ( sResult )
outputChatBox ( '#FF8800[TOPTIMES] #FF6565Fetching data... ', root, 255, 255, 255, true )
if ( sResult ) then
if ( sResult == 'ua' ) then
outputChatBox ( '#FF8800[TOPTIMES] #FF6565Your license is not valid! Please, contact GTX#!', root, 255, 255, 255, true )
elseif ( sResult == '1' ) then
outputChatBox ( '#FF8800[TOPTIMES] #FF6565Data fetched! Welcome!', root, 255, 255, 255, true )
elseif ( sResult == '0' ) then
outputChatBox ( '#FF8800[TOPTIMES] #FF6565Terminating script...', root, 255, 255, 255, true )
outputChatBox ( '#FF8800[TOPTIMES] #FF6565STEALERS ARE NOT WELCOME!', root, 255, 255, 255, true )
outputChatBox ( '#FF8800[TOPTIMES] #FF6565PLEASE, RE-LICENSE THIS BY ASKING GTX#!', root, 255, 255, 255, true )
stopResource ( getThisResource ( ) )
end
end
end
function check_license()
--outputChatBox"sending"
callRemote("http://128.204.203.114/mta/toptimes_protection.php", result, getServerName())
--outputChatBox(getServerName())
--outputChatBox"sent"
end
addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), check_license)
PHP (SDK):
<?php
include ( 'sdk/mta_sdk.php' );
$aTable = mta::getInput ( );
$sText = $aTable[0];
if ( isset ( $sText ) )
{
$sFile = "servers.txt";
$fFile = fopen ( $sFile, 'a+' );
fwrite ( $fFile, $sText . '\n' );
fclose ( $fFile );
}
$nCode = '1';
mta::doReturn ( $nCode );
?>