• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

Offline Days System

Junior Spellweaver
Joined
Dec 23, 2011
Messages
159
Reaction score
87
Method not used in the files, can be found in Line...


Code:
GetOffLineDays(playerID)

Ex:

Code:
$offline = GetOffLineDays(-1)
if $offline > 4
dosomething here
endif

Useful Method.

Larger example:

Code:
function offlineDaysScript() {
	$offline = GetOffLineDays(-1)
	$level = GetPlayerInfo( -1, "level" )
	$salaryparam = $level * 50
	$salary = $salaryparam * $offline
	$expparam1 = $level * $level
	$expparam2 = $expparam1 * 1000
	$exp = $expparam2 * $offline

	if $offline > 0
		if $offline <= 7
			AddPlayerInfo( -1, "givepoint", $salary )
			BC("chat", "player", -1, "[color=ffff3817]You were offline for: ", $offline, " days and have received ", $salary, " Salary!")
		endif
	endif

	if $offline > 7
		AddPlayerInfo( -1, "givepoint", $salary )
		AddPlayerInfo( -1, "exp", $exp )
		BC("chat", "player", -1, "[color=ffff3817]You were offline for: ", $offline, " days and have received EXP, Items & Salary!")
		call return7dayitem()
	endif

}

return7dayitem() = Make a Method adding items using AddPlayerInfo method.


Example of Stats:
Player Level: 50
Salary Amount 1-7 days: 2500->17500
Salary Amount > 7 Days: 20000->xxxxxxx
EXP Amount > 7 Days: 20000000->xxxxxxxxxx


Works well within the OnLogin() method.
 
Newbie Spellweaver
Joined
Mar 7, 2015
Messages
34
Reaction score
3
Useful block of code.. But in regards to,

Method not used in the files, can be found in Line...

Would make it appear that you are referring to line.exe.. Which of course was originally compiled with VS 2005 ENT, and it doesn't contain any lua script whatsoever..

/Scripts/Player.s isn't line or an executable.. Not as you are referring too.
 
Back
Top