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

Wysłany: 2017-06-28, 11:18


admiral123







Wiek: 29
Na forum: 3276 dni
Posty: 16

Piwa: 1

Respekt: 50

Ostrzeżeń: 100%
Witam mam problem z tym kawa?kiem kodu, wszystkie elementdaty sie zgadzaj? lecz, pisze mi, ?e nie jestem w?a?cicielem a nim jestem. Prosze o pomoc

    for _,vehicle in ipairs(getElementsByType("vehicle")) do
        if tonumber(getElementData(vehicle,"vehicle:id")) == tonumber(idthen
            if tonumber(getElementData(vehicle,"vehicle:ownedPlayer")) ~= tonumber(getElementData(source,"player:uid")) then
            outputChatBox("* Nie jeste? w?a?cicielem tego pojazdu."source25500)
            return
            end
            sprzedazPojazdu[target]={source,target,vehicle,koszt}            
        end
    end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-06-28, 11:47


eject

kurdebele






Wiek: 30
Na forum: 3659 dni
Posty: 182
Nick w MP: EjecT

Piwa: 2456

Respekt: 85,8

Ostrzeżeń: 60%
Kod wygl?da na dobrze, lecz spr?buj usunac tonumber przed datami:


    for _,vehicle in ipairs(getElementsByType("vehicle")) do
        if getElementData(vehicle,"vehicle:id") == tonumber(idthen
            if getElementData(vehicle,"vehicle:ownedPlayer") ~= getElementData(source,"player:uid"then
            outputChatBox("* Nie jeste? w?a?cicielem tego pojazdu."source25500)
            return
            end
            sprzedazPojazdu[target]={source,target,vehicle,koszt}            
        end
    end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-06-28, 12:02


admiral123







Wiek: 29
Na forum: 3276 dni
Posty: 16

Piwa: 1

Respekt: 50

Ostrzeżeń: 100%
eject, Pr?bowa?em ju? wcze?niej , lecz nadal to samo.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-06-28, 12:26


Atroth







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

Piwa: 4808

Respekt: 540
Respekt: 540

admiral123, Do takiego typu nadaje si? tylko:


Więcej informacji znajdziesz w Wikipedii MTA:

onVehicleStartEnter


Inne podobne, nie mog? by? anulowane. Przy tym nie dajesz "vehicle" tylko source.


Przyk?ad:


addEventHandler("onVehicleStartEnter"root, function(plrseat,jacket)
if seat~= 0 then return end
if getElementData(source"vehicle:id") and not getElementData(plr"vehicle:ownedPlayer") ==true then 
cancelEvent()
end
end)


Jeszcze inny przyk?ad:

addEventHandler("onVehicleStartEnter"getRootElement(), function(playerseatjackeddoor)
        
        if getElementData(source"veh:sluzba") and not getElementData(player"sluzba:lvpd") == true then
            cancelEvent()
            outputChatBox("Nie jeste? tutaj zatrudniony!"player)
    
    end
    
end)


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: 2017-06-28, 13:44


admiral123







Wiek: 29
Na forum: 3276 dni
Posty: 16

Piwa: 1

Respekt: 50

Ostrzeżeń: 100%
Rookspack, No dobra, ale to jest skrypt na sprzeda? pojazd?w na gie?dzie :D

Postaw piwo autorowi tego posta
 

 
Tagi: wlasciciel :: pojazdu
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