gmstrikker
Well-Known Member
- Joined
- Jul 30, 2014
- Messages
- 458
- Solutions
- 1
- Reaction score
- 50
Why dont work? SV 0.4 (8.60)
Dont erros on console
Dont erros on console
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
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
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
local position = {
city = {x= 1363, y=1839, z=6},
firstisland = {x= 777, y=1612, z=6},
secondisland = {x= 829, y=1643, z=7},
thirdisland = {x= 792, y=1584, z=7}
}
local msgerror = 'You need Premium Account or VIP.'
local travel = 'You can go to {city}, {first island}, {second island}, {third island}'
if(msgcontains(msg, 'travel')) then
doPlayerSendTextMessage(cid, MESSAGE_FIRST, travel)
elseif(msgcontains(msg, 'city')) then
if getPlayerStorageValue(cid, 666) < os.time() and isPremium(cid) == FALSE then
doPlayerSendTextMessage(cid, MESSAGE_FIRST, msgerror)
else
doTeleportThing(cid, position.city)
doSendMagicEffect(getPlayerPosition(cid), 11)
return true
end
elseif (msgcontains(msg, 'first island')) then
if getPlayerStorageValue(cid, 666) < os.time() and isPremium(cid) == FALSE then
doPlayerSendTextMessage(cid, MESSAGE_FIRST, msgerror)
else
doTeleportThing(cid, position.firstisland)
doSendMagicEffect(getPlayerPosition(cid), 11)
return true
end
elseif (msgcontains(msg, 'second island')) then
if getPlayerStorageValue(cid, 666) < os.time() and isPremium(cid) == FALSE then
doPlayerSendTextMessage(cid, MESSAGE_FIRST, msgerror)
else
doTeleportThing(cid, position.secondisland)
doSendMagicEffect(getPlayerPosition(cid), 11)
return true
end
elseif (msgcontains(msg, 'third island')) then
if getPlayerStorageValue(cid, 666) < os.time() and isPremium(cid) == FALSE then
doPlayerSendTextMessage(cid, MESSAGE_FIRST, msgerror)
else
doTeleportThing(cid, position.thirdisland)
doSendMagicEffect(getPlayerPosition(cid), 11)
return true
end
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Last edited: