Skrypty & Kody Skrypt 8.6 - Event

Status
Zamknięty.

Mr ImaGu?

Advanced User
Zarejestrowany
Dołączył
Grudzień 13, 2014
Posty
289
Liczba reakcji
10
Witam
Je?eli komu? si? chce to prosz? o pomoc.
Wi?c tak ,potrzebuje 3 rzeczy :
1)

skryptu na teleport kt?ry daje :
Za wej?cie do niego 1 playera item o id xxxx ilo?? 1 oraz item o id 2160 ilo?? 75
Za wej?cie do niego 2 playera item o id yyyy ilo?? 1 oraz item o id 2160 ilo?? 50
Za wej?cie do niego 3 playera item o id zzzz ilo?? 1 oraz item o id 2160 ilo?? 25
Za wej?cie do niego pozosta?ych graczy item o id 2160 ilo?? 25

2)
Kratka ,kt?ra jak si? na ni? ustanie nic nie robi przez 5sec ,a po 5 sec przenosi do temple / z napisem tak jak u monstera Przegra?e? ! :d


3) Poniewa? ten silnik co mam to chyba najstarszy tfs bo mody ledwo dzia?aj? :c ,a d?ugo na nim robi? to prosz? o podes?anie linku do najnowszego tylko ,aby by? z postaci? goda !

Z g?ry dzi?ki za pomoc rep +
 
Odp: Skrypt 8.6 - Event

Kod:
xxx = 0

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
if xxx == 0 then -- 1 player
doPlayerAddItem(cid, xxxx, 1)
doPlayerAddItem(cid, 2160, 75)
xxx = xxx + 1
elseif xxx == 1 then -- 2 player
blabla
elseif xxx == 2 then -- 3 player
blabla
elseif xxx >= 3 then -- pozostali playerzy
blabla
end
return true
end


Zrob sobie XML ^^

Mysle, ze to bedzie cos takiego : to jest ten 1 skrypt.
 
Odp: Skrypt 8.6 - Event

2)
Kod:
function teleport()
doTeleportThing(cid,{x=1000,y=1000,z=1000})
doCreatureSay(cid, "Yeasdasdas")  -- chyba jakos tak to szlo.
end
function onStepIn(cid, item, pos)
addEvent(teleport, 5000)
return true
end

Nie wiem czy zadziala bo dawno w lapach lua nie mialem :P
 
Odp: Skrypt 8.6 - Event

[MENTION=412445]Logit3ch[/MENTION] nwm gdzie tu sens jest bo w tym skrypcie widz? ,?e ten sam item idzie do ka?dej osoby xd oraz nwm jak z tego xml zrobi? :D
[MENTION=27659]mati280[/MENTION] nie o to mi chodzi chce aby kratka przenosi?a znowu nic 5sec nie robi?a i znowu przenosi?a :d

---------- Tre?? dodana o 11:15 ----------

chc? co takiego tylko w wersji lua bo ja skrypterem nie jestem : Moje arcydzie?o xD
PHP:
  function onStepIn(cid, item, frompos, item2, topos)

xxxx = 1p
yyyy = 2p
zzzz = 3p
cccc >= 4p

if xxxx == 1p then -- 1 player
doPlayerAddItem(cid, 2160, 75)
doPlayerAddItem(cid, item, 1)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Otrzyma?es 25cc ,oraz 1 item")
if yyyy == 2p then -- 2 player
doPlayerAddItem(cid, 2160, 50)
doPlayerAddItem(cid, item, 1)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Otrzyma?es 25cc ,oraz 1 item")
if zzzz == 3p then -- 3 player
doPlayerAddItem(cid, 2160, 25)
doPlayerAddItem(cid, item, 1)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Otrzyma?es 25cc ,oraz 1 item")
elseif cccc >= 4p then -- pozostali
doPlayerAddItem(cid, 2160, 25)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Otrzyma?es 25cc")
end
return true
end
 
Ostatnia edycja:
Odp: Skrypt 8.6 - Event

[LUA]
function teleportback()
doTeleportThing(cid,{x=1001,y=1001,z=7})
doCreatureSay(cid, "You are back!", TALKTYPE_ORANGE_1)
end

function teleport()
doTeleportThing(cid,{x=1000,y=1000,z=7})
doCreatureSay(cid, "You are teleporting!", TALKTYPE_ORANGE_1)
addEvent(cid, teleportback, 5000)
end

function onStepIn(cid, item, pos)
addEvent(teleport, 5000)
return true
end[/LUA]

Cos teges
 
Ostatnia edycja:
Odp: Skrypt 8.6 - Event

[MENTION=46735]mistrz440[/MENTION] konsola :
[30/05/2015 11:39:06] [Error - MoveEvents Interface]
[30/05/2015 11:39:06] In a timer event called from:
[30/05/2015 11:39:06] data/movements/scripts/tpevent2.lua:onStepIn
[30/05/2015 11:39:06] Description:
[30/05/2015 11:39:06] (luaDoTeleportThing) Thing not found

[30/05/2015 11:39:06] [Error - MoveEvents Interface]
[30/05/2015 11:39:06] In a timer event called from:
[30/05/2015 11:39:06] data/movements/scripts/tpevent2.lua:onStepIn
[30/05/2015 11:39:06] Description:
[30/05/2015 11:39:06] (luaDoCreatureSay) Creature not found

[30/05/2015 11:39:06] [Error - MoveEvents Interface]
[30/05/2015 11:39:06] In a timer event called from:
[30/05/2015 11:39:06] data/movements/scripts/tpevent2.lua:onStepIn
[30/05/2015 11:39:06] Description:
[30/05/2015 11:39:06] (luaAddEvent) Callback parameter should be a function.

[30/05/2015 11:39:07] [Error - MoveEvents Interface]
[30/05/2015 11:39:07] In a timer event called from:
[30/05/2015 11:39:07] data/movements/scripts/tpevent2.lua:onStepIn
[30/05/2015 11:39:07] Description:
[30/05/2015 11:39:07] (luaDoTeleportThing) Thing not found

[30/05/2015 11:39:07] [Error - MoveEvents Interface]
[30/05/2015 11:39:07] In a timer event called from:
[30/05/2015 11:39:07] data/movements/scripts/tpevent2.lua:onStepIn
[30/05/2015 11:39:08] Description:
[30/05/2015 11:39:08] (luaDoCreatureSay) Creature not found

[30/05/2015 11:39:08] [Error - MoveEvents Interface]
[30/05/2015 11:39:08] In a timer event called from:
[30/05/2015 11:39:08] data/movements/scripts/tpevent2.lua:onStepIn
[30/05/2015 11:39:08] Description:
[30/05/2015 11:39:08] (luaAddEvent) Callback parameter should be a function.

[30/05/2015 11:39:08] [Error - MoveEvents Interface]
[30/05/2015 11:39:08] In a timer event called from:
[30/05/2015 11:39:08] data/movements/scripts/tpevent2.lua:onStepIn
[30/05/2015 11:39:08] Description:
[30/05/2015 11:39:08] (luaDoTeleportThing) Thing not found

[30/05/2015 11:39:08] [Error - MoveEvents Interface]
[30/05/2015 11:39:09] In a timer event called from:
[30/05/2015 11:39:09] data/movements/scripts/tpevent2.lua:onStepIn
[30/05/2015 11:39:09] Description:
[30/05/2015 11:39:09] (luaDoCreatureSay) Creature not found

[30/05/2015 11:39:09] [Error - MoveEvents Interface]
[30/05/2015 11:39:09] In a timer event called from:
[30/05/2015 11:39:09] data/movements/scripts/tpevent2.lua:onStepIn
[30/05/2015 11:39:09] Description:
[30/05/2015 11:39:09] (luaAddEvent) Callback parameter should be a function.

co do 1 skryptu napisa?em i dzia?a tylko ,?e uznaje 3funkcje za 1 i daje mi all itemy w skrypcie ,odpu?ci?em sobie wszystkich player?w xd :
function onStepIn(cid, item, frompos, item2, topos)

xxxx = 1
yyyy = 2
zzzz = 3

if xxxx == 1 then -- 1 player
doPlayerAddItem(cid, 2160, 75)
doPlayerAddItem(cid, 10502, 1)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Otrzyma?es 25cc ,oraz 1 iniumx ring")

end

if yyyy == 2 then -- 2 player
doPlayerAddItem(cid, 2160, 50)
doPlayerAddItem(cid, 10502, 1)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Otrzyma?es 25cc ,oraz 1 iniumx ring")

end

if zzzz == 3 then -- 3 player
doPlayerAddItem(cid, 2160, 25)
doPlayerAddItem(cid, 10502, 1)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Otrzyma?es 25cc ,oraz 1 iniumx ring")
end
return true
end
 
Odp: Skrypt 8.6 - Event

Nie wyczymie ... to? podstaw sobie pod kazde "bla bla" doPlayerAddItem, z Twoim ID Itema z Twoja iloscia tego itema!! -.-
Po to dodalem komentarze, abys wiedzial kiedy wchodzi player 1 player 2 player 3 itd...

Dzi?ys XD


A to co IMAG napisales w prawdzie nie ma prawa dzialac... Nigdzie nie nadajsz ZZZ YYY czy chocby tego XXX ...

Pomysl troche jak cos robisz - jezeli chcesz, ze 3 playerow tylko ma wejsc a reszta 'taki wa?', to sprawdzaj czy ten gracz wszedl poprzez globaln? xxx :

if xxx == 0 then -- nie wszedl nikt, czyli wchodzi 1 player
daj mu item jaki tam chcesz
elseif xxx == 1 then -- wszedl 1 player, wchodzi drugi
daj mu to co tam chcesz

elseifujesz tak ile chcesz, a jak chcesz ze powyzej np. 4 gracza juz nikt nie dostanie itema tylko cc to :

elseif xxx >= 4 then
dajesz mu cc
 
Ostatnia edycja:
Odp: Skrypt 8.6 - Event

[MENTION=412445]Logit3ch[/MENTION]
[30/05/2015 12:03:58] [Error - LuaScriptInterface::loadFile] data/movements/scripts/tpevent.lua:13: 'end' expected (to close 'function' at line 1) near 'elseif'
[30/05/2015 12:03:58] [Warning - Event::loadScript] Cannot load script (data/movements/scripts/tpevent.lua)
[30/05/2015 12:03:58] data/movements/scripts/tpevent.lua:13: 'end' expected (to close 'function' at line 1) near 'elseif'

a napisa?em tak jak m?wi?e? :
function onStepIn(cid, item, frompos, item2, topos)

xxx = 0


if xxx == 0 then -- 1 player
doPlayerAddItem(cid, 2160, 75)
doPlayerAddItem(cid, 10502, 1)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Otrzyma?es 75cc ,oraz 1 iniumx ring")

end

elseif xxx == 1 then -- 2 player
doPlayerAddItem(cid, 2160, 50)
doPlayerAddItem(cid, 10502, 1)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Otrzyma?es 50cc ,oraz 1 iniumx ring")

end

elseif xxx == 2 then -- 3 player
doPlayerAddItem(cid, 2160, 25)
doPlayerAddItem(cid, 10502, 1)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Otrzyma?es 25cc ,oraz 1 iniumx ring")

end

elseif xxx >= 3 then -- pozostali player
doPlayerAddItem(cid, 2160, 25)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Otrzyma?es 25cc")
end
return true
end
 
Ostatnia edycja:
Odp: Skrypt 8.6 - Event

facepalm i to taki porzadny...


TYLKO 2 endy a nie pisiont, poczytaj o podstawach.

End ma byc nad return true i pod return true i tylko tam !!!!
 
Odp: Skrypt 8.6 - Event

[MENTION=412445]Logit3ch[/MENTION]
dobra to teraz mi powiec jak zrobi? aby czynno?? si? nie powtarza?a -_-
bo wchodz? 1 graczem daje to 1 wchodz? 2 graczem i znowu to daje :P
 
Odp: Skrypt 8.6 - Event

pododawaj pod kazdym elseif

xxx = xxx + 1 ^^

---------- Tre?? dodana o 12:28 ----------

I pod ifem tez ...
 
Odp: Skrypt 8.6 - Event

[MENTION=412445]Logit3ch[/MENTION]
Nadal to samo :P
 
Odp: Skrypt 8.6 - Event

Pokaz mi ten kod ... I XML
 
Odp: Skrypt 8.6 - Event

[MENTION=412445]Logit3ch[/MENTION]
function onStepIn(cid, item, frompos, item2, topos)

xxx = 0


if xxx == 0 then -- 1 player
doPlayerAddItem(cid, 2160, 75)
doPlayerAddItem(cid, 10502, 1)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Otrzyma?es 75cc ,oraz 1 iniumx ring")
xxx = xxx + 1

elseif xxx == 1 then -- 2 player
doPlayerAddItem(cid, 2160, 50)
doPlayerAddItem(cid, 10502, 1)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Otrzyma?es 50cc ,oraz 1 iniumx ring")
xxx = xxx + 1

elseif xxx == 2 then -- 3 player
doPlayerAddItem(cid, 2160, 25)
doPlayerAddItem(cid, 10502, 1)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Otrzyma?es 25cc ,oraz 1 iniumx ring")
xxx = xxx + 1

elseif xxx >= 3 then -- pozostali player
doPlayerAddItem(cid, 2160, 25)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Otrzyma?es 25cc")
xxx = xxx + 1
end
return true
end

<movevent type="StepIn" uniqueid="6576" event="script" value="tpevent.lua"/>
 
Odp: Skrypt 8.6 - Event

[LUA]
xxx = 0

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


if xxx == 0 then -- 1 player
doPlayerAddItem(cid, 2160, 75)
doPlayerAddItem(cid, 10502, 1)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Otrzyma?es 75cc ,oraz 1 iniumx ring")
xxx = xxx + 1

elseif xxx == 1 then -- 2 player
doPlayerAddItem(cid, 2160, 50)
doPlayerAddItem(cid, 10502, 1)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Otrzyma?es 50cc ,oraz 1 iniumx ring")
xxx = xxx + 1

elseif xxx == 2 then -- 3 player
doPlayerAddItem(cid, 2160, 25)
doPlayerAddItem(cid, 10502, 1)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Otrzyma?es 25cc ,oraz 1 iniumx ring")
xxx = xxx + 1

elseif xxx >= 3 then -- pozostali player
doPlayerAddItem(cid, 2160, 25)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Otrzyma?es 25cc")
end
return true
end
[/LUA]

Pozmieniaj sobie na probe ID Itemkow i sprobuj jeszcze raz
 
Odp: Skrypt 8.6 - Event

Dzia?a chyba nie mo?e by? takich wielkich id?w jak 10502 :D
Musisz rozda? troch? punkt?w innym u?ytkownikom zanim b?dzie mo?na przyzna? punkty Logit3ch. hehe


Poszukuje jeszcze tych innych skrypt?w w temacie :D
 
Odp: Skrypt 8.6 - Event

Kod:
function teleportback()
doTeleportThing(cid,{x=1001,y=1001,z=7})
doCreatureSay(cid, "You are back!", TALKTYPE_ORANGE_1)  
end

function teleport()
doTeleportThing(cid,{x=1000,y=1000,z=7})
doCreatureSay(cid, "You are teleporting!", TALKTYPE_ORANGE_1)  
addEvent(teleportback, 5000, cid)
end

function onStepIn(cid, item, pos)
addEvent(teleport, 5000, cid)
return true
end
 
Status
Zamknięty.
Back
Do góry