• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

onlogin script

Hope this is what you want ^^

Code:
function onLogin(cid)
local pos = {x=,y=,z=} -- position where he'll be teleported
local townid = 1 -- townid which he'll be set now
local freeacc = xxx -- change this to the storagevalue when a player is free account.
	if getPlayerStorageValue(cid,freeacc) == -1 then
		if isInArray({1,2,3,4},getPlayerVocation(cid))== TRUE then
			setPlayerStorageValue(cid,freeacc,1)
			doPlayerSetTown(cid, townid)
			doTeleportThing(cid,pos,0)
			doPlayerSendTextMessage(cid,"You are Free Account now.",MESSAGE_STATUS_DEFAULT)
		else 
			return FALSE
		end
	else
		return FALSE
	end
	return TRUE
end

Then put this into login.lua if you use tfs.

Code:
registerCreatureEvent(cid, "FreeAccount")

Last thing to do add this into Creaturescripts.xml

Code:
<event type="login" name="FreeAccount" script="nameofthescript.lua"/>


kind regards, Evil Hero
 
Sorry to ask but what should I do with:
local freeacc = xxx -- change this to the storagevalue when a player is free account.
 
Well the Script is just checking if the Player is a free account that would mean if a free account would login he would be tp'd to temple always, so if you give the player first time he's facc that value he wont be teleported unless he loose the storagevalue.

You have to do it like this...

When a Player buys his Premium then the storageValue has to be set "-1" because if the Player falls back to facc he'll be teleported to the temple on his first login then :p

I hope you get what i mean, If not I'll post how to do it step by step later on :)


kind regards, Evil Hero
 
Back
Top