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

Wysłany: 2018-11-30, 00:59


Nelsonn







Wiek: 27
Na forum: 4949 dni
Posty: 43
Nick w MP: Nelson

Piwa: 3

Respekt: 50

Witam, chcia?em rozdzielic pojazdy na 2 grupy.Pojazdy l?dowe i pojazdy wodne
i do ka?dej z tych grup osobny limit i osobna informacja na czacie. Pomo?e kto??
My?la?em o pogrupowaniu poprzez id ale nie wiem jak to zrobic.



local col createColCuboid (1904.3916015625676.1601562510.8203125485617 ) ---x na wprosty na lewoz wysokosc
local zone createRadarArea (1904.3916015625676.160156252202200025520 )
setElementData zone"zombieProof"true )
 
function enterAdmin hitElementmatchingDimension )
    if ( getElementType hitElement ) == "player" then
        local accName getAccountName getPlayerAccount hitElement ) )
        if isObjectInACLGroup "user.".. accNameaclGetGroup "TeddyBears" ) ) then
            toggleControl hitElement"fire"true )
            toggleControl hitElement"aim_weapon"true )
            toggleControl hitElement"vehicle_fire"true )
          else
            outputChatBox "Nie mo?esz tutaj wej??!"hitElement2550)
            local hitElement = ( isPedInVehicle hitElement ) and getPedOccupiedVehicle hitElement ) or hitElement )
            setElementPosition hitElement,1989.205078125702.954101562510.815298080444)
        end
    end
end
addEventHandler "onColShapeHit"colenterAdmin )


function amountvehicle element )
 local vehicleamount getElementsWithinColShape(source,"vehicle")
            if #vehicleamount >= 2 then
local veh getPedOccupiedVehicle(element)
                setElementPosition veh1989.205078125702.954101562510.815298080444 )
                outputChatBox("Osi?gni?to maksimum pojazd?w!",element)
        end
    end
addEventHandler("onColShapeHit"colamountvehicle)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-11-30, 12:03


TeeNekk

Cienzaruwka :v






Wiek: 23
Na forum: 3210 dni
Posty: 264
Nick w MP: TeeNekk.

Piwa: 919

Respekt: 110,5
Respekt: 110,5

po prostu, zr?b dwie tabele, z pojazdami l?dowymi, oraz ziemnymi, przy wej?ciu sprawdzaj kt?rego jest typu, po czym colshape, w kt?rym sprawdzasz ile pojazd?w tego typu jest w bazie.

Podpis
Pomogłem Ci
? Może zostawiłbyś za to piwko, lub respekt? Dzięki!
Mój projekt:
?
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-11-30, 15:34


Nelsonn







Wiek: 27
Na forum: 4949 dni
Posty: 43
Nick w MP: Nelson

Piwa: 3

Respekt: 50

Dobra mam porobione tabele, teraz jak to pod??czy??

local col createColCuboid (1904.3916015625676.1601562510.8203125485617 ) ---x na wprosty na lewoz wysokosc
local zone createRadarArea (1904.3916015625676.160156252202200025520 )
setElementData zone"zombieProof"true )
 
function enterAdmin hitElementmatchingDimension )
    if ( getElementType hitElement ) == "player" then
        local accName getAccountName getPlayerAccount hitElement ) )
        if isObjectInACLGroup "user.".. accNameaclGetGroup "TeddyBears" ) ) then
            toggleControl hitElement"fire"true )
            toggleControl hitElement"aim_weapon"true )
            toggleControl hitElement"vehicle_fire"true )
     else
            outputChatBox "Nie mo?esz tutaj wej??!"hitElement2550)
            local hitElement = ( isPedInVehicle hitElement ) and getPedOccupiedVehicle hitElement ) or hitElement )
            setElementPosition hitElement,1989.205078125702.954101562510.815298080444)
        end
    end
end
addEventHandler "onColShapeHit"colenterAdmin )

moto = { 
{461}, 
{448}, 
{468}, 
{586}, 
}

ziem = { 
{559}, 
{561}, 
{477}, 
{503}, 
}

function amountvehicle element )
 local vehicleamount getElementsWithinColShape(source,"vehicle")
            if #vehicleamount >= 2 then
local veh getPedOccupiedVehicle(element)
                setElementPosition veh1989.205078125702.954101562510.815298080444 )
                outputChatBox("Osi?gni?to maksimum pojazd?w!",element)
        end
    end
addEventHandler("onColShapeHit"colamountvehicle)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-11-30, 16:04


Avenged

Młodszy Szkrypter






Wiek: 23
Na forum: 3510 dni
Posty: 654
Nick w MP: Avenged

Piwa: 1570

Respekt: 326,3
Respekt: 326,3Respekt: 326,3Respekt: 326,3

Zamiast tabeli lepiej u?y?

Więcej informacji znajdziesz w Wikipedii MTA:

getVehicleType


Podpis
LUA, JS, PHP



Zapraszam do skorzystania z moich usług: Klik

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-11-30, 16:26


Nelsonn







Wiek: 27
Na forum: 4949 dni
Posty: 43
Nick w MP: Nelson

Piwa: 3

Respekt: 50

Tak, tylko w tym wypadku lepiej i wygodniej jest chyba w formie tabel

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-11-30, 17:04


Avenged

Młodszy Szkrypter






Wiek: 23
Na forum: 3510 dni
Posty: 654
Nick w MP: Avenged

Piwa: 1570

Respekt: 326,3
Respekt: 326,3Respekt: 326,3Respekt: 326,3

Kod leci od g?ry do do?u, wi?c je?li chcesz sprawdza? id pojazdu z tabeli z tym kt?ry wjecha? to tabele musisz da? nad zdarzenie wej?cia w colshape,a do sprawdzania musisz wykorzysta? instrukcje warunkow?

Podpis
LUA, JS, PHP



Zapraszam do skorzystania z moich usług: Klik

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-11-30, 17:10


Nelsonn







Wiek: 27
Na forum: 4949 dni
Posty: 43
Nick w MP: Nelson

Piwa: 3

Respekt: 50

Mo?esz mi to pokaza??

[ Dodano: 2018-12-04, 16:18 ]
up

Postaw piwo autorowi tego posta
 

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