Online Time point..
#1

Hello Guys,

Im interesting about Online TIme point script for EP3 server..Im not mean Website script what is need refresh allways for get cash.I mean 5 min on and get 5 cash example...I was saw on LC CMS 3.6.2 release one onlinetime script im added to my vps (where server runing) but cash not added so im interesting someone have fix for it or someone have any idea how to make working script for it?

 

Regards,MrBusta

#2
There isnt other way except that or other server hook because the db doesnt store the online time

#3

The function is simply:

onlinetime search and check users that are online and gives them some cash points.

on lc cms that script is "protected" from external access bcos can be runned only from localhost, but if you know a bit of php you can easily modify that with your preferred host and ofc you need to edit the table where that script puts credits.

#4

onlinetime cash 

 

you can do it with 3 method

 

-with php but you need to run it every time on youre windows

- with .sh scripte you can creat it and every time you start server you start it too with ./onlineCash.sh it is hard to do it

- with onlinecash.exe you cann creat one give cash for online user and you can start it with mono cashonline like cashserver

 

here is fixed php scripte

 

credit Max 

 

Paramount

 

Siban

 

 

<?php

 
// Verificacion de la IP
$MyIP = array(yourhome ip);
if(!in_array($_SERVER["REMOTE_ADDR"], $MyIP)) 
{
header("HTTP/1.0 403 protection");
die("Error: access denied!");
}
$ServerIP = "127.0.0.1";
$UserName = "root";
$Password = "";
$DataBase = "auth";
$Points = 5;
$MySQL_Connect = mysql_connect( $ServerIP , $UserName , $Password ) or die( mysql_error() );
 
$mysql = mysql_select_db( $DataBase, $MySQL_Connect) or die( mysql_error() );
$result = mysql_query("SELECT a_portal_index from t_users WHERE a_zone_num > -1");
$resulta = mysql_query("SELECT count(a_index) from t_users WHERE a_zone_num > -1");
$r1 = mysql_fetch_row( $resulta );
$Effected = $r1[0];
while($r2 = mysql_fetch_array( $result ))
{
$uID = $r2[a_portal_index];
mysql_query("UPDATE bg_user SET cash = cash + 4 where user_code = $uID");
}
?>
<html>
<head>
<title>Auto-Cash for Online Time</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript">
function Timer(id, minLimit, callback){
var thisTimer = this;
this.limit = minLimit * 60;
this.callback = callback;
this.timer = 0;
this.addEvent(window, load, function(){
thisTimer.el = document.getElementById(id);
thisTimer.txt = thisTimer.el.firstChild;
thisTimer.intv = setInterval(function(){thisTimer.intvFunc();}, 1000);
});
}
Timer.prototype = {
 
intvFunc: function(){
this.txt.nodeValue = this.formatTime(++this.timer);
if(this.timer === this.limit){
clearInterval(this.intv);
this.callback.call(this);
}
},
formatNum: function(n){
return n < 10? 0 + n : n;
},
formatTime: function (n, m, s){
s = n % 60;
m = (n - s) / 60;
return [this.formatNum(m), :, this.formatNum(s)].join();
},
addEvent: (function(){return window.addEventListener? function(el, ev, f){
el.addEventListener(ev, f, false);
}:window.attachEvent? function(el, ev, f){
el.attachEvent(on + ev, f);
}:function(){return;};
})()
};
new Timer(timer1, 5, function(){this.el.parentNode.style.color = red});
</script>
</head>
<body>
<font color = blue>accounts Affected: <?php print $Effected; ?>
<div> 1 minuto: <font color = red><b><span id="timer1">00:00</span></b></font></div>
Players receive <font color = red><b><?php print $Points; ?></b></font> Points to be in every one minute.</font>
<meta http-equiv="refresh" content="60; url=online.php">
</body>
</html>

#5
Credits are not to me

#6
Thanks for script.Ill try it run on my vps (where server runing) and tell its will work or not. 

#7
.php is runing on my vps where server runing...but its not added the cash to online users..

#8

oki can you say me name all database you have

 

that is the orignal one

 

newproject_db

newproject_db_auth

newproject_data

 

if you have newproject_db_user want working

 

than you need to move bg_user from newpeoject_db_user  to newproject_db_auth

 

and edit server config from newproject_db_user to newproject_db_auth

#9


oki can you say me name all database you have

 

that is the orignal one

 

newproject_db

newproject_db_auth

newproject_data

 

if you have newproject_db_user want working

 

than you need to move bg_user from newpeoject_db_user  to newproject_db_auth

 

and edit server config from newproject_db_user to newproject_db_auth

 

 

I have alredy ep3_db_auth,ep3_db,ep3_data,newproject_db_user and newproject_post databases and im setted up for mysql password new user,its a problem? set normaly root without any pass or i can set other users to what i use for server runing and using for connect to vps from my windows pc

sorry for bad english..

#10

Im made $DataBase = "newproject_db_user"; 

and im added there bg_user from ep3_db_auth and checked game its work with this databse...

checked after 2min the bg_user in newproject_db_user but its not added there to...



Forum Jump:


Users browsing this thread: 2 Guest(s)