View previous topic :: View next topic |
Author |
Message |
Sting9x Expert Cheater Reputation: 0
Joined: 27 Jul 2016 Posts: 124
|
Posted: Sat Feb 18, 2017 6:23 am Post subject: Check Online/Offline in Lua . Help Me |
|
|
Hello Admin and member ,here is my code Php
i will set name for it is user.php . When someone uses the program. It will be called in connection to link to domain.com/user.php?online .
and when they do not use anymore. They will be referred to to link domain.com/user.php?offline
Who has the code to help me implement ideas that? If yes please help me .
Last edited by Sting9x on Sun Feb 19, 2017 8:00 am; edited 1 time in total |
|
Back to top |
|
|
Sting9x Expert Cheater Reputation: 0
Joined: 27 Jul 2016 Posts: 124
|
Posted: Sat Feb 18, 2017 10:34 pm Post subject: |
|
|
Help
|
|
Back to top |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
|
Back to top |
|
|
Sting9x Expert Cheater Reputation: 0
Joined: 27 Jul 2016 Posts: 124
|
Posted: Sun Feb 19, 2017 2:06 am Post subject: |
|
|
I mean, I want the user to restart the program it will link to links domain.com/user.php?online
and when they do not use anymore. They will be referred to to link domain.com/user.php?offline
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25296 Location: The netherlands
|
Posted: Sun Feb 19, 2017 5:32 am Post subject: |
|
|
use getInternet and fetch that url
and add an onclose grt the offline one
and i recommend you also use a timer that every 5 minutes that calls a 'stillonline' so you can deal with crashes
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
Sting9x Expert Cheater Reputation: 0
Joined: 27 Jul 2016 Posts: 124
|
Posted: Sun Feb 19, 2017 7:59 am Post subject: |
|
|
Dark Byte wrote: | use getInternet and fetch that url
and add an onclose grt the offline one
and i recommend you also use a timer that every 5 minutes that calls a 'stillonline' so you can deal with crashes |
Tks . it works very well
|
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Sun Feb 19, 2017 8:54 am Post subject: |
|
|
His original PHP code was:
Code: | <?php
function ReadOnline()
{
$filename = "online.txt";
$myfile = fopen($filename,"r+");
$buffer = fread($myfile, filesize($filename) );
fclose($myfile);
return $buffer;
}
function WriteOnline($count)
{
$filename = "online.txt";
$myfile = fopen($filename,"w");
$buffer = fwrite($myfile, $count );
fclose($myfile);
}
if (isset($_GET['online']))
{
$count = ReadOnline();
if ($count < 0) $count = 0;
$count += 1;
WriteOnline($count);
}
else
if (isset($_GET['offline']))
{
$count = ReadOnline();
$count -= 1;
if ($count < 0) $count = 0;
WriteOnline($count);
}
else
{
$count = ReadOnline();
echo "User Online:".$count;
}
?> |
|
|
Back to top |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Sun Feb 19, 2017 8:29 pm Post subject: |
|
|
Where is "his php" script ??
|
|
Back to top |
|
|
++METHOS I post too much Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Sun Feb 19, 2017 8:34 pm Post subject: |
|
|
He tried removing it, so Zanzer kindly added it back.
|
|
Back to top |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Mon Feb 20, 2017 7:37 am Post subject: |
|
|
++METHOS.... ah I see.. Don't know why or what reasons, some member did like that (posted and delete his/her own post)...
|
|
Back to top |
|
|
++METHOS I post too much Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Mon Feb 20, 2017 9:18 am Post subject: |
|
|
He probably did not want anyone using his code or knowing how to replicate what he was doing.
|
|
Back to top |
|
|
|