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

Wysłany: 2014-11-22, 17:39


MKHB







Wiek: 31
Na forum: 4255 dni
Posty: 22
Nick w MP: TheMCMKHB

Piwa: 1

Respekt: 50

Witajcie! mam problemos ;d bo tak pisa?em sobie taki skrpt ?e jak klikn? wyceluj? w auto i klikn? lewym to niszczy auto a prawym naprawia mam o to taki kod lecz nie dzia?a . wgra?em to pod suszrk? kt?r? mam podmianion? na silenced
oto kod

naprawa:

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


niszczenie:

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

co tu nie tak za odp daje :piwo:

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-11-23, 13:02


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4395 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

Spr?buj tym eventem :


Więcej informacji znajdziesz w Wikipedii MTA:

onElementClicked


Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-11-23, 15:28


MKHB







Wiek: 31
Na forum: 4255 dni
Posty: 22
Nick w MP: TheMCMKHB

Piwa: 1

Respekt: 50

eh pr?bowa?em ju? tak i nic :(

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-11-23, 15:30


Jacob

Głupiomądry






Wiek: 28
Na forum: 5502 dni
Posty: 967
Nick w MP: Jacob

Piwa: 786

Respekt: 212,3
Respekt: 212,3Respekt: 212,3

U?yj to co poda? Shuffle ale skrypt umie?? po stronie servera. Oczywi?cie musisz r?wnie? zedytowa? kod nie u?ywaj?c zdarze? clientowskich.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-11-23, 15:34


MKHB







Wiek: 31
Na forum: 4255 dni
Posty: 22
Nick w MP: TheMCMKHB

Piwa: 1

Respekt: 50

ehh czy m?gby? mi to Zedytowa? bo jestem w tym bardzo kiepski dopiero si? ucz?.. dam piffko

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-11-23, 15:40


Jacob

Głupiomądry






Wiek: 28
Na forum: 5502 dni
Posty: 967
Nick w MP: Jacob

Piwa: 786

Respekt: 212,3
Respekt: 212,3Respekt: 212,3

addEventHandler "onElementClicked"root,
    function ( mouseButton )
        local elementType getElementType source )
        if ( elementType == "vehicle" then
            if ( mouseButton == "left" then -- niszczenie
                destroyElement source )
            elseif ( mouseButton == "right" then -- naprawa
                fixVehicle source )
            end
        elseif ( elementType == "player" then
            local car getPedOccupiedVehicle source )
            if ( mouseButton == "left" then -- niszczenie
                destroyElement car )
            elseif ( mouseButton == "right" then -- naprawa
                fixVehicle car )
            end
        end
    end
)

Daj b??dy w debugu je?eli nie dzia?a.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-11-23, 15:56


MKHB







Wiek: 31
Na forum: 4255 dni
Posty: 22
Nick w MP: TheMCMKHB

Piwa: 1

Respekt: 50

eh nie dzia?a i db3 nic nie pokazuj? ja mam suszarke z https://community.multitheftauto.com/index.php?p=resources&s=details&id=8429
help plis

[ Dodano: 2014-11-23, 16:04 ]
A najlepsze jest to ?e jak wejde do auta i wejd? do panelu admina i klikne lewy lub prawy to dzia?a ;d nwm co jest ;d

[ Dodano: 2014-11-23, 16:06 ]
wystarczy ?e klikne p i wyceluj? w jakie? auto i mi je niszczy lub naprawia a ja chce ?eby t? suszark? wycelowa? i naprawia?/niszczy? ;d

[ Dodano: 2014-11-23, 16:15 ]
prosze kod ca?y :

function isPedAiming thePedToCheck )
    if isElement(thePedToCheckthen
        if getElementType(thePedToCheck) == "player" or getElementType(thePedToCheck) == "ped" then
            if getPedTask(thePedToCheck"secondary"0) == "TASK_SIMPLE_USE_GUN" then
                return true
            end
        end
    end
    return false
end

function blockShoot()
    if getPedWeapon(localPlayer) == 23 then
        toggleControl("fire"false)
    else
        toggleControl("fire"true)
    end
end

addEventHandler("onClientRender"rootblockShoot)

addEventHandler "onElementClicked"root,
    function ( mouseButton )
        local elementType getElementType source )
        if ( elementType == "vehicle" then
            if ( mouseButton == "left" then -- niszczenie
                destroyElement source )
            elseif ( mouseButton == "right" then -- naprawa
                fixVehicle source )
            end
        elseif ( elementType == "player" then
            local car getPedOccupiedVehicle source )
            if ( mouseButton == "left" then -- niszczenie
                destroyElement car )
            elseif ( mouseButton == "right" then -- naprawa
                fixVehicle car )
            end
        end
    end
)

meta.xml:


<meta>
    <info type="script" name="Get Speed Tool" version="1.0.1" author="Prorok" />
    <script src="aim.lua" type="server"/>
    <script src="replace.lua" type="client"/>
    <script src="info.luac" type="client"/>
    <file src="colt45.dff" />
    <file src="colt45.txd" />
</meta>


Postaw piwo autorowi tego posta
 

 
Tagi: suszarka :: niszczenie :: naprawa
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