Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.
GTAONLINE.PL
Tematy otagowane jako: pojazdu
161. Odpalanie pojazdu na przycisk
Witam. Mam kod, kt?ry odpowiada za odpalanie pojazdu za pomoc? komendy, jednak chcia?bym to zmieni? na przycisk ale nie mam poj?cia co ustawi? w polu player. Pr?bowa?em sourcePlayer oraz thePlayer (localPlayer odpala ze wzgl?du na funkcj? serwerow?)

Kod:


function turnEngine(player,z,down)
local car = getPedOccupiedVehicle(player)
if(car and getVehicleController(car) == player) then
setVehicleEngineState(car,(not getVehicleEngineState(car)))
if(getVehicleEngineState(car)) then
outputChatBox("Engine: Your engine has been turned on.", player, 0, 255, 0)
else
outputChatBox("Engine: Your engine has been turned off.", player, 255, 0, 0)
end
end
end
bindKey (sourcePlayer, "z", "down", turnEngine)
--addCommandHandler ("engine",turnEngine)

function enterVehicle ( theVehicle, seat, jacked )
setTimer(setVehicleEngineState,500,1, theVehicle,false) -- here cheange
end
addEventHandler ( "onPlayerVehicleEnter", getRootElement(), enterVehicle )
162. Spawnowanie więcej niż jednego pojazdu
Witam. Zrobi?em bardzo prosty kod ale nie dzia?a poprawnie. Mianowicie po restarcie serwera spawni si? bardzo du?o pojazd?w w sobie, jednak gry u?yj? komendy restart (tutaj nazwa) to znikaj? wszystkie i normalnie pojawia si? jedna sztuka w wybranym miejscu. My?l?, ?e to co? zwi?zane z tym addEventHandler'em

Kod:



function ccc ()

sadler = 411

createVehicle ( sadler, 1887 , 937, 12 )

derby = createVehicle ( 504, 2168.5947265625, -1506.5888671875, 23.929080963135, 357.88235473633 )

jeep = createVehicle ( 500 , 2344.748046875, -1219.26171875, 22.5, 90.465545654297 )

terenowe = createVehicle ( 495 , 1911.1259765625, -1117.0361328125, 25.664100646973 )

hotknife = createVehicle ( 434 , 2091.474609375, -1560.1953125, 13.133551597595, 182.99383544922 )

end
addEventHandler ( "onResourceStart", rootElement, ccc)

163. Naprawa Pojazdu
[center]Witam mam problem z tym skryptem chodzi o to ze pobiera mi kas? x2 to jeszcze daje na minus jak mam 0 stara?em si? to ogarn?? i nic mi nie wychodzi.[/center]
S:
[lua]local stanowiskaNaprawcze = {
stanowiskoDoherty={
mpos={1106.54602,1760.97449,10.82031}, -- marker
cpos={1094.7373, 1757.0455, 10.820313-1, 11.75, 6.75, 5}, -- cuboid
--faction_id=1, -- (id) frakcja kt?ra b?dzie mia?a dost?p
text="Naprawa pojazdu"

},
stanowiskoLV={
mpos={1107.12097,1750.85950,10.82031}, -- marker
cpos={1095.272, 1747.2896, 10.820313-1, 9.5, 6.25, 5}, -- cuboid
--faction_id=1, -- (id) frakcja kt?ra b?dzie mia?a dost?p
text="Naprawa pojazdu"

},
}


for i,v in pairs(stanowiskaNaprawcze) do
v.cuboid=createColCuboid(unpack(v.cpos))
v.marker=createMarker(v.mpos[1], v.mpos[2], v.mpos[3]-0.90, "cylinder", 1.2, 0, 0, 255, 100)
--setElementData(v.marker,"snn_faction",v.faction_id)
setElementData(v.marker,"snn_cs",v.cuboid)

t=createElement("text")
setElementData(t,"name",v.text)
setElementPosition(t,v.mpos[1], v.mpos[2], v.mpos[3])
end


-- triggerServerEvent("naprawaElementu", resourceRoot, naprawiany_pojazd, czesc, koszt)
addEvent("naprawaElementu", true)
addEventHandler("naprawaElementu", resourceRoot, function(pojazd, czesc, koszt)
outputDebugString("Naprawa elementu " .. czesc .. " za " .. koszt)
if kosz...
164. Funkcja na wsiadanie do pojazdu jako pasażer
Czy jest funkcja pozwalaj?ca graczowi wsi??? do auta jako pasa?er?
Od razu m?wi? testowa?em setControlState i executeCommandHandler.
165. Przyspieszenie pojazdu
Witam mam problem z przyspieszeniem pojazdu (mk, us) mam tu taki skrypt na monta? tego:
S:
[lua]addEvent("turbo", true)
addEventHandler("turbo", root, function()
pojazd = getPedOccupiedVehicle(source)
local id=getElementData(pojazd,"vehicle:id")
if not pojazd then return end
if (getPlayerMoney(source) > tonumber(49999)) then
setElementData(pojazd,"turbo", true)
setElementData(pojazd,"turboy", true)
query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_vehicles SET mk2=1 WHERE id=?", id)
takePlayerMoney(source, 50000)
outputChatBox("* Zamontowa?e?(a?) uk?ad Turbo.", source)
setVehicleHandling(pojazd, "engineAcceleration", getVehicleHandling ( pojazd ).engineAcceleration + 4 )
setVehicleHandling(pojazd, "maxVelocity", getVehicleHandling ( pojazd ).maxVelocity + 35 )
setVehicleHandling(pojazd, "tractionMultiplier", 0.8)
setVehicleHandling(pojazd, "steeringLock", 50)
setVehicleHandling(pojazd, "driveType", "awd")
else
outputChatBox("* Nie sta? ci? na Turbo!", source,true)
end
end
)[/lua]
S2:
[lua]addEvent("turboWymontuj", true)
addEventHandler("turboWymontuj", root, function()
pojazd = getPedOccupiedVehicle(source)
local id=getElementData(pojazd,"vehicle:id")
if not pojazd then return end
givePlayerMoney(source...
166. zablokowanie wejścia do pojazdu
napisa?em taki skrypt na pojazdy ale chc? by nikt do nich nie m?g? wej?? jak to zrobi? ?
Kod:

local spawn3={
{ 1355.99,1756.06,11.74},
}


for i,v in ipairs (spawn3) do
local spawn3 = createVehicle(519,v[1],v[2],v[3],v[4],v[5],v[6])
local rotX, rotY, rotZ = getElementRotation(spawn3)
setElementRotation(spawn3,0,0,-90,"default",true)
setElementFrozen(spawn3, true)
setVehicleColor(spawn3, 0, 0, 0)
setVehiclePlateText(spawn3, "Lot LV")
setElementData(spawn3, "vopis", "Samolot")
end
167. Respienie pojazdu z danym id
Witajcie. Mam zagwostk?, czy mo?na w pawn zrobi? tak aby respi?o pojazd z danym id kt?re wpiszemy? Nie chodzi mi o id modelu czyli np infernus 411 tylko chodzi o id te kt?re ka?dy pojazd ma unikalny pod /dl w sampie.
168. uszkodzenie pojazdu
Robi? co? takiego, ?e im gracz bardziej uszkodzi auto, tym wi?cej zap?aci za napraw?, ale.. Na t? chwil? jest tak, ?e im bardziej uszkodzone, tym p?aci mniej xD Jak to odwr?ci??

Kod:

zmienna = (1000 - floatround(vehhealth)*10);


1000 - pe?ne ?ycie pojazdu
10 - 10$.
169. elementData Pojazdu
Witam!

Jak mog? sprawdzi? elementDate pojazdu do kt?rego chce wsi????

kod:

function onVehicleStartEnter(playerseatjacked)
    
local acc getPlayerAccount(player)
  if 
seat == 0 then
    
if getAccountData(acc,"PracaPol") == true then

    
else
        
exports["LR-notyfikacje"]:addNotification(player,"* Nie jeste? na s?u?bie")
        
cancelEvent()
    
end
  end
end
addEventHandler 
("onVehicleStartEnter"resourceRootonVehicleStartEnter)


Chcia?bym aby po nacisni?ciu entera sprawdza?o elementDate pojazdu do kt?rego wsiadam.

za pomoc :piwo:
170. Dodanie Pojazdu do Organizacji
Witam jak dodac pojazd do organizacji OGRPG?
Mysql - ogrpg_organizations

Organizacje dza?aj? tylko nie wiem jak dodac auta
171. blokada teleportacji pojazdu do interioru
dzie? dobry, mam problem xd..
mo?e jest do?? prosty do rozwi?zania ale utkn??em kombinuj?c ju? ze wszystkim co mi wpad?o do g?owy...
za ka?dym razem mi to nie dzia?a, i wgl, sprawa prosta chce zablokowa? mo?liwo?? wej?cia albo zbugowania postaci po przez wjazd do markera pojazdem, r??ne cuda si? dziej? np wywala do limbo itd, to kod;

[lua]
addEventHandler("onMarkerHit", getRootElement(),
function(hitPlayer, matchingDimension)
if ( getElementData(source, "weaponshop") ) then
if isPedInVehicle(hitPlayer) then
-- // effect
fadeCamera(hitPlayer, false)
setTimer(fadeCamera, 1000, 1, hitPlayer, true)
-- // entrance/exit
if ( getElementData(source, "entrance") ) then
setTimer(setElementInterior, 1000, 1, hitPlayer, 1)
setTimer(setElementPosition, 1000, 1, hitPlayer, getElementData(source, "x"), getElementData(source, "y"), getElementData(source, "z"))
setTimer(setElementRotation, 1000, 1, hitPlayer, 0, 0, 0)
elseif ( getElementData(source, "exit") ) then
setTimer(setElementInterior, 1000, 1, hitPlayer, 0)
setTimer(setElementPosition, 1000, 1, hitPlayer, getElementData(source, "x"), getElementData(source, "y"), getElementData(source, "z"))
...
172. Teleport bez pojazdu
Witam,tworzy?em w?asnie skrypt na teleport w dane miejsce ,tylko bez pojazdu.Prezentuje sie on tak:
Kod:


marker = createMarker(-1536.1999511719, 358.60000610352, 6.0999999046326, 'cylinder', 2.1, 0, 0, 255)

function teleport(player)
if getElementType(player)=="player" then
local vehicle=getPedOccupiedVehicle(player)
if not vehicle then
if source == marker then
setElementPosition(player, -1667.6357421875, 440.5576171875, -20.050033569336)
setElementFrozen(player, true)
setTimer(setElementFrozen, 1000, 1, player, false)
end
end
end
end
addEventHandler("onClientMarkerHit", getRootElement(), teleport)


Problem polega na tym,ze teraz wogole teleport nie dziala.Skrypt wydaje mi sie w miare dobrze napisany.Pomoze ktos gdzie sie pomylilem? dzieki
173. Spawn Pojazdu
Witam chcia?bym zrobi? prace dostawcy ale nie mog? zrobi? aby Spawni?a si? ci??ar?wka z naczep? razem i ?eby nie by?o mo?na jej odczepi?, macie pomys?y?
174. Przecho|Resp Pojazdu
[center]Witam
Mam taki problem z przechowalni? z paczki its'a Chodzi o to ze jak edytuje kordy to nie moge odstawi? pojazdu do przecho...[/center]
[u]Za pomoc :piwo: [/u]
c_parking:
[lua]local screenW, screenH = guiGetScreenSize()


---- TWORZENIE PRZECHOWALNI NOWY SYSTEM :P
przechowalnie = {
{{1016.30,-1958.53,13.17+0.3},setElementData(createMarker(1016.30,-1958.53,13.17-0.9, "cylinder", 2, 255,255,255,50),"przecho:id",1),{['Automobile']=true,['Bike']=true,['BMX']=true,['Quad']=true,['Monster Truck']=true,},"Samochody i motocykle",createColCuboid(1022.15,-1951.79,12.83,0.0,360.0,269.5),{1021.37,-1946.55,13.15,0,0,270}},
--{{-1329.83, -503.23, 14.17},setElementData(createMarker(-1329.83, -503.23, 14.17-0.9, "cylinder", 2, 255,255,255,50),"przecho:id",2),{['Plane']=true,['Helicopter']=true,},"Samoloty i Helikoptery", createColCuboid(-1374.84412, -523.80127, 13.17188, 32.974975585938, 60.693542480469, 8.1999992370605),{-1361.16, -493.17, 14.17,0,0,210}},
--{{-1329.80, 338.39, 7.19},setElementData(createMarker(-1329.80, 338.39, 7.19-0.9, "cylinder", 2, 255,255,255,50),"przecho:id",3),{['Boat']=true},"?odzie", createColCuboid(-1322.88025, 340.98438, -1.55000, 28.96923828125, 33.127319335938, 10.200000011921),{-1313.18, 357.69, 2.65, 0.00, 0.00, 283.42}},
--{{1765.17, -2020.07, 14.15+0.3},setElementData(createMarker(1765.17, -2020.07, 14.15-0.9, "cylinder", 2, 255,255,...
175. [SKRYPT] Nowoczesny tuning pojazd
Dobry!
Udost?pniam wam scrypt na tuning pojazdu kt?ry znalaz?em szperaj?c w internecie udost?pniam gdy? nie ma chyba takiego tu na forum.
Ca?? odpowiedzialno?? za udost?pnianie nie swojego scryptu bior? na siebie.
Pozdrawiam!

SS:


Dowland:
AMX - http://www.mediafire.com/...097/wTUNING.amx

Instalacja: Pobierasz plik amx , wklejasz do folderu filterscripts otwierasz plik cfg czyli server tam szukasz linijki filterscripts wpisujesz vtuning zapisujesz odpalasz server i wpisujesz /tune wszystko powinno ?adnie dzia?a?.


Nie da?em w Hide bo to nie m?j scrypt oraz nie ma pwn lecz nie wiem czy nie da rady deamx co? wykombinowa? aby otrzyma? z amx na pwn

Link do tego programu: http://www.solidfiles.com/d/52c20179fc/

Jak to dzia?a?: https://www.youtube.com/watch?v=xHx9NBtu-wg
176. Rotacja pojazdu - dxDrawLine - tasmy
Witam pisz? skrypt na tasmy dla frakcji i wszystko pi?knie ?miga, cofanie gracza jak pr?buje przej?? przez lini?, ale mam problem jak kto? jedzie autem. Wje?d?aj?c w ta?my jad?c do przodu te? go odbija, ale jak jedzie ty?em to ju? udaje mu si? przebi?.
Wie kto? jak temu zaradzi????

Za pomoc stawiam :piwo:
177. [SKRYPT] Wypadanie z pojazdu
Witam , mam Wam do zaprezentowania skrypt wypadania przez przedni? szyb? przy zderzeniu.
Skrypt jest mojego autorstwa oraz pozwalam na jego edycj?.

Film:
https://www.youtube.com/watch?v=bEYLuuGoukI

Ukryta wiadomość / Hidden message(aby ją zobaczyć musisz postawić użytkownikowi)
Wiadomość została ukryta, aby ją przeczytać należy się zalogować.
178. Pobranie holowanego pojazdu
Witam.
Chc? aby po pod??czeniu auta do holownika (towtrucka) holowany pojazd dostawa? jaki? tam handling.


function holo (thePlayer)
theVehicle getPedOccupiedVehicle thePlayer )
 if 
theVehicle then
holowane 
getVehicleTowedByVehicle theVehicle  
setVehicleHandling(holowane"steeringLock"90)
end
end
addEventHandler 
"onTrailerAttach"getRootElement(), holo )


debug script:
WARNINGrobietak.lua:4Bad argument 'getPedOccupiedVehicle' [Expected ped at argument 1got vehicle
179. Zamrożenie pojazdu w wyznaczonym miejscu.
Jak zrobi? ?eby zatrzyma? np. busa na 4 sekundy (tak ?eby nim nie da?o si? ruszy?) w wyznaczonym miejscu?
180. Szybkosc pojazdu
Elo jak zrobic maksymalna szybkosc pojazdu? Jestem dobry w PAWN ale tego to nie wiem XDD

DAJE :piwo:
181. Niszczenie holowanego pojazdu
Witam. Chcia?bym si? dowiedzie? jak nazywa si? w lua pojazd kt?ry jest holowany, np. holujemy pojazd do jakiego? markera, gdy wje?d?amy pojazd z holownika si? usuwa. Za pomoc piwko
182. Przebieg pojazdu
Siemanko, chce zrobi? przebieg pojazdu. Nie wiem jak si? za to zabra?. Zrobilem sobie ju? licznik itp. Chce doda? od niego przebieg. np 000.0000 to na pocz?tek, potem zwi?ksza si? 000.001 po przejechaniu kawa?ka. Nie wiem czy mo?na tak. Je?li nie to prosz? o pokazanie innego kodu. Najlepiej na przyk?adzie :) Z g?ry dzi?ki. Za pomoc PIFFKO i RESPEKT ! :)
183. podmiana danego pojazdu
witam mam zapytanie ot?? czy da si? zamieni? su?tana ?e np. Jeden Gracz ma normalnego sultka, a w policji np. jest podmianka za radiolke. Czy jest w og?le taka mo?liwo???
184. Sprzedaż pojazdu
[lua]

local urzednik = createPed(17,359.71,173.84,1008.39,270)
setElementInterior(urzednik,3)
setElementDimension(urzednik,1)
setElementData(urzednik,"ped_opis","Urzednik")

local sprzedaz = createMarker(361.83,173.71,1007.10,"cylinder",2.4,0,192,240,200)
setElementInterior(sprzedaz,3)
setElementDimension(sprzedaz,1)

timer=nil
sprzedazz={}

-- SKRYPT

addEventHandler("onMarkerHit",sprzedaz,
function (plr)
outputChatBox("Aby sprzeda? pojazd wpisz /sprzedaj <nick> <id pojazdu> <cena>",plr)
end
)

addCommandHandler("sprzedaj",
function (plr, cmd, target, id, koszt)

if not target and not id and not koszt then
outputChatBox("Poprawne u?ycie /sprzedaj <nick> <id pojazdu> <cena>",plr)
return
end

if not isElementWithinMarker(plr,sprzedaz) then
outputChatBox("Nie jeste? w odpowiednim miejscu.",plr)
return
end

if not target then
outputChatBox("Nie znaleziono gracza o podanym nicku.",plr)
return
end

local koszt = tonumber(koszt)
if not koszt then
outputChatBox("Nie poda?e? ceny pojazdu za jak? chcesz go sprzeda?",plr)
return
end

if not tonumber(id) then
outputChatBox("Nie poda?e? id pojazdu",plr)
return
end

if tonumber(koszt) < 0 then
outputChatBox("Poda?e? z?? cen?!",plr)
return
end

local account = getPlayerAccount(p...
185. Ostrzeżenie o konieczności serwisowania pojazdu
Witajcie, zastanawiam si? jak zrobi? wy?wietlenie gui (kod gui ju? mam) tj. napisu "odwied? serwis" je?li elementData pojazdu o nazwie "serwis" wynosi 1?
186. DayZ pojazdu
pomo?e kto? ( wyt?umaczy ) jak si? dodaje pojazdy na sw?j serwer DayZ ?
w jakich plikach trzeba dopisa? wszystkie funkcje aby pojazd si? zrespil
187. Dm Pojazdu
Witam mam taki problem ze po wgraniu skryptu na nie rozwalanie auta bez kierowcy
nadal auta mo?na rozwala? chocia? w nim nikogo niema
Kod:

local function bezkierowcy(veh)
local occupants = getVehicleOccupants(veh)
local seats = getVehicleMaxPassengers(veh)
if (not seats) then return true end
for i=0,seats do
local occupant = occupants[seat]
if occupant and (getElementType(occupant)=="player" or getElementType(occupant)=="ped") then
return false
end
end
return true
end


for i,v in ipairs(getElementsByType("vehicle")) do
if (bezkierowcy(v)) then
setVehicleDamageProof(v,true)
else
if getElementData(v,"damageproof") then setVehicleDamageProof(v, true) return end
setVehicleDamageProof(v,false)
end
end

addEventHandler ( "onVehicleEnter", root, function()
if getElementData(source,"damageproof") then setVehicleDamageProof(source, true) return end
setVehicleDamageProof(source, false)
end)

addEventHandler ( "onVehicleExit", root, function()
if (bezkierowcy(source)) then
setVehicleDamageProof(source, true)
else
if getElementData(source,"damageproof") then setVehicleDamageProof(source, true) return end
setVehicleDamageProof(source, false)
end
end)
188. naprawa pojazdu
Jak zrobi? aby pojazd mo?na by?o naprawia? co 10 sekund prosz? o pomoc.
Wiem ?e trzeba u?y? setTimera tylko nie wiem jak.

M?j kod:
Kod:


function repairVehicle()
local vehicle = getPedOccupiedVehicle(g_Me)
if vehicle then
outputChatBox("Naprawi?e? auto")
server.fixVehicle(vehicle)
end
end
bindKey("n","down", repairVehicle)







:piwo: w nagrode za odpowied?
189. Dostanie pieniędzy za zniszczenie pojazdu
Witam, pomo?e mi kto? napisa? skrypt kt?ry po wpisaniu komendy kt?ra usuwa pojazd gracz dostaje pieni?dze zale?nie od ID pojazdu. Nie wiem jak do tego si? zabra? i jak mia?o by wygl?da? po??czenie komendy kt?ra taki pojazd usuwa oraz daje kas? zale?nie od ID.


zlomm 
createMarker 2047.701415.4010.34"cylinder"52552550170 

function 
zlom(player

destroyElement(getPedOccupiedVehicle(player))
outputChatBox("Zezlomowales swoj woz."player)
end 
addCommandHandler
("zezlomuj"zlom)


function 
info(playermd)

local vehicle=getPedOccupiedVehicle(player)

if 
isElementWithinMarker (playerzlommthen 

if isPedInVehicle(playerthen 

outputChatBox 
"Wpisz /zezlomuj aby zezlomowac pojazd"player

end
end

end
addEventHandler
("onMarkerHit"zlomminfo)
190. Złomowanie pojazdu
Chcia?bym aby dany marker sprawdzi? czy gracz jest w poje?dzie i gdy jest to wy?wietli mu si? "Wpisz /zezlomuj aby zezlomowac swoj pojazd" I chcia?bym aby po wpisaniu /zezlomuj samochod gracza si? usun?. Mam teraz taki kod

Kod:


zlomm = createMarker ( 2047.70, 1415.40, 10.34, "cylinder", 5, 255, 255, 0, 170 )

function zlom(player)

if isElementWithinMarker (player, zlomm) then

if isPedInVehicle(player) then

outputChatBox ( "Wpisz /zezlomuj aby zezlomowac pojazd", getRootElement(), 255, 255, 255, true )


end
end

end
addEventHandler( "onMarkerHit", getRootElement(), zlom)


Jak musia?by wygl?da? kod kt?ry robi to co wy?ej i jednocze?nie po wpisaniu komendy usuwa?oby pojazd? Dam piwko za odp :)
191. Kolizja pojazdu
Witam!

Chcia?bym zrobi? w pracach takie co? gdy zrespi auto a potem 2 gracz te? zrespi auto to ?eby przez siebie przenika?y i nie mo?na by by?o zderza? si?.
Mog?by kto? pom?c?
192. Podmianka dla konkretnego pojazdu
Witam. Moje pytanie brzmi czy da si? wgra? podmiank? tylko dla okre?lonego pojazdu? :p
193. Upgrade pojazdu
Witam oto moje pytanie:

Czy je?eli funkcja

Więcej informacji znajdziesz w Wikipedii MTA:

getVehicleUpgrades

zwraca tabele to czy ta funkcja mo?e doda? ten tune z tej tabeli ?


Więcej informacji znajdziesz w Wikipedii MTA:

addVehicleUpgrade


Jak nie mo?e to jakich funkcji u?y? aby pobra? ca?y tune auta i po zapisaniu i odczytaniu z MySQL doda? go do auta.
194. Nieniszczenie się pojazdu
Witam, mam problem ze skryptem MIKELmta, ot?? jego skrypt nie dzia?a na moim serwerze. Jest dodany do acl, Jednak przy zaci?gni?tym r?cznym i tak da si? rozwala? pojazd zar?wno r?k? jak i innym pojazdem. Jak to naprawi? ?? Prosz? o pomoc. Za pomoc :piwo: i R*
Dodam ?e u?ywam systemu pojazd?w OGRPG.
Kod:
[lua]
local function pojazdPusty(veh)
local occupants = getVehicleOccupants(veh)
local seats = getVehicleMaxPassengers(veh)
if (not seats) then return true end
for i=0,seats do
local occupant = occupants[seat]
if occupant and (getElementType(occupant)=="player" or getElementType(occupant)=="ped") then
return false
end
end
return true
end


for i,v in ipairs(getElementsByType("vehicle")) do
if (pojazdPusty(v)) then
setVehicleDamageProof(v,true)
else
if getElementData(v,"damageproof") then setVehicleDamageProof(v, true) return end
setVehicleDamageProof(v,false)
end
end

addEventHandler ( "onVehicleEnter", root, function()
if getElementData(source,"damageproof") then setVehicleDamageProof(source, true) return end
setVehicleDamageProof(source, false)
end)

addEventHandler ( "onVehicleExit", root, function()
if (pojazdPusty(source)) then
setVehicleDamageProof(source, true)
else
if getElementData(source,"damageproof") then setVehicleDamageProof(source, true) return end
setVehicleDamage...
195. wywalanie z pojazdu
chce zeby wywalalo od razu z pojazdu po zabraniu prawka

ca?y kod:
[lua]
local prawko = createMarker(1498.68, -1582.67, 13.55-1, "cylinder", 1.3, 255, 0, 45)
createBlip(1498, -1582, 13,36, 2, 255,0,0,255,0,600)

local punktyJazdy = {
{-210.72,2752.92,62.14},
{-255.60,2749.25,62.14},
{-261.41,2704.73,62.14},
{-373.17,2689.60,63.64},
{-496.67,2717.22,65.17},
{-669.99,2743.08,57.82},
{-897.10,2725.68,45.47},
{-1342.10,2644.28,50.06},
{-1427.61,2722.17,62.32},
{-1630.73,2724.74,57.3},
{-1629.25,2671.54,54.0},
{-1432.59,2668.04,55.2},
{-1428.40,2600.62,55.29},
{-1383.36,2595.85,55.35},
{-1433.72,2470.19,60.6},
{-1386.63,2244.65,54.39},
{-1331.77,1985.98,51.44},
{-1179.59,1797.23,40.13},
{-1019.95,1726.44,30.63},
{-859.87,1612.33,26.52},
{-846.97,1417.25,13.21},
{-727.69,1232.62,12.9},
{-577.40,1113.11,10.53},
{-397.64,1003.44,10.36},
{-296.81,809.74,14.34},
{0.25,879.92,22.23},
{226.69,969.67,27.79},
{188.18,1141.93,14.28},
{311.04,1277.22,13.20},
{410.16,1589.83,17.42},
{534.97,1679.41,11.07},
{523.52,1714.50,10.57},
{595.62,1844.41,14.33},
{614.83,2010.26,35.47},
{594.04,2159.82,38.54},
{548.14,2328.54,31.98},
{401.01,2370.79,24.90},
{180.76,2284.77,21.97},
{66.80,2303.70,20.88},
{-67.08,2339.74,20.39},
{-109.90,2458.24,13.92},
{-260.89,2518.30,32.36},
...
196. Wsiadanie do pojazdu
Witam mam problem z OGRPG v2 czemu mog? wej?? do pojazdu nie maj?c licencji ?? ? Prosze o szybk? pomoc i skrypt kt?ry za to odpowiada! za pomoc R* i :piwo:
197. teleportowanie do pojazdu
witam.
mam prawo jazdy (kurs) lecz przedtem dzialalo bez narzekania. mianowicie chodzi o to ze nie repsi nas w pojezdzie (nie raz zadziala ze nas zrespi)
za poprawke kodu :piwo: + R* help:
s-side
[lua]
local egzaminowany=nil

function sethpnpc ()
end
setTimer( sethpnpc, 1000,0 )
local marker = createMarker ( 2274.41, -79.25, 25.7, "cylinder", 1.5, 0, 255, 40)
setElementDimension (marker, 0)
setElementInterior (marker, 0)

function onhit( source )
outputChatBox("Aby zda? prawo jazdy, wpisz nast?puj?ca komend? /rozpocznij.kurs.", source)
end
addEventHandler( "onMarkerHit", marker, onhit)

function kurs(source)
if isElementWithinMarker ( source, marker )
then
local konto = getPlayerAccount ( source )

if not getAccountData(konto,"prawojazdy" ) then
outputChatBox("Rozpoczynasz kurs prawa do jazdy. Przestrzegaj przepis?w na drogach! ", source)
outputDebugString( "Start prawo jazdy")
auto = createVehicle ( 401, 2277, -84, 26, 0, 0, 0)
setElementData(auto, "pojazd_opis", "Pojazd egzaminacyjny")
setVehicleColor ( auto, 255, 0, 255 )
setVehiclePlateText(auto, "PRAWKO")
setVehicleHandling(auto, "maxVelocity", 60)
setElementData(auto, "pojazd_paliwo", 99)
warpPedIntoVehicle ( source, auto )
toggleControl(source, "enter_exit", false)
triggerClientEvent ("zdajemyprawko", source )
else
out...
198. Jak zrobić by tepało do pojazdu
A wi?c jak zrobi? by tepa?o do pojazdu a nie do niego.Chodzi by jak kliknie si? na suszarce to tepa ci? na kierowce pojazdu nacelowanego

Kod


        
if selected == 3 then
            local x
,y,z=getElementPosition(el)
            
setElementPosition(source,x,y,z)
            
warpPedIntoVehicle(source,vehicle)
            
outputChatBox("* Przenios?e? siebie do pojazdu."source)
199. Blip w kolorze pojazdu
Zaczn? od kodu:
--[[
Ten plik zawiera:
    * 
zajmuje sie tworzeniem blipow pojazdow na mapie
--]]

function 
onMapShow()
    
triggerServerEvent("pobierzPojazdyGracza"localPlayer)
        
end
        blipy 
nil
addCommandHandler
("namierz"onMapShow)

addEvent("zwrocPojazdyGracza"true)
addEventHandler("zwrocPojazdyGracza"getRootElement(),
function(
pojazdy)
blipy = {}
    for 
i,v in pairs(pojazdy) do
        if 
isElement(vthen
                local color1
color2color3color4color5color6 getVehicleColor vtrue )
        
local blip createBlipAttachedTo(v02"..color1..""..color2..""..color3.."255)
        
table.insert(blipyblip)
        
end
    end
end
)

Dlaczego moje blipy nie s? koloru pojazdu (s? czarne)?
Jak dodaj? to:
        local v znajdzpojazd(id)

to jest problem bo kod jest ze strony clienta - a powy?ej jest triger ze strony servera!
Co robi??
200. Zmienna(?) o marce pojazdu (żeby rozpoznało po ID)
Witam.
W jaki spos?b mog? zrobi?, ?eby podawa?o mi mark? samochodu o podanym ID?
ID rzecz jasna pojazdu prywatnego.

Nie chc? gotowca, tutaj m?j wycinek kodu na /vinfo
Posiadam informacj? o w?a?cicielu, ID, przebiegu, jednak je?li chodzi o mark? to mam problem ;/
[lua]
function autoinfo(plr,cmd,id)
local account = getPlayerAccount(plr)
local name = getAccountName(account)
if not isObjectInACLGroup("user."..name, aclGetGroup("Admin")) then return end
if id then
local id = tonumber(id)
local v = znajdzpojazd(id)
if v then
local wlasciciel = getElementData(v,"car_owner")
local przebieg = getElementData(v,"pojazd_przebieg")
outputChatBox("Pojazd o ID: "..id,plr,222,222,222,true)
outputChatBox("Przebieg pojazdu: "..math.floor(przebieg).."km" ,plr,222,222,222,true)
outputChatBox("W?a?ciciel pojazdu: "..wlasciciel,plr,222,222,222,true)
else
outputChatBox("Nie wykryto takiego pojazdu!",plr,255,5,5,true)
end
else
outputChatBox("Nie wpisa?e? ID pojazdu.",plr,255,0,0,true)
end
end
addCommandHandler("vinfo",autoinfo)
[/lua]
Mam powiedzmy infka o ID 1, chcia?bym, zeby po wpisaniu /vinfo 1 pokaza?o si? na czacie tak?e o marce ;/

System pojazd?w mam od Prezesa, w razie czego mog? da? stamt?d kt?ry? kod.
Powy?ej wszystko robi?em po elementData, a tutaj marka jest zapisana w SQLite...

My?l?, ?e to b?dzie najbardz...