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

chceck pz functions

tim26

Member
Joined
Aug 12, 2008
Messages
618
Reaction score
11
Location
Poland
i write that

Code:
elseif msgcontains(msg, 'hi') then			
		if isPlayerPzLocked(cid) == TRUE then
			if isPremium(cid) == TRUE then					
					selfSay('you ruin my ship', cid)
					talk_state = 0
 		else
			selfSay('I can only allow premium players to travel with me.', cid)
		   end
end

i wrtite that i can't now try this then i ask it is good?:P
 
Well its lacking an "end" and i cant really make sense of your placement of responses, nor do i understand what you are asking in the first place... o_O;

Buf if i understand correctly, you want somekind of anti-pz only-prem boatride thing... then proper code would be:

Code:
elseif msgcontains(msg, 'hi') then			
	
	if isPlayerPzLocked(cid) == FALSE then
		
		if isPremium(cid) == TRUE then					
		
			selfSay('Where would you like to go?', cid)
			talk_state = XX
 		
		else
		
			selfSay('I can only allow premium players to travel with me.', cid)
			talk_state = 0
		end
	else
	
	selfSay('You currently have protection zone lock, i cannot transport you until it goes away.', cid)
	talk_state = 0
	
	end	
end
 
i try it but it didnt work also npc say message_greet default with keywordhandler lua;/ its say whos have pz but still can travel;/ whos know maybe how do it or how turn off ths default option
 
yes but mabe you know how add this function to keyword yes? when if dont have pz normal tp when have pz ony one msg i think it should work correctrly because ne npc hanfler dont have anything about this :P
 
in data/npc/lib/modules.lua (around line 160):
Swap:
Code:
	if(isPlayerPremiumCallback == nil or isPlayerPremiumCallback(cid) == true or parameters.premium == false) 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)
			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
to:
Code:
	if(isPlayerPremiumCallback == nil or isPlayerPremiumCallback(cid) == true or parameters.premium == false) 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('You are pz-locked, come back later!', 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

Guess it should work.
 
Back
Top