What's new

Actions Skrypty na zamówienie (lua, php, mysql, c++ [podstawy])

buchaLL

bez spiny, luźno
Joined
Aug 2, 2011
Messages
1,013
Reaction score
68
Age
27
Odp: Skrypty na zam?wienie (lua, php, mysql, c++ [podstawy])

Odp: Skrypty na zam?wienie (lua, php, mysql, c++ [podstawy])

Typ Skryptu :
Po kilknieciu na skrzynie ID : 1740, dostajemy ustalony reward np : 2160 count 50, oraz teleportuje nas owa skrzyna na te Koordynaty : {x = 1226, y = 1052, z = 8}
Wersja 8.60
tfs 0.4

Jak chcesz na id to zmieniasz uniqueid na itemid, ale raczej to by by?o bezsensu, bo by dzia?a?o na ka?d? skrzyni? z tym id.
[xml]<action uniqueid="UID" event="script" value="chest.lua"/>[/xml]
[lua]function onUse(cid, item, frompos, item2, topos)
local cfg = {item = 2160, count = 50, storage = 2153, pos = {x = 1064, y = 1026, z = 7}}
if getPlayerStorageValue(cid,cfg.storage) == -1 then
doPlayerSendTextMessage(cid,22,"You have found a ".. cfg.count .." " .. getItemNameById(cfg.item) .. ".")
doPlayerAddItem(cid,cfg.item,cfg.count)
setPlayerStorageValue(cid,cfg.storage,1)
doTeleportThing(cid, cfg.pos, true)
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end
return true
end[/lua]
 

Never Give Up

Forum friend
Joined
Jul 7, 2010
Messages
1,552
Reaction score
69
Odp: Skrypty na zam?wienie (lua, php, mysql, c++ [podstawy])

Odp: Skrypty na zam?wienie (lua, php, mysql, c++ [podstawy])

Rodzaj skryptu : xxx
Opis skryptu :
ad367be59e3493ccb215ca7e19f8af62.gif

Wersja silnika: TFS 0.3.6
 

sempele

Active User
Joined
Nov 19, 2010
Messages
107
Reaction score
3
Odp: Skrypty na zam?wienie (lua, php, mysql, c++ [podstawy])

Odp: Skrypty na zam?wienie (lua, php, mysql, c++ [podstawy])

My?l?, ?e teraz powinno by? okej.
Kliknij, aby zobaczy? obrazek

[XML]<?xml version="1.0" encoding="UTF-8"?>
<mod name="Task System" version="1.0" author="buchaLL" contact="https://tibia.net.pl/members/353628-buchaLL" enabled="yes">
<config name="task_system_conf"><=!=[=C=D=A=T=A=[
onlyOneTime = true
mainStorage = 73435

task = {
['dragon'] = {storage = 5756, beginStorageValue = 1, finishStorageValue = 2, count = 1,
addons = {male = 128, female = 136, which = 3}}
}

function isSummon(cid)
if(not isCreature(cid)) then
return false
end
return getCreatureMaster(cid) ~= cid
end
]=]=></config>

<talkaction words="!task" event="script"><=!=[=C=D=A=T=A=[
domodlib('task_system_conf')
function onSay(cid, words, param, channel)

local taskMenu, message = task[param:lower()], ''
if taskMenu and (getCreatureStorage(cid, taskMenu.storage) == -1 or getCreatureStorage(cid, mainStorage) < 1) then
if(onlyOneTime and getCreatureStorage(cid, taskMenu.storage) > 0) or getCreatureStorage(cid, taskMenu.storage) > taskMenu.count then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Already you have made this task!')
end
if getCreatureStorage(cid, taskMenu.storage) > -1 then
return true
else
doCreatureSetStorage(cid, mainStorage, taskMenu.beginStorageValue)
end
doCreatureSetStorage(cid, taskMenu.storage, 0)
for k, v in pairs(task) do
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You must kill ' .. v.count .. ' ' .. k:lower() .. (v.count == 1 and '' or 's') .. '.')
end
elseif taskMenu and (getCreatureStorage(cid, taskMenu.storage) == 1 or getCreatureStorage(cid, mainStorage) >= 1) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You are already doing some task!')
elseif isInArray({'cancel'}, param:lower()) and getCreatureStorage(cid, mainStorage) > 0 then
for _, v in pairs(task) do
if getCreatureStorage(cid, v.storage) >= 0 then
doCreatureSetStorage(cid, mainStorage, -1)
doCreatureSetStorage(cid, v.storage, -1)
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You canceled the current task.')
end
end
elseif isInArray({'reward'}, param:lower()) then
for _, v in pairs(task) do
if (getCreatureStorage(cid, v.storage) == v.count or getCreatureStorage(cid, mainStorage) == v.finishStorageValue) then
doCreatureSetStorage(cid, v.storage, v.count + 1)
if(getPlayerSex(cid) == 0) then
doPlayerAddOutfit(cid, v.addons.female, v.addons.which)
else
doPlayerAddOutfit(cid, v.addons.male, v.addons.which)
end
doCreatureSetStorage(cid, mainStorage, -1)
doCreatureSetStorage(cid, v.storage, -1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Addon added!')
else
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You have not finished your task yet!')
end
end
end
for k, v in pairs(task) do
if (getCreatureStorage(cid, v.storage) <= v.count or isInArray({v.finishStorageValue, v.beginStorageValue}, getCreatureStorage(cid, mainStorage))) then
return true
else
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You have not started any task!')
end
end
end
]=]=></talkaction>

<event type="kill" name="talkactionTask" event="script"><=!=[=C=D=A=T=A=[
domodlib('task_system_conf')
function onKill(cid, target)
if isPlayer(target) or getCreatureMaster(target) or isNpc(target) then
return true
end
for k, v in pairs(task) do
if k:lower() == getCreatureName(target):lower() then
if getCreatureStorage(cid, mainStorage) == v.beginStorageValue then
if getCreatureStorage(cid, v.storage) < v.count then
doCreatureSetStorage(cid, v.storage, getCreatureStorage(cid, v.storage) + 1)
s = 'You killed ' .. getCreatureStorage(cid, v.storage) .. ' of ' .. v.count .. ' ' .. k:lower() .. (v.count == 1 and '' or 's') .. '.'
if getCreatureStorage(cid, v.storage) == v.count then
doCreatureSetStorage(cid, mainStorage, v.finishStorageValue)
s = 'Congratulations! You have killed enough '.. k:lower() ..'.'
end
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, s)
end
end
end
end
return true
end
]=]=></event>

<event type="login" name="taskEventLogin" event="buffer"><=!=[=C=D=A=T=A=[
registerCreatureEvent(cid, 'talkactionTask')
]=]=></event>
</mod>[/XML]


Teraz Git tylko mam jeszcze jedno pytanie da si? doda? tutaj exhaust na komendy oraz mo?liwo?? wykonania taska tylko raz ? I jak doda? nowego taska ? bo np dodaje na dragon lordy ale po napisaniu !task dragon lord to jest napisane ?e zacz??em taska na dragony a nie dragon lordy, ale mimo wszystko zalicza mi dl'e
 
Last edited:

DenZ

Zasłużony
Joined
Feb 23, 2011
Messages
868
Reaction score
30
Age
28
Odp: Skrypty na zam?wienie (lua, php, mysql, c++ [podstawy])

Odp: Skrypty na zam?wienie (lua, php, mysql, c++ [podstawy])

Rodzaj skryptu:
Opis skryptu: Kamie? daj?cy level po klikni?ciu na niego, nie chodzi o EXP tylko o LEVEL.
Wersja silnika: TFS 0.4
 

qwasniak

Advanced User
Joined
May 9, 2013
Messages
303
Reaction score
7
Odp: Skrypty na zam?wienie (lua, php, mysql, c++ [podstawy])

Odp: Skrypty na zam?wienie (lua, php, mysql, c++ [podstawy])

doPlayerAddLevel(cid, x)
 

DenZ

Zasłużony
Joined
Feb 23, 2011
Messages
868
Reaction score
30
Age
28
Odp: Skrypty na zam?wienie (lua, php, mysql, c++ [podstawy])

Odp: Skrypty na zam?wienie (lua, php, mysql, c++ [podstawy])

doPlayerAddLevel(cid, x)

Chodzi mi o skrypt nie o funkcje.
 

qwasniak

Advanced User
Joined
May 9, 2013
Messages
303
Reaction score
7
Odp: Skrypty na zam?wienie (lua, php, mysql, c++ [podstawy])

Odp: Skrypty na zam?wienie (lua, php, mysql, c++ [podstawy])

function onUse(cid, item, frompos, item2, topos)
if item.uid == xxxx then
doPlayerAddLevel(cid, x)
else
return 0
end
return 1
end
 

narkotyko

User
Joined
May 30, 2013
Messages
23
Reaction score
0
Odp: Skrypty na zam?wienie (lua, php, mysql, c++ [podstawy])

Odp: Skrypty na zam?wienie (lua, php, mysql, c++ [podstawy])

skrypt na u?ywanie spellu zaleznie od kierunku, tfs 1.2 z jakim? zdaniem np lewo!, prawo! i z dwoma efektami na stron? :)
 

Sepox

Active User
Joined
Mar 16, 2017
Messages
138
Reaction score
0
Odp: Skrypty na zam?wienie (lua, php, mysql, c++ [podstawy])

Odp: Skrypty na zam?wienie (lua, php, mysql, c++ [podstawy])

Rodzaj Skryptu: C++
Opis Skryptu: Zoombi System, system ma dzia?a? tak jak na tibia.fun.pl [7.60]. Czyli Mamy teleport w Danym miejscu. Ale nie mo?emy w niego wej?? poniewa? jest on zablokowany.. Zostanie on dopiero odblokowany je?eli system [ 30sekund przed otwarciem teleporta zostan? gracze poinformowani : [Zoombi System Startuje za 30sekund! Znajdziesz teleport w City!]. System ten ma dzia?a? na zasadzie kto zostanie ostatni, dostaje jaki? dowolny item do ustawieniu w config.lua albo C++
Protok??: 7.60 [CZEKAM] Zobaczymy czy zdzia?acie co? ;]
 

pniakk

User
Joined
Jul 22, 2018
Messages
11
Reaction score
0
Odp: Skrypty na zam?wienie (lua, php, mysql, c++ [podstawy])

Odp: Skrypty na zam?wienie (lua, php, mysql, c++ [podstawy])

Rodzaj skryptu: LUA
Opis skryptu: Chcia?bym aby po wpisaniu komendy /addpoints (Numer konta) (Ilo??) przez admina, konto o podanym loginie dostawa?o podan? ilo?? Premium Points do bazy danych.
Wersja silnika: TFS 0.4 Pod tibi? 8.6
 
Top