• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Przerobka Skryptu.

Donaj

Banned User
Joined
Jan 6, 2010
Messages
943
Reaction score
3
Witam, mam prosbe. Kto Mi Przerobi Ten Skrypt, ze gdy chcemy tp potrzebujemy item o danym id, a nie kase.

Code:
function onSay(cid, words, param, channel)
local money = 10000
local pPos = getPlayerPosition(cid)
local newP = {x=1000, y=1000, z=7}
    if getPlayerLevel(cid) <= 100 then
        doPlayerSendCancel(cid, "Do not have a 100 level.")
    elseif(isPlayerPzLocked(cid) == true) then
        doPlayerSendCancel(cid, "You are currently in a fight.")
    elseif isKnight(cid)
        doPlayerSendCancel(cid, "You can pass, you are a Knight.")
    elseif(getPlayerMoney(cid) < money) then
        doPlayerSendCancel(cid, "You do not have enough money.")
    else
        doPlayerRemoveMoney(cid, money)
        doTeleportThing(cid, newP)
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
        doPlayerSendCancel(cid, MESSAGE_INFO_DESCR, "You can't teleport there.")
    end
    return true
end
 
Code:
function onSay(cid, words, param, channel)
local pPos = getPlayerPosition(cid)
local newP = {x=1000, y=1000, z=7}
    if getPlayerLevel(cid) <= 100 then
        doPlayerSendCancel(cid, "Do not have a 100 level.")
    elseif(isPlayerPzLocked(cid) == true) then
        doPlayerSendCancel(cid, "You are currently in a fight.")
    elseif isKnight(cid)
        doPlayerSendCancel(cid, "You can pass, you are a Knight.")
    elseif (getPlayerItemCount(cid, 2650) < 1) then
        doPlayerSendCancel(cid, "You do not have item.")
    elseif (getPlayerItemCount(cid, 2650) > 1) then
        doPlayerRemoveItem(cid, 2650, 1)
        doTeleportThing(cid, newP)
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
    else    
        doPlayerSendCancel(cid, MESSAGE_INFO_DESCR, "You can't teleport there.")
    end
    return true
end
Na szybkiego. Nie testowałem
 
Last edited:
Code:
function onSay(cid, words, param, channel)
local pPos = getPlayerPosition(cid)
local newP = {x=1000, y=1000, z=7}
    if getPlayerLevel(cid) <= 100 then
        doPlayerSendCancel(cid, "Do not have a 100 level.")
    elseif(isPlayerPzLocked(cid) == true) then
        doPlayerSendCancel(cid, "You are currently in a fight.")
    elseif isKnight(cid)
        doPlayerSendCancel(cid, "You can pass, you are a Knight.")
    elseif (getPlayerItemCount(cid, 2650) < 1) then
        doPlayerSendCancel(cid, "You do not have item.")
    else
        doPlayerRemoveItem(cid, 2650, 1)
        doTeleportThing(cid, newP)
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
        doPlayerSendCancel(cid, MESSAGE_INFO_DESCR, "You can't teleport there.")
    end
    return true
end
Na szybkiego. Nie testowałem

a jesli nie ma owego itemu? skrypt i tak zostanie wykonany, tzn. wszystkie instrukcje po probie usuniecia nieistniejacego przedmiotu :)
 
Trafne spostrzezenie Averatec.
Skoro przerobka to przerobka. Normalnie inaczej bym napisal taki skrypt. :p

LUA:
function onSay(cid, words, param, channel)
local pPos = getPlayerPosition(cid)
local newP = {x=1000, y=1000, z=7}
    if getPlayerLevel(cid) <= 100 then
        doPlayerSendCancel(cid, "Do not have a 100 level.")
    elseif(isPlayerPzLocked(cid) == true) then
        doPlayerSendCancel(cid, "You are currently in a fight.")
    elseif isKnight(cid)
        doPlayerSendCancel(cid, "You can pass, you are a Knight.")
    elseif(getPlayerItemCount(cid, 2650) >= 1) then
        doPlayerRemoveItem(cid, 2650, 1)
        doTeleportThing(cid, newP)
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
        doPlayerSendCancel(cid, MESSAGE_INFO_DESCR, "You can't teleport there.")
    else
        doPlayerSendCancel(cid, "You do not have item.")
    end
    return true
end

edit: pojebany skrypt xd Co to robi w ogole. Autorze powiedz co chcesz, aby wykonywal ten skrypt. Jak znajde chwile to ci napisze lepszy. Te warunki sa pojebane co ma 100 lvl do pz lub knighta :huh:
 
Po co deklarujesz pPos skoro go nigdzie nie wykorzystujesz?

No chyba że chcesz na siłę sykorzystać to zmień

Code:
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)

Na

Code:
doSendMagicEffect(pPos, CONST_ME_TELEPORT)
 
Hmm, ta linijke z knightem mozna usunac. Skrypt ma teleportowac na expowisko a danych x,y,z gdy mamy np. 5 itemow o danym id : przyklad mms,mpa,golden legs,bla bla bla. ;>

function onSay(cid, words, param, channel)
local money = 10000
local pPos = getPlayerPosition(cid)
local newP = {x=1000, y=1000, z=7}
if getPlayerLevel(cid) <= 100 then
doPlayerSendCancel(cid, "Do not have a 100 level.")
elseif(isPlayerPzLocked(cid) == true) then
doPlayerSendCancel(cid, "You are currently in a fight.")
elseif(getPlayerMoney(cid) < money) then
doPlayerSendCancel(cid, "You do not have enough money.")
else
doPlayerRemoveMoney(cid, money)
doTeleportThing(cid, newP)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
doPlayerSendCancel(cid, MESSAGE_INFO_DESCR, "You can't teleport there.")
end
return true
end

Po usunieciu linijki z knightem.
 
PHP:
function onSay(cid, words, param, channel)

local lvl = 100
local newP = {x=1000, y=1000, z=7}
local it =
{
it1 = xxxx,
it2 = xxxx,
it3 = xxxx,
it4 = xxxx
}

--------------------------------
local przedmioty = 
{
p1 = getPlayerItemCount(cid, it.it1),
p2 = getPlayerItemCount(cid, it.it2),
p3 = getPlayerItemCount(cid, it.it3),
p4 = getPlayerItemCount(cid, it.it4)
}

local nazwa =
{
naz1 = getItemNameById(it.it1),
naz2 = getItemNameById(it.it2),
naz3 = getItemNameById(it.it3),
naz4 = getItemNameById(it.it4)
}


    if getPlayerLevel(cid) <= lvl then
        doPlayerSendCancel(cid, "Do not have a 100 level.")
    elseif(isPlayerPzLocked(cid) == true) then
        doPlayerSendCancel(cid, MESSAGE_INFO_DESCR, "You are currently in a fight.")
    elseif przedmioty.p1 == 0 then
        doPlayerSendCancel(cid, MESSAGE_INFO_DESCR, "You do not have " .. nazwa.naz1 .."")
	elseif przedmioty.p2 == 0 then
        doPlayerSendCancel(cid, MESSAGE_INFO_DESCR, "You do not have " .. nazwa.naz2 .."")
    elseif przedmioty.p3 == 0 then
        doPlayerSendCancel(cid, MESSAGE_INFO_DESCR, "You do not have " .. nazwa.naz3 .."")
    elseif przedmioty.p4 == 0 then
        doPlayerSendCancel(cid, MESSAGE_INFO_DESCR, "You do not have " .. nazwa.naz4 .."")		
    else
        doPlayerRemoveItem(cid, it.it1, 1) 
		doPlayerRemoveItem(cid, it.it2, 1) 
		doPlayerRemoveItem(cid, it.it3, 1) 
		doPlayerRemoveItem(cid, it.it4, 1) 
        doTeleportThing(cid, newP)
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
        doPlayerSendCancel(cid, MESSAGE_INFO_DESCR, "You can't teleport there.")
    end
    return true
end

Wszystko konfigurujesz do ----- podajesz lvl pozycje i id przedmiotów.

Nie testowałem i możliwe że coś zj..ałem jak zawsze.
 
Last edited:
Back
Top