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.
 
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