Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2015-08-13, 14:19


sebik2303

Mapper :)






Wiek: 25
Na forum: 4160 dni
Posty: 298
Nick w MP: sebik2303

Piwa: 899

Respekt: 55,3

Witam, chcia?bym zrobi? suszark? administratora, tam b?dzie si? wy?wietla?o np. ID, aby da?o si? naprawi? pojazd itp


Za pomoc daje :arrow: :piwo: oraz :arrow: R*

[ Dodano: 2015-08-13, 14:45 ]
mam ju? na naprawe lecz nie dzia?a :/
 addEventHandler "onClientClick"root, function( buttonstate_____element ) 
    if element then
        if button == "right" and state == "down" and getElementType(element) == "vehicle" then
            if getPedWeapon getLocalPlayer() ) == 24 then
                fixVehicle element )
            end
        end
    end
end )

Brak DB

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-13, 15:54


Rudy.

Webmaster/LUA






Wiek: 27
Na forum: 4304 dni
Posty: 43
Nick w MP: Rudy

Piwa: 1739

Respekt: 25,8

Ostrzeżeń: 40%
Kod:


if typ == "vehicle" then
if selected == 1 then
_,_,rz=getElementRotation(el)
fixVehicle(el)
setElementHealth(el,1000)
setElementRotation(el,0,0,rz)
outputChatBox("Naprawi?e?/a? pojazd.", source)
end



Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-14, 15:40


sebik2303

Mapper :)






Wiek: 25
Na forum: 4160 dni
Posty: 298
Nick w MP: sebik2303

Piwa: 899

Respekt: 55,3

Rudy., Nie dzia?a mi :/

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-14, 15:52


#404







Wiek: 26
Na forum: 4771 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%
O ile si? nie myle, onClientClick odnosi sie do klikniecia kursorem (tym z showCursor)

Jezeli chcesz aby poprzez wycelowanie i klikniecie np lewy to musisz zbindowac lewy myszki i sprawdzic bron, cel czy jest, jezeli pojazd lecisz dalej w kodzie i naprawiasz

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-15, 01:42


sebik2303

Mapper :)






Wiek: 25
Na forum: 4160 dni
Posty: 298
Nick w MP: sebik2303

Piwa: 899

Respekt: 55,3

DestroY,
bindKey("right","down",fixVehicle 

Takk ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-15, 11:50


#404







Wiek: 26
Na forum: 4771 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%
"sebik2303" napisał/a:

DestroY,
bindKey("right","down",fixVehicle 

Takk ?


bindKey("mouse1","down",nazwafunkcji)


A w tej funkcji musisz pobrac cel gracza, bron jakiej uzywa i jezeli jest to pojazd i bron np o id 22 to naprawiasz pojazd

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-17, 22:15


sebik2303

Mapper :)






Wiek: 25
Na forum: 4160 dni
Posty: 298
Nick w MP: sebik2303

Piwa: 899

Respekt: 55,3

DestroY, a pomo?esz ? :)

[ Dodano: 2015-08-17, 22:18 ]
p.s. mam db z mouse1

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-18, 13:19


#404







Wiek: 26
Na forum: 4771 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%
"sebik2303" napisał/a:

DestroY, a pomo?esz ? :)

[ Dodano: 2015-08-17, 22:18 ]
p.s. mam db z mouse1


Poka? kod, co zmajstrowa?e?, a wyt?umaczymy b??dy no i pomo?emy naprawi?.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-18, 23:26


sebik2303

Mapper :)






Wiek: 25
Na forum: 4160 dni
Posty: 298
Nick w MP: sebik2303

Piwa: 899

Respekt: 55,3

DestroY, Wi?c :)
server:

 addEventHandler "onClientClick"root, function( buttonstate_____element ) 
    if element then
        if button == "mouse1" and state == "down" and getElementType(element) == "vehicle" then
            if getPedWeapon getLocalPlayer() ) == 22 then
                fixVehicle element )
                
            end
        end
    end
end )


if typ == "vehicle" then
if selected == 1 then
_,_,rz=getElementRotation(el)
fixVehicle(el)
setElementHealth(el,1000)
setElementRotation(el,0,0,rz)
outputChatBox("Naprawi?e?/a? pojazd."source)
bindKey("mouse1","down",fixVehicle)
end
end



Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-19, 01:58


#404







Wiek: 26
Na forum: 4771 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%
C?? nie wiem co zmajstrowa?e?, ale dla mnie to r?ce i nogi ma amputowane xD

Ja to uj??em tak:


addEventHandler"onClientKey"root,

function(button,press) 
    if getPedWeapon getLocalPlayer() ) == 22 then
                if button == "mouse1"  then
                        target getPedTarget(getLocalPlayer())
                        if target then
                            typ getElementType(target)
                                    if typ == "vehicle" then
                                        fixVehicle(target)
                                    
                                    
                                    
                                    end
                        end
                end
    end
                                                end)


Nie testowane co prawda, ale powinno dzia?a?, w razie czego pisz.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-19, 18:28


sebik2303

Mapper :)






Wiek: 25
Na forum: 4160 dni
Posty: 298
Nick w MP: sebik2303

Piwa: 899

Respekt: 55,3

DestroY, wiem, wiem. Lecz nie dzia?a :(


//Jakie? b??dy w db3 ? //DestroY^

[ Dodano: 2015-08-21, 18:51 ]
DestroY, Brak DB

Ostatnio zmieniony przez #404 2015-08-19, 19:15, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-08, 20:57


Tomeg123







Wiek: 32
Na forum: 4067 dni
Posty: 26

Piwa: 83

Respekt: 80

Ostrzeżeń: 100%
"DestroY" napisał/a:

C?? nie wiem co zmajstrowa?e?, ale dla mnie to r?ce i nogi ma amputowane xD

Ja to uj??em tak:


addEventHandler"onClientKey"root,

function(button,press) 
    if getPedWeapon getLocalPlayer() ) == 22 then
                if button == "mouse1"  then
                        target getPedTarget(getLocalPlayer())
                        if target then
                            typ getElementType(target)
                                    if typ == "vehicle" then
                                        fixVehicle(target)
                                    
                                    
                                    
                                    end
                        end
                end
    end
                                                end)


Nie testowane co prawda, ale powinno dzia?a?, w razie czego pisz.

Nie dzia?a - podpinam si? do pro?by jego. Prosz? o pomoc ;c

Postaw piwo autorowi tego posta
 

 
Tagi: suszarka :: administratora
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku