What's new

Komenda teleport

Status
Not open for further replies.

kubofonista

Advanced User
Joined
Apr 10, 2008
Messages
207
Reaction score
6
Witam, poszukuje skryptu na komend? dzi?ki kt?rej b?dziemy teleportowani przed dp(ustawie pozycje).

Ma to dzia?a? do 50 lvlu i by? darmowe(niewielka op?ata mo?e by?).




Pozdrawiam!
 

Maniucza

Advanced User
Joined
Jan 18, 2009
Messages
374
Reaction score
57
Odp: Komenda teleport

Witam, prosz? Bardzo.
PHP:
local destinations = {
    ["temple"] = {pos = {x=1111, y=1111, z=7}, cost = 1000},
    ["boat"] = {pos = {x=2222, y=2222, z=6}, cost = 2000}
}

function onSay(cid, words, param, channel)
    local tp = destinations[param]
    if(param == "") then
        return doPlayerSendCancel(cid, "Command param required.")
    end
    if(getPlayerMoney(cid) < tp.cost) then
        return doPlayerSendCancel(cid, "You do not have enough money.")
    elseif(isPlayerPzLocked(cid) == true) then
        return doPlayerSendCancel(cid, "You are currently in a fight.")
    elseif getCreatureCondition(cid, CONDITION_INFIGHT) then 
        return doPlayerSendCancel(cid, "You are currently in a fight.")
    else
        doPlayerRemoveMoney(cid, tp.cost)
        doTeleportThing(cid, tp.pos)
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have successfully teleported to ".. param ..".")
    end
    return true
end
 

kubofonista

Advanced User
Joined
Apr 10, 2008
Messages
207
Reaction score
6
Odp: Komenda teleport

ale to chyba b?dzie dost?pne dla ka?dego a ja chce do 50 lvlu tylko
 

Maniucza

Advanced User
Joined
Jan 18, 2009
Messages
374
Reaction score
57
Odp: Komenda teleport

Ok, ju? poprawione

PHP:
local destinations = {
    ["temple"] = {pos = {x = 1111, y = 1111, z = 7}, cost = 1000},
    ["boat"] = {pos = {x = 2222, y = 2222, z = 6}, cost = 2000}
}

function onSay(cid, words, param, channel)
    local tp = destinations[param]
    if(param == "") then
        return doPlayerSendCancel(cid, "Command param required.")
    end
    if(getPlayerMoney(cid) < tp.cost) then
        return doPlayerSendCancel(cid, "You do not have enough money.")
    elseif(isPlayerPzLocked(cid) == true) then
        return doPlayerSendCancel(cid, "You are currently in a fight.")
    elseif getCreatureCondition(cid, CONDITION_INFIGHT) then 
        return doPlayerSendCancel(cid, "You are currently in a fight.")
	elseif getPlayerLevel(cid) < 50 then
		return doPlayerSendCancel(cid, "You dont have level.")
    else
        doPlayerRemoveMoney(cid, tp.cost)
        doTeleportThing(cid, tp.pos)
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have successfully teleported to ".. param ..".")
    end
    return true
end

Nie zauwa?y?em, ze ma by? od levela. ;)
 

kubofonista

Advanced User
Joined
Apr 10, 2008
Messages
207
Reaction score
6
Odp: Komenda teleport

niestety komendy mo?e u?ywa? ka?dy :(
 

Don Muha

Advanced User
Joined
Aug 27, 2008
Messages
403
Reaction score
34
Odp: Komenda teleport

Mo?e tak...
PHP:
local destinations = {
    ["temple"] = {pos = {x = 1111, y = 1111, z = 7}, cost = 1000},
    ["boat"] = {pos = {x = 2222, y = 2222, z = 6}, cost = 2000}
}
local minlevel = 50 
function onSay(cid, words, param, channel)
    local tp = destinations[param]
    if(param == "") then
        return doPlayerSendCancel(cid, "Command param required.")
    end
    if(getPlayerMoney(cid) < tp.cost) then
        return doPlayerSendCancel(cid, "You do not have enough money.")
    elseif(isPlayerPzLocked(cid) == true) then
        return doPlayerSendCancel(cid, "You are currently in a fight.")
    elseif(getCreatureCondition(cid, CONDITION_INFIGHT)) then 
        return doPlayerSendCancel(cid, "You are currently in a fight.")
    elseif(getPlayerLevel(cid) <= minlevel) then
        return doPlayerSendCancel(cid, "You dont have level.")
    else
        doPlayerRemoveMoney(cid, tp.cost)
        doTeleportThing(cid, tp.pos)
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have successfully teleported to ".. param ..".")
    end
    return true
end
 

kubofonista

Advanced User
Joined
Apr 10, 2008
Messages
207
Reaction score
6
Odp: Komenda teleport

nie testowa?em ale tam pisze mini level 50 a to ma by? max;p
 

Don Muha

Advanced User
Joined
Aug 27, 2008
Messages
403
Reaction score
34
Odp: Komenda teleport

To przetestuj i pogadamy ;D

@Edit
yeee dosta?em warna ;D
 
K

Krecioo

Guest
Odp: Komenda teleport

Autor tematu zosta? zbanowany, zamykam.
 
Status
Not open for further replies.
Top