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

Wysłany: 2021-01-24, 14:30


filip0985

Początkujący w LUA






Wiek: 22
Na forum: 2754 dni
Posty: 112

Piwa: 13

Respekt: 50

Witam mam pytanie jak zrobi? usuwanie pojazdu tylko dal jednej osoby.



destroyElement(auto)


Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-01-24, 16:36


TheSebaPL

Mod-team






Wiek: 21
Na forum: 3098 dni
Posty: 964

Piwa: 3102

Respekt: 640,5
Respekt: 640,5Respekt: 640,5

filip0985, masz w admins komend? tak?:


addCommandHandler("dv", function(plr,cmd)
    if getAdmin(plr,4) or  getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1then
        if getElementData(plr"player:admin"then
            local veh=getPedOccupiedVehicle(plr)
            if not veh then
                outputChatBox("Musisz by? w aucie!"plr,255,255,255,ture)
                return
            end
            if getElementData(veh,"vehicle:spawn"then
                outputChatBox("Nie mo?esz usun?? tego pojazdu."plr255255255,true)
                return
            end
            destroyElement(veh)
            outputChatBox("Usun??e? pojazd."plr,255,255,255,true)
        end
    end
end)


Mo?esz te? sobie przerobi? pod serial np.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-01-24, 17:37


filip0985

Początkujący w LUA






Wiek: 22
Na forum: 2754 dni
Posty: 112

Piwa: 13

Respekt: 50



function zakonczonapraca(player,plr)
  if (getPlayerSkin(player) == 155then
        if getElementData(plr"player:admin"then
            local veh=getPedOccupiedVehicle(plr)
            if not veh then
                outputChatBox("Musisz by? w aucie!"plr,255,255,255,ture)
                return
            end
            if getElementData(veh,"vehicle:spawn"then
                outputChatBox("Nie mo?esz usun?? tego pojazdu."plr255255255,true)
                return
            end
            destroyElement(veh)
            outputChatBox("Usun??e? pojazd."plr,255,255,255,true)
        end
    end
end
addEvent("zakonczonapraca"true)
addEventHandler("zakonczonapraca"rootzakonczonapraca)



zrobi?em w taki spos?b ale nie dzia?a nic si? po prostu nie dzieje ani w debugu nie pokazuje,

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-01-24, 20:11


Wilq







Wiek: 24
Na forum: 4429 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Poka? jak triggerujesz event "zakonczonapraca"

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-01-24, 20:14


filip0985

Początkujący w LUA






Wiek: 22
Na forum: 2754 dni
Posty: 112

Piwa: 13

Respekt: 50




function zakonczprace() 
    guiSetVisible(przycisk,true)
    guiSetVisible(przycisk2,false)
    guiSetVisible(Okno,false)
    showCursor false )   
    triggerServerEvent("skin0"rootlocalPlayer)
    triggerServerEvent("zakonczonapraca"rootlocalPlayer)
    removeEventHandler("pizza",root,pizza)
    destroyElement(marker2)
    destroyElement (myBlip)


end




Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-01-25, 09:06


Wilq







Wiek: 24
Na forum: 4429 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

W funkcji zakonczonapraca masz 2 argumenty od gracza. Wiesz, ?e nie musisz ?adnego definiowa?, tylko u?y? po prostu "client" po serwerze?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-01-25, 09:15


filip0985

Początkujący w LUA






Wiek: 22
Na forum: 2754 dni
Posty: 112

Piwa: 13

Respekt: 50

a no zadzia?a?o. Dzi?kuje za pomoc

[ Dodano: 2021-01-25, 09:28 ]
tylko jest problem ?e nadal usuwa pojazd przeciwnej osobie zamiast samemu sobie

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-01-25, 09:31


Wilq







Wiek: 24
Na forum: 4429 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Poka? event i ten trigger po zmianach.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-01-25, 10:02


filip0985

Początkujący w LUA






Wiek: 22
Na forum: 2754 dni
Posty: 112

Piwa: 13

Respekt: 50


function zakonczonapraca(plr)
  if (getPlayerSkin(plr) == 155then
        if getElementData(plr"player:admin"then
            local veh=getPedOccupiedVehicle(plr)
            if not veh then
                outputChatBox("Musisz by? w aucie!"plr,255,255,255,ture)
                return
            end
            if getElementData(veh,"vehicle:spawn"then
                outputChatBox("Nie mo?esz usun?? tego pojazdu."plr255255255,true)
                return
            end
            destroyElement(veh)
            outputChatBox("Usun??e? pojazd."plr,255,255,255,true)
        end
    end
end
addEvent("zakonczonapraca"true)
addEventHandler("zakonczonapraca"rootzakonczonapraca)







    triggerServerEvent("zakonczonapraca"rootlocalPlayer)



nie wiem czy o to ci chodzi?

Postaw piwo autorowi tego posta
 

 
Tagi: usuwanie :: pojazdu :: jednej :: osobie
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Odpowiedz do tematu

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