![]() |
0 | ||
Nie wiem czy się nie mylę, bo nie sprawdzałem, ale w HTML a:hover stylizuje link po najechaniu na niego myszką. |
0 | ||
nic nie rozumiem |
![]() ![]() « Citoyen » 1467040080000
| 0 | ||
for nick in pairs(tfm.get.room.playerList) do system.bindMouse(nick, true) end function eventNewPlayer(nick) system.bindMouse(nick, true) end function eventMouse(nick, x, y) tfm.exec.setShamanObject(24, x, y, 0, 0, 0, false) end gdzie tu błąd? |
![]() ![]() « Consul » 1467040260000
| 0 | ||
Fpekal a dit : function eventNewPlayer(nick) system.bindMouse(nick, true) end for nick in pairs(tfm.get.room.playerList) do eventNewPlayer(nick) end function eventMouse(nick, x, y) tfm.exec.addShamanObject(24, x, y, 0, 0, 0, false) end |
![]() ![]() « Citoyen » 1467040560000
| 0 | ||
Rzeczywiście :O dzięki za szybką odpowiedź ;) --------------------------------------------------------------- system.disableChatCommandDisplay("duch", true) T01={} for nick in pairs(tfm.get.room.playerList) do system.bindMouse(nick, true) T01[nick]=0 end function eventNewPlayer(nick) system.bindMouse(nick, true) T01[nick]=0 end function eventChatCommand(nick, mess) if mess=="duch" and T01[nick]==0 then T01[nick]=1 end if mess=="duch" and T01[nick]==1 then T01[nick]=0 end end ehhh nie ogarniam dlaczego nie działa xd Dernière modification le 1467042180000 |
0 | ||
Janwojcik a dit : Zgadza się, dobrze myślisz, chociaż co do HTML tu jest raczej CSS, ale jedno wiąże się z drugim więc ok. Na początku pomyślałem sobie, że skoro da się użyć <a:hover></a> to może jakoś będzie dało się zmieniać kolor po najechaniu/kliknięciu tekstu, ale nic co próbowałem nie działało. Fpekal a dit : No cóż, pewnie dziwne, że żaden błąd nie wyskakuje, ale to dobrze, że nic nie wyskakuje bo w kodzie nie ma błędów, ale co do logiki działania to tu jednak jest. Zobacz co się dzieje gdy np. ja zrobię: [Ouake] !duch
if "duch"=="duch" and T01["Ouake"]==1 then
function eventChatCommand(nick, mess) if mess=="duch" and T01[nick]==0 then T01[nick]=1 elseif mess=="duch" and T01[nick]==1 then T01[nick]=0 end end A jeżeli nie są konieczne wartości liczbowe w tabeli T01, można uprościć kod w taki sposób: system.disableChatCommandDisplay("duch", true) T01={} for nick in pairs(tfm.get.room.playerList) do system.bindMouse(nick, true) end function eventNewPlayer(nick) system.bindMouse(nick, true) end function eventChatCommand(nick, mess) if mess=="duch" then T01[nick]=not(T01[nick]) end end |
![]() ![]() « Citoyen » 1467049440000
| 0 | ||
Dzięki właśnie się zastanawiałem po co to elseif, ale już wiem ;) /// Ouake a dit : według mnie powinno być: eventColorPicked(Int id, String nick, Color) szukałem jak mam wpisać kolor do programu i nigdzie takiej opcji nie było więc poszedłem na logikę i sprawdziłem czy się nie pomyliłeś ;) Dernière modification le 1467215160000 |
![]() 1467050580000
| | ||
[Modéré par Mesmera, raison : Podwójny] |
![]() ![]() « Consul » 1467372480000
| 0 | ||
gdzie mam błąd? bo nie chce działać prawidłowo, można zrobić ale się nie usuwa :/ function eventEmotePlayed(nick, odp) if odp==1 then ui.removeTextArea(0, nick) ui.removeTextArea(1, nick) ui.removeTextArea(2, nick) ui.removeTextArea(3, nick) ui.removeTextArea(4, nick) ui.removeTextArea(5, nick) end end function eventEmotePlayed(nick, klaw) if klaw==9 then ui.updateTextArea(nil) ui.addTextArea(0, "", nil, 267, 311, 197, 50, 0xd6d6d6, 0x0, 0.4) ui.addTextArea(1, "", nil, 279, 312, 14, 100, 0xffffff) ui.addTextArea(2, "", nil, 319, 313, 14, 100, 0xffffff) ui.addTextArea(3, "", nil, 361, 312, 14, 100, 0xffffff) ui.addTextArea(4, "", nil, 402, 312, 14, 100, 0xffffff) ui.addTextArea(5, "", nil, 441, 315, 14, 100, 0xffffff) end end Dernière modification le 1467372540000 |
![]() ![]() « Consul » 1467378360000
| 0 | ||
klakser a dit : Nie powtarzaj tych samych eventów: function eventEmotePlayed(nick, odp) if odp==1 then ui.removeTextArea(0, nick) ui.removeTextArea(1, nick) ui.removeTextArea(2, nick) ui.removeTextArea(3, nick) ui.removeTextArea(4, nick) ui.removeTextArea(5, nick) elseif odp==9 then --ui.updateTextArea(nil) <-- nie rozumiem po co to jest ui.addTextArea(0, "", nick, 267, 311, 197, 50, 0xd6d6d6, 0x0, 0.4) ui.addTextArea(1, "", nick, 279, 312, 14, 100, 0xffffff) ui.addTextArea(2, "", nick, 319, 313, 14, 100, 0xffffff) ui.addTextArea(3, "", nick, 361, 312, 14, 100, 0xffffff) ui.addTextArea(4, "", nick, 402, 312, 14, 100, 0xffffff) ui.addTextArea(5, "", nick, 441, 315, 14, 100, 0xffffff) end end |
![]() ![]() « Consul » 1467394380000
| 0 | ||
sebafrancuz a dit : dzięki, a dałoby się zrobić aby to działało na klawisze z,x,c? bo jak próbowałam to udało mi się tylko z emotkami z = tylko ui.addTextArea(0, "", nick, 267, 311, 197, 50, 0xd6d6d6, 0x0, 0.4) x = całość dodana c = usunięte bo jak próbuje przy tym majstrować to ciągle coś się psuje i nic nie wychodzi bo nie wiem czy to trzeba coś tam dodać czy nie |
![]() ![]() « Citoyen » 1467400800000
| 0 | ||
klakser a dit : function eventNewPlayer(n) system.bindKeyboard(n,87,true,true) system.bindKeyboard(n,88,true,true) system.bindKeyboard(n,67,true,true) end function eventKeyboard(n,klaw,wd,x,y) if klaw==87 then ui.addTextArea(0, "", nick, 267, 311, 197, 50, 0xd6d6d6, 0x0, 0.4) elseif klaw==88 ui.addTextArea(0, "", nick, 267, 311, 197, 50, 0xd6d6d6, 0x0, 0.4) ui.addTextArea(1, "", nick, 279, 312, 14, 100, 0xffffff) ui.addTextArea(2, "", nick, 319, 313, 14, 100, 0xffffff) ui.addTextArea(3, "", nick, 361, 312, 14, 100, 0xffffff) ui.addTextArea(4, "", nick, 402, 312, 14, 100, 0xffffff) ui.addTextArea(5, "", nick, 441, 315, 14, 100, 0xffffff) elseif klaw==67 then ui.removeTextArea(0, nick) ui.removeTextArea(1, nick) ui.removeTextArea(2, nick) ui.removeTextArea(3, nick) ui.removeTextArea(4, nick) ui.removeTextArea(5, nick) end end for n in pairs(tfm.get.room.playerList) do eventNewPlayer(n) end -- Nie mam jak sprawdzić czy działa, bo ban, ale powinno ;/ Dernière modification le 1467400860000 |
![]() ![]() « Consul » 1467401160000
| 0 | ||
pandamog a dit : To za bardzo nie zadziała, bo w paru miejscach zamiast "n" dałeś "nick" function eventNewPlayer(n) for i,v in pairs({67,87,88}) do system.bindKeyboard(n,v,true,true) end end function eventKeyboard(n,klaw,wd,x,y) if klaw==87 then ui.addTextArea(0, "", n, 267, 311, 197, 50, 0xd6d6d6, 0x0, 0.4) elseif klaw==88 ui.addTextArea(0, "", n, 267, 311, 197, 50, 0xd6d6d6, 0x0, 0.4) ui.addTextArea(1, "", n, 279, 312, 14, 100, 0xffffff) ui.addTextArea(2, "", n, 319, 313, 14, 100, 0xffffff) ui.addTextArea(3, "", n, 361, 312, 14, 100, 0xffffff) ui.addTextArea(4, "", n 402, 312, 14, 100, 0xffffff) ui.addTextArea(5, "", n, 441, 315, 14, 100, 0xffffff) elseif klaw==67 then for i = 0,5 do ui.removeTextArea(i, n) end end end for n in pairs(tfm.get.room.playerList) do eventNewPlayer(n) end Według mnie to powinno działać |
![]() ![]() « Consul » 1467446160000
| 0 | ||
nie działa jest cały czas ten błąd Init Error : [string "Klakser.lua"]:11: 'then' expected Dernière modification le 1467450720000 |
![]() ![]() « Consul » 1467451620000
| 0 | ||
klakser a dit : Sorki nie zauważyłem, nie było na 11 linijce "then" elseif klaw==88 then |
![]() ![]() « Consul » 1467451740000
| 0 | ||
ja sama dodałam tam then i następny błąd: Init Error : [string "Klakser.lua"]:15: ')' expected |
![]() ![]() « Citoyen » 1467456300000
| 0 | ||
klakser a dit : Pokarz jaki wklejasz kod |
![]() ![]() « Consul » 1467457140000
| 0 | ||
pandamog a dit : Już błąd jest naprawiony |
![]() ![]() « Citoyen » 1467457260000
| 0 | ||
sebafrancuz a dit : super :-) |
![]() ![]() « Citoyen » 1467486420000
| 0 | ||
Proszę o przykład z użyciem funkcji: tfm.exec.addPhysicObject() -------------------------------------------------------------------------------- kolejny błąd ;-; for nick in pairs(tfm.get.room.playerList) do system.bindMouse(nick, true) system.bindKeyboard(nick, 88, true) end function eventMouse(nick, x, y) tfm.exec.movePlayer(nick, x, y) tfm.exec.addPhysicObject(0, x, y+20, {0, 100, 5, false, 0.5, 0, 0, 0, true, false}) end funtion eventKeyboard(nick, klaw) if klaw==88 then tfm.exec.removePhysicObject(0) end end Ten kod miał przenosić gracza i kłaść deskę (testowałem z tym) o 20 jednostek niżej od kliknięcia myszką, a pod klawiszem X miała być kasowana. ------------------------------------------------------------------------------------- okej znalazłem mój błąd napisałem "funtion" zamiast "function" ------------------------------------------------------------------------------------- ehhh... okazało się że źle zrobiłem ten grunt bo powinien inaczej wyglądać :/ ------------------------------------------------------------------------------------ no dobra poradziłem sobie samemu Dernière modification le 1467496980000 |