• 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!

Lua Boat Problem

Shadows

Kylaria Programmer
Joined
Jun 15, 2007
Messages
90
Reaction score
2
Location
Canada
Small question how would I make it so people cant use the boat while PZ locked?
 
My boat npcs leave theirs im not sure why. I tried doing
Code:
if(isPlayerPremiumCallback(cid) or not(parameters.premium)) then
			if(parameters.level ~= nil and getPlayerLevel(cid) < parameters.level) then
				npcHandler:say('You must reach level ' .. parameters.level .. ' before I can let you go there.', cid)
			elseif(doPlayerRemoveMoney(cid, parameters.cost) ~= TRUE) then
				npcHandler:say('You do not have enough money!', cid)
			elseif(isPlayerPzLocked(cid) ~= FALSE then
				npcHandler:say('Lose those bloodstains first!', cid)
			else
				doTeleportThing(cid, parameters.destination, 0)
				doSendMagicEffect(parameters.destination, 10)
			end
		else
			npcHandler:say('I can only allow premium players to travel with me.', cid)
		end

But that gave me so many errors in my console that the server crashed.
 
Trying to make it so that if someone is PZ locked even if they can talk to the boat NPC he wont take them anywhere I know TFS has a isPlayerPzLocked function, im just not sure why my script wont work. Check below for the example script, Thats my modified travel module. But I can run it if I add the elseif(isPlayerPzLocked(cid) ~= FALSE then part or it gives me tons of errors that I cant even read because the server freezes and crashes.
Code:
if(isPlayerPremiumCallback(cid) or not(parameters.premium)) then
			if(parameters.level ~= nil and getPlayerLevel(cid) < parameters.level) then
				npcHandler:say('You must reach level ' .. parameters.level .. ' before I can let you go there.', cid)
			elseif(doPlayerRemoveMoney(cid, parameters.cost) ~= TRUE) then
				npcHandler:say('You do not have enough money!', cid)
			elseif(isPlayerPzLocked(cid) ~= FALSE then
				npcHandler:say('Lose those bloodstains first!', cid)
			else
				doTeleportThing(cid, parameters.destination, 0)
				doSendMagicEffect(parameters.destination, 10)
			end
		else
			npcHandler:say('I can only allow premium players to travel with me.', cid)
		end
 
PHP:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}

function onCreatureAppear(cid)                npcHandler:onCreatureAppear(cid)            end
function onCreatureDisappear(cid)             npcHandler:onCreatureDisappear(cid)            end
function onCreatureSay(cid, type, msg)            npcHandler:onCreatureSay(cid, type, msg)        end
function onThink()                    npcHandler:onThink()                    end

npcHandler:setMessage(MESSAGE_GREET, 'Hello |PLAYERNAME|. I can take You to Hell City')



function onSay2(cid, words, param)
	if (getPlayerSkullType(cid) == 0) then
		if(doPlayerRemoveMoney(cid, 10000) == TRUE)then
		   doTeleportThing(cid, {x = 1262, y = 767, z = 7, stackpos = 1}, TRUE)
		else
		   selfSay('Sorry, you dont have enought money.', cid)
		end
        
	else
	   selfSay('Sorry, first get rid of that skull.', cid)
	end
end


 local node1 = keywordHandler:addKeyword({'hell city'}, onSay2, {})

local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

rep++?
 
Back
Top