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

Wysłany: 2016-05-17, 16:44


Atroth







Wiek: 23
Na forum: 3677 dni
Posty: 1089
Nick w MP: Atroth

Piwa: 4808

Respekt: 540
Respekt: 540

Cze??, jak m?g?bym przerobi? ten skrypt ?eby zablokowa? DM dla broni o id 22, ale tak ?eby mo?na by?o celowa?.


function disableFireForColt theVehicleseatjacked )
    if ( getElementModel theVehicle ) == 22 then -- if they entered a hydra
        toggleControl source"vehicle_secondary_fire"false ) -- disable their fire key
    else -- if they entered another vehicle
        toggleControl source"vehicle_secondary_fire"false ) -- enable their fire key
    end
end
addEventHandler "onPlayerVehicleEnter"getRootElement(), disableFireForColt )

function disableFireForColt theVehicleseat )
    if ( getElementModel theVehicle ) == 22 then -- if they entered a hydra
        toggleControl "vehicle_secondary_fire"false ) -- disable their fire key
    else -- if they entered another vehicle
        toggleControl "vehicle_secondary_fire"false ) -- enable their fire key
    end
end
addEventHandler "onClientPlayerVehicleEnter"getLocalPlayer(), disableFireForColt )


Ostatnio zmieniony przez Atroth 2016-05-17, 16:46, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-05-17, 16:46


Emm

***** ***






Wiek: 32
Na forum: 3880 dni
Posty: 3191
Nick w MP: Emm

Piwa: 6162

Respekt: 1580
Respekt: 1580Respekt: 1580


   Administrator: Admin ma zawsze rację | REGULAMIN FORUM | REKLAMA/VIP | .

Więcej informacji znajdziesz w Wikipedii MTA:

toggleControl


Podpis

Użytkownik: 20.10.2015r
GTAO Member: 06.03.2016r
Support-Team: 20.01.2016r
Moderator: 30.03.2016r
Mod-Team: 08.10.2016r
Vice Admin: 04.05.2018r
Administrator: 03.05.2022r


! Koniecznie zapoznaj się z regulaminem forum.
Pamiętaj, aby zawsze go przestrzegać, nie mniej ważne są również regulaminy działów, w których się wypowiadasz!
Zamiast zakładać temat po kilka razy, bo jest usuwany przez Administrację, przejrzyj regulamin i napisz poprawnie temat!
Sprawy z administracją możesz załatwiać anonimowo w tym dziale.
Najważniejsze informacje od Administracji możesz przeczytać tutaj oraz tutaj.
Ostatnio zmieniony przez Emm 2016-05-17, 17:28, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-05-17, 16:47


Atroth







Wiek: 23
Na forum: 3677 dni
Posty: 1089
Nick w MP: Atroth

Piwa: 4808

Respekt: 540
Respekt: 540

Du?o mi to m?wi i na pewno wiem co mam zmieni?....

Podpis

Użytkownik - 10-05-2016
Support Team - 17.06.2017
Moderator - 25.11.2017
Mod-Team - 02.07.2018

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-05-17, 17:25


_Wicek_

Majstersztyk






Wiek: 25
Na forum: 4260 dni
Posty: 747
Nick w MP: Wicek

Piwa: 1841

Respekt: 360,5
Respekt: 360,5Respekt: 360,5Respekt: 360,5Respekt: 360,5

Ostrzeżeń: 40%
Na wiki masz ?adnie wszystko opisane wraz z przyk?adem.

Podpis

Support-Team: 25.01.2016
Moderator: 10.07.2016




GG: 51274621
Skype : kuba_wicinski
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-05-17, 20:04


Atroth







Wiek: 23
Na forum: 3677 dni
Posty: 1089
Nick w MP: Atroth

Piwa: 4808

Respekt: 540
Respekt: 540

Nie ka?dy ma perfect english 100%

[ Dodano: 2016-05-17, 20:19 ]
Po wielu pr?bach stworzy?em co? takiego. Chc? aby da?o si? celowa?, ale nie strzela?.


function disableMinigunOnSwitch prevSlotnewSlot )
    if getPedWeapon(getLocalPlayer(),newSlot) == 22 then --if the switched weapon is the minigun
        toggleControl "aim_weapon"true ) --disable the aim button
    else --if it isnt the minigun
        toggleControl "aim_weapon"false ) --renable the aim button
    end
end
addEventHandler "onClientPlayerWeaponSwitch"getRootElement(), disableMinigunOnSwitch )


Podpis

Użytkownik - 10-05-2016
Support Team - 17.06.2017
Moderator - 25.11.2017
Mod-Team - 02.07.2018

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-05-18, 16:14


_Wicek_

Majstersztyk






Wiek: 25
Na forum: 4260 dni
Posty: 747
Nick w MP: Wicek

Piwa: 1841

Respekt: 360,5
Respekt: 360,5Respekt: 360,5Respekt: 360,5Respekt: 360,5

Ostrzeżeń: 40%
Podpis

Support-Team: 25.01.2016
Moderator: 10.07.2016




GG: 51274621
Skype : kuba_wicinski
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-05-18, 20:28


Atroth







Wiek: 23
Na forum: 3677 dni
Posty: 1089
Nick w MP: Atroth

Piwa: 4808

Respekt: 540
Respekt: 540

Stworzy?em taki skrypt, ale jak wchodze na serwer to moge DM, ale jak go restartuje to nie moge.


function disableColt45OnSwitch prevSlotnewSlot )
    if getPedWeapon(getLocalPlayer(),newSlot) == 22 then --if the switched weapon is the minigun
        toggleControl "aim_weapon"true  ) --disable the aim button
        toggleControl("fire"false)
        toggleControl("action"false)
    else --if it isnt the minigun
        toggleControl("fire"true)
        toggleControl("action"true)
        toggleControl "aim_weapon"true )
    end
end
addEventHandler "onClientPlayerWeaponSwitch"getRootElement(), disableColt45OnSwitch )



[ Dodano: 2016-05-19, 15:43 ]
Doczekam si? odpowiedzi?

Podpis

Użytkownik - 10-05-2016
Support Team - 17.06.2017
Moderator - 25.11.2017
Mod-Team - 02.07.2018

Postaw piwo autorowi tego posta
 

 
Tagi: blokada
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