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

Wysłany: 2020-11-28, 10:09


k1nG

grove street home






Wiek: 26
Na forum: 3557 dni
Posty: 29
Nick w MP: Trust / Tiffergan

Piwa: 12

Respekt: 60

Siemka, a wi?c mam sobie tak? spraw?, ?e mam poci?g kt?ry samoistnie je?dzi sobie po mapie uczywaj?c setStreamable, ale chce zrobi? co? takiego, ?e jak poci?g wjedzie w Marker to na chacie wyskoczy mi ?adny komunikat o tym, ?e poci?g wjecha? w marker pr?bowa?em zrobi? co? takiego

Kod:


function enter ( targetElem, matchingDimension )
if getElementModel(targetElem) == 537 then
outputChatBox ( "Train Stopped", root, 255, 255, 109 )
end
end
addEventHandler ( "onMarkerHit", marker, enter )
]]

Aczkolwiek komunikat wyskoczy mi tylko jak JA kieruje poci?giem, ale nie chodzzi mi o to, komunikat ma wyskakiwa? gdy poci?g jedzie sam z siebie, bo tak jest... zrobi?em te? co? takiego, ale to r?wnie? nie dzia?a

B??d?w w DB3 nie ma
Kod:

function isVehicleEmpty( vehicle )
if not isElement( vehicle ) or getElementType( vehicle ) ~= "vehicle" then
return true
end
if getVehicleOccupant( vehicle, 0 ) then
return false
end
return true
end

function enter ( targetElem, matchingDimension )
if isVehicleEmpty(targetElem) == true and getElementModel(targetElem) == 537 then
outputChatBox ( "Train Stopped", root, 255, 255, 109 )
end
end
addEventHandler ( "onMarkerHit", marker, enter )


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-11-29, 21:25


VVirmex

Sgrypter luja






Wiek: 21
Na forum: 3365 dni
Posty: 281
Nick w MP: AxyZ

Piwa: 234

Respekt: 110
Respekt: 110

Nast?pnym razem kod wklejaj w [.lua] [/lua]

A co do kodu - zrobi?bym co? takiego:



function isVehicleEmptyvehicle )
if not isElementvehicle ) or getElementTypevehicle ) ~= "vehicle" then
return false
end
if getVehicleOccupantvehiclethen
return false
end
return outputChatBox "Train Stopped"root255255109 )
end

function enter targetElemmatchingDimension )
if getElementModel(targetElem) == 537 then
isVehicleEmpty(targetElem)
end
end
addEventHandler "onMarkerHit"markerenter )



Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-11-30, 13:57


k1nG

grove street home






Wiek: 26
Na forum: 3557 dni
Posty: 29
Nick w MP: Trust / Tiffergan

Piwa: 12

Respekt: 60

"Johy*" napisał/a:

Nie zrobisz tego :(

Dlaczego s?yszalem od ludzi, ?e da si? to zrobi? ale na poci?gach si? troch? buguj? i jest trudne ale do zrobienia :f

[ Dodano: 2020-11-30, 14:32 ]
"VVirmex" napisał/a:

Nast?pnym razem kod wklejaj w [.lua] [/lua]

A co do kodu - zrobi?bym co? takiego:



function isVehicleEmptyvehicle )
if not isElementvehicle ) or getElementTypevehicle ) ~= "vehicle" then
return false
end
if getVehicleOccupantvehiclethen
return false
end
return outputChatBox "Train Stopped"root255255109 )
end

function enter targetElemmatchingDimension )
if getElementModel(targetElem) == 537 then
isVehicleEmpty(targetElem)
end
end
addEventHandler "onMarkerHit"markerenter )



Tw?j kod nie dzia?a b??d?w nie ma, ale nic na chacie nie wyskakuje jak poci?g przeje?d?a przez marker.

Postaw piwo autorowi tego posta
 

 
Tagi: wiadomość :: gdy :: pociąg :: wleci :: marker
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Wiadomość gdy pociąg wleci w marker 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