What's new

Vip Access/Door Problem!!

You Get Pwned

New User
Joined
Mar 31, 2010
Messages
9
Reaction score
2
Witam mam problem, poniewa? nie dziala mi skrypt na vip acces/door pod tibie 8.54.
skrypt kt?ry uzywam:
data/actions/scripts/vipdoor.lua
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
        if isPlayerVip(cid) == TRUE then
                if getCreaturePosition(cid).y < toPosition.y then
                        doTeleportThing(cid, {x=toPosition.x,y=toPosition.y+1,z=toPosition.z}, TRUE)
                else
                        doTeleportThing(cid, {x=toPosition.x,y=toPosition.y-1,z=toPosition.z}, TRUE)
                end
                doCreatureSay(cid, "Welcome VIP Player!", TALKTYPE_ORANGE_1)
                doSendMagicEffect(getCreaturePosition(cid), 10)
        else
                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, but only VIP Players can pass here! Buy VIP on the WEB.")
        end
        return TRUE
end
data/actions/scripts/vip.lua
Code:
local days = 30
local levelToBeVIP = 1
function onUse(cid, item, fromPosition, itemEx, toPosition)
        if getPlayerLevel(cid) >= levelToBeVIP then
                if isPlayerVip(cid) == FALSE then
                        doCreatureSay(cid, "CONGRATULATIONS! You are now a VIP for "..days.." days! You can now enter the VIP-area and use unique features!. ", TALKTYPE_ORANGE_1)
                end
                doSendAnimatedText(getPlayerPosition(cid), "Welcome!", TEXTCOLOR_RED) 
                doPlayerAddVipDays(cid, days)
                doRemoveItem(item.uid, 1)
                doSendAnimatedText(getCreaturePosition(cid), "+"..days.." days", 30)
        else
                doPlayerSendCancel(cid, "You need level "..levelToBeVIP.." to be a VIP player.")
        end     
        return TRUE
end
data/actions/actions.xml
Code:
<!-- VIP -->
        <action actionid="5786" script="vipdoor.lua"/>
        <action itemid="5785" script="vip.lua"/>
chce ?eby vip access byl na 30 dni i gdy sie 2 raz uzyje to dodaje nastepne 30dni.
Porsze o pomoc z edytowaniem skryptu.
Link do oficjalnego tematu z skryptem: http://tibia.net.pl/propozycje-skryptow/291667-vip-system.html
 

Akyga16

Advanced User
Joined
Apr 16, 2010
Messages
214
Reaction score
12
Age
29
Odp: Vip Access/Door Problem!!

Spr?buj u?y? tych skrypt?w (Mi one dzia?aj?)
Stw?rz Plik vipacces.lua i wklej do niego :
PHP:
-- By Kuba1418

function onUse(cid, item, frompos, item2, topos)

if item.itemid == 5785 then

local playerpos = getCreaturePosition(cid)

doRemoveItem(item.uid,1)
setPlayerStorageValue(cid,21444,1)

doSendMagicEffect(playerpos, 12)
doSendAnimatedText(getPlayerPosition(cid), "Welcome!", TEXTCOLOR_RED) 
doCreatureSay(cid, "Gratulacie! Teraz jestes posiadaczem Vip Access!", TALKTYPE_ORANGE_1)
end
end

Stw?rz Plik vipdoor i wklej do niego :
PHP:
-- Vip Door by Kuba1418 --

function onUse(cid, item, frompos, item2, topos)
local storageValue = 21444
vipstatus = getPlayerStorageValue(cid,storageValue)
newnPosition = {x=997, y=998, z=7}

if vipstatus == 1 then

playerpos = getPlayerPosition(cid)

doorpos = {x = frompos.x, y = frompos.y, z = frompos.z, stackpos = 253}

if item.actionid == 9843 and getPlayerStorageValue(cid,21444) == 1 then
doTeleportThing(cid,newnPosition)
doSendMagicEffect(newnPosition, 10)
doCreatureSay(cid, "Hiho VIP-e Player!!!", TALKTYPE_ORANGE_1)
end

else
doCreatureSay(cid, "Nie posiadasz vip access.", TALKTYPE_ORANGE_1)
end

return 1

end

newnPosition = {x=997, y=998, z=7}
Tu wpisujesz pozycje drzwi

otwierasz action/script.xml i dorzucasz to :

<action itemid="5785" script="vipaccess.lua" />
<action actionid="9843" script="vipdoor.lua"/>

actionid="9843" - Takie actionid (9843) musisz wpisac w drzwi w map editorze
itemid="5785" - Id itemku Vip Medal

## 100 Post ^^ ##
 
Top