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: markerze
1. Zatrzymanie w markerze
Witam napisa?em kod, ?eby pojazd zatrzyma? si? w markerze

   local veh getPedOccupiedVehicle(localPlayer)
    
local sx,sy,sz getElementVelocity(veh)
    
local kmh math.ceil(((sx^2+sy^2+sz^2)^(0.5))*155)
    if 
kmh 3 then
        outputChatBox
("Musisz si? zatrzyma?!")
        return
    
end 


Tylko jest taki problem, ?e kod wywo?uje event "onClientMarkerHit" i nie wiem jak zrobi?, ?eby nie trzeba by?o wyjecha? z markeru i wejechac jeszcze raz z pr?dko?ci? mniejsz? od 3 km/h. Chodzi mi o to, ?eby wystarczy?o si? zatrzyma? w markerze.

I jak dorobi?, ?eby pojazd zosta? zfreezowany na 3 sekundy?
2. Dwa różne skrypty w jednym markerze
Witam mam dziwny problem. Ot?? mam dwa ca?kiem inne skrypty w ca?kiem innej mecie, a dzieje si? takie co? https://imgur.com/a/VplnM1W


DWA KODY

Client w syrenie OSP !
[lua]
x,y = guiGetScreenSize()
button = guiCreateButton(627/1440*x, 510/900*y, 209/1440*x, 123/900*y, "Uruchom Syrene", false)
guiSetProperty(button, "NormalTextColour", "FFAAAAAA")
guiSetVisible(button, false)

function drawSyrena()
dxDrawRectangle(600/1440*x, 278/900*y, 261/1440*x, 372/900*y, tocolor(0, 0, 33, 184), false)
dxDrawRectangle(590/1440*x, 265/900*y, 289/1440*x, 16/900*y, tocolor(187, 0, 0, 255), false)
dxDrawText("Syrena OSP Fort Carson", 616/1440*x, 346/900*y, 851/1440*x, 445/900*y, tocolor(255, 255, 255, 255), 3.00, "default", "center", "center", false, false, false, false, false)
end

addEvent("showGUI", true)
addEventHandler("showGUI", getRootElement(), function()
guiSetVisible(button, true)
addEventHandler("onClientRender", getRootElement(), drawSyrena)
showCursor(true, false)
end)

addEvent("hideGUI", true)
addEventHandler("hideGUI", getRootElement(), function()
guiSetVisible(button, false)
removeEventHandler("onClientRender", getRootElement(), drawSyrena)
showCursor(false)
panel=false
end)

addEventHandler("onClientGUIClick", button, function()
triggerServerEvent("playSyrena_s", getLocalPlayer...
3. Sprawdzanie pojazdu w markerze
Czy istnieje jaka? funkcja ?e da si? sprawdzi? czy w markerze jest pojazd? chc? zrobi? tuning lecz nie wiem jak sprawdzi? czy w markerze znajduje si? pojazd funkcje bym poprosi?
4. Komenda w markerze
Witam. Mam stworzon? funkcj? i chce aby komend?:
addCommandHandler("nie",dnie)

By?o mo?na u?y? w markerze.
Marker:
dmarker createMarker(2447.41528,-1778.9228512.54688"cylinder"300255)
5. Objekt w markerze
[center]witam poiadam pewna nie dokonala prace.. Do jej doskonalosci brakuje randomowego objektu w srodku markera.. Niestety ja czegos takiego nie potrafie zrobic, dlatego zwracam sie do was z mysla, ze mi pomozecie..
O to kod na dana prace.. Mysle, ze mi z tym pomozecie :) [/center]
[lua]local missionPed
local missionBlip
local missionMarker
local missionVehicle
local screenW, screenH = guiGetScreenSize()

local code="Praca: Wylawiania beczek z wodyn Zarobek: ?redni"

local cele = {
{-1260.78, 1018.87, -0.55},
{-927.69, 733.06, -0.55},
{-1026.79, 311.12, -0.55},
{-1072.59, -182.59, -0.55},
{-1110.36, -246.68, -0.55},

}

--local missionZaladunek=createMarker(-1968.61,-2427.98,30.63,"cylinder",5,0,128,128)

local text=createElement("text")
setElementPosition(text, -1445.30, 1500.87, 1.74)
setElementData(text,"name","Praca: Wylawiania beczek z wodyn Zarobek: ?redni")

addEvent("startJobek", true)
addEventHandler("startJobek", resourceRoot, function(veh)
if getElementData(localPlayer,"player:job") ~= code then return end
missionVehicle=veh
showMarker()
addEventHandler("onClientRender",root,render3)
setTimer(renderstop3,1000,1)
end)

function finishJob(plr,value1,value2)
if plr ~= getLocalPlayer() then return end
if getElementData(localPlayer,"player:job") ~= code then return end
if value1 == true then
if isElemen...
6. dxDrawRectangle w markerze
Poka?e kto? przyk?ad jak mo?na otworzy? dxDrawRectangle z eventem "onClientMarkerHit" ? Za przyk?adzik piwko bo nie ogarniam tego :/
7. Nadawanie prawa jazdy w markerze oraz jego zabieranie
Jak zrobi? nadawanie prawa jazdy w markerze oraz jego zabieranie przez komend??
8. DxDraw w markerze
chodzi oto ,?e chyba co? ?le zrobi?em bo chcia?em aby DxDraw si? wy?wietla? w merkerze ale tak si? nie sta?o

addEventHandler
("onClientMarkerHit"marker, function(hit)
dxDrawLine(454 1220 1454 1585tocolor(000255), 1false marker)
  
      
dxDrawLine(898220 1454 1220 1tocolor(000255), 1false marker)
   
     
dxDrawLine(454 1585898585tocolor(000255), 1falsemarker)
      
  
dxDrawLine(898585898220 1tocolor(000255), 1falsemarker)
   
     
dxDrawRectangle(454220444365tocolor(7247244255), falsemarker)
    
    
dxDrawText("Poziom Drwala"516225872268tocolor(252191255), 1.00dxfont0_PetitFormalScript"left""top"falsefalsefalsefalsefalsemarker)
    
    
dxDrawRectangle(53629424830tocolor(52520255), falsemarker)
     
   
dxDrawRectangle(53435825025tocolor(52520255), falsemarker)
    
zaczynajmy  =  dxDrawText("Poziom 1"574301671319tocolor(255255255255), 1.00"diploma""right""top"falsefalsefalsefalsefalsemarker)
     
   
dxDrawText("Poziom 2"559360663383tocolor(255255255255), 1.00"beckett""right""top"falsefalsefalsefalsefalsemarker)
if 
hit ~= localPlayer then return end
9. Nazwa samochodu w markerze Gridlist
Witam, pr?buj? zrobi? wy?wietlenie nazwy samochodu w Gridlist w kolumnie o nazwie 'Model'.

GUI:
[lua]
marker = createMarker(-2052.3999023438, 170.5, 27.799999237061, "cylinder", 4, 255, 0, 0, 0)

local screenW, screenH = guiGetScreenSize()
oknoPojazdow = guiCreateWindow(10, (screenH - 372) / 2, 836, 372, "GUI", false)
guiWindowSetSizable(oknoPojazdow, false)
guiSetVisible(oknoPojazdow, false)

gridList = guiCreateGridList(10, 29, 669, 287, false, oknoPojazdow)
column1 = guiGridListAddColumn(panelUszkodzen, "Model", 0.3)
row = guiGridListAddRow(gridList)
nazwa = guiGridListSetItemText(panelUszkodzen, 0, 1, "-", false, false)
[/lua]

A tutaj kod kt?ry zrobi?em:

[lua]
addEventHandler("onClientMarkerHit", marker,
function(hitPlayer,matchingDimension)
if (not matchingDimension) or (isElement(oknoPojazdow)) or (hitPlayer ~= localPlayer) then
return
end

local samochody = getPedOccupiedVehicle(localPlayer)

local nazwaSamochodu = samochody and getVehicleName(samochody) or "-"

guiGridListSetItemText(gridList, row, 1, nazwaSamochodu, false, false)
end
)

addEventHandler("onClientMarkerLeave", marker,
function(leftPlayer,matchingDimension)
if (leftPlayer == localPlayer) and (matchingDimension) and (isElement(oknoPojazdow)) then
...
10. funkcja w markerze
Witam, gdy chc? aby zmienia?o graczowi skin tylko gdy jest w markerze w sensie, ?e gdy jest nad nim lub pod to nie zmieni, tylko gdy w markerze si? znajduje to zmeinia
To czy takie co? b?dzie odpowiednie?

koszar createMarker (-2903.07251426.575413.91406'cylinder'1.025500)
nomex createMarker (-2902.57056430.021453.91406'cylinder'1.025500)
domowe createMarker (-2906.42236426.441473.91406,'cylinder'1.025500)


addEventHandler("onClientMarkerHit"root, function(hemd)

if 
he == localPlayer then
if isElementWithinMarker(localPlayerkoszarthen
    
if source == koszar then
        setElementModel
(localPlayer 277)
        if 
isElementWithinMarker(localPlayernomexthen
    
elseif source == nomex then
        setElementModel
(localPlayer 278)
        if 
isElementWithinMarker(localPlayerdomowethen
    
elseif source == domowe then
        setElementModel
(localPlayer 21)
    
end
    end
    end
end
end
end
)
11. Sprawdzanie czy pojazd jest w markerze
Witam, jak zrobi? skrypt na mechanika chodzi mi tylko o sprawdzanie w markerze czy pojazd jest w 2 markerze
12. Gui w Markerze
Witam, m?g?by mnie kto? naprowadzi? jak zrobic gui w markerze, wraz z przyciskami, np. Wyp?ata, oraz z wyborem graczy na "suwak"? Prosi?bym tez o nie przekierowywanie na inne poradniki chyba, ?e s? dobrze opisane. Gui w markerze oczywiscie na ACL jak Mo?na
13. Marker po markerze
Mam tablic? z markerami i chcia?bym zrobi? funkcj? kt?ra po rozpocz?ciu pracy utworzy mi pierwszy marker a po najechaniu na niego zniszczy go a nast?pnie utworzy kolejny i tak do ko?ca a? przejd? przez wszystkie markery.

Tu kawa?ek mojej tablicy:
miejsca = {
{
= -129.6000061035256.2999992370613.1},
{
= -153.60000610352= -7.30000019073493.1},
{
= -182.69999694824= -79.5999984741213.1},
{
= -193= -75.9000015258793.1},
{
= -167.10000610352= -4.30000019073493.1},
{
= -144.8000030517661.7999992370613.1}
14. GUI w markerze podsumowanie
Witam, problem, Mianowicie Po otwarciu GUI brak kursora. Oraz GUI otwiera si? ka?demu nie tylko temu co wejdzie w Marker

DB3:
ERROR: naprawa/client.lua:37: attemp to call global 'getElementByType' (a nil value)

[lua]marker = createMarker(-2032.24512, 173.45181, 27.83594,"cylinder",1.0,0,245,234,255)

GUIEditor = {
checkbox = {},
window = {},
button = {},
memo = {}
}
addEventHandler("onClientResourceStart", resourceRoot,
function()
GUIEditor.window[1] = guiCreateWindow(0, 0, 312, 234, "", false)
guiWindowSetSizable(GUIEditor.window[1], false)
guiSetVisible(GUIEditor.window[1], false)

GUIEditor.button[1] = guiCreateButton(181, 276, 15, 15, "", false, GUIEditor.window[1])
GUIEditor.button[2] = guiCreateButton(272, 216, 15, 15, "", false, GUIEditor.window[1])


GUIEditor.window[2] = guiCreateWindow(410, 165, 277, 233, "Panel Napraw By Marcin", false)
guiWindowSetSizable(GUIEditor.window[2], false)

GUIEditor.checkbox[1] = guiCreateCheckBox(303, 101, 0, 15, "", false, false, GUIEditor.window[2])


GUIEditor.button[3] = guiCreateButton(415, 224, 120, 27, "Napraw", false)


GUIEditor.button[4] = guiCreateButton(581, 364, 91, 24, "Zamknij", false)


GUIEditor.memo[1] = guiCreateMemo(550, 259, 132, 84, "Tutaj Naprawisz Pojazd", false)
...
15. GUI w markerze i standard !
Witam, ot?? mam skrypt na gui w markerze, no ale oczywi?cie jak wiadomo problem jest, Poniewa? po wej?ciu w marker nic si? nie dzieje

DB jedynie:

WARNING: naprawa/server.lua:58:Bad argument @ 'addEventHandler' [Expected element at argument 2, got nil]


WARNING: naprawa/server.lua:50:Bad argument @ 'addEventHandler' [Expected element at argument 2, got nil]

Kod

[lua]
marker = createMarker(-2032.24512, 173.45181, 27.83594,"cylinder",1.0,0,245,234,255)

GUIEditor = {
checkbox = {},
window = {},
button = {},
memo = {}
}
addEventHandler("onClientResourceStart", resourceRoot,
function()
GUIEditor.window[1] = guiCreateWindow(0, 0, 312, 234, "", false)
guiWindowSetSizable(GUIEditor.window[1], false)
guiSetVisible(GUIEditor.window[1], false)

GUIEditor.button[1] = guiCreateButton(181, 276, 15, 15, "", false, GUIEditor.window[1])
GUIEditor.button[2] = guiCreateButton(272, 216, 15, 15, "", false, GUIEditor.window[1])


GUIEditor.window[2] = guiCreateWindow(410, 165, 277, 233, "Panel Napraw By Marcin", false)
guiWindowSetSizable(GUIEditor.window[2], false)

GUIEditor.checkbox[1] = guiCreateCheckBox(303, 101, 0, 15, "", false, false, GUIEditor.window[2])


GUIEditor.button[3] = guiCreateButton(415, 224, 120, 27, "Napraw", false)


GUIEditor.button[4] = guiCreateButto...
16. GUI w markerze
Witam robi? naprawe pojazdu w gui i generalnie czy takie co? b?dzie dzia?a??

[lua]
marker = createMarker(x, y, z,"cylinder",1.0,0,245,234,255)

GUIEditor = {
checkbox = {},
window = {},
button = {},
memo = {}
}
addEventHandler("onClientResourceStart", resourceRoot,
function()
GUIEditor.window[1] = guiCreateWindow(0, 0, 312, 234, "", false)
guiWindowSetSizable(GUIEditor.window[1], false)
guiSetAlpha(GUIEditor.window[1], 0.00)

GUIEditor.button[1] = guiCreateButton(181, 276, 15, 15, "", false, GUIEditor.window[1])
GUIEditor.button[2] = guiCreateButton(272, 216, 15, 15, "", false, GUIEditor.window[1])


GUIEditor.window[2] = guiCreateWindow(410, 165, 277, 233, "Panel Napraw By Marcin", false)
guiWindowSetSizable(GUIEditor.window[2], false)

GUIEditor.checkbox[1] = guiCreateCheckBox(303, 101, 0, 15, "", false, false, GUIEditor.window[2])


GUIEditor.button[3] = guiCreateButton(415, 224, 120, 27, "Napraw", false)


GUIEditor.button[4] = guiCreateButton(581, 364, 91, 24, "Zamknij", false)


GUIEditor.memo[1] = guiCreateMemo(550, 259, 132, 84, "Tutaj Naprawisz Pojazd", false)

guiSetVisible(GUIEditor.window[1], false)
end
)

function guit (el, md)
if not md or getElementByType(el) ~~="player" then return end...
17. Skiny w markerze
C??.... jak wida? nie dzia?a, po wej?ciu w marker nic si? nie dzieje, db nic nie pokazuje. Skina nie zmienia



koszar 
createMarker (-706.27795954.9508711.43589'cylinder'0.525500)
nomex createMarker (-705.53644958.3042611.42441'cylinder'0.525500)
domowe createMarker (-704.49847963.7321811.42258,'cylinder'0.525500)


function 
koszar thePlayer )
 
setPedSkin thePlayer277 )
end
addEventHandler 
"onMarkerHit"koszarkoszar )

function 
nomex thePlayer )
 
setPedSkin thePlayer278 )
end
addEventHandler 
"onMarkerHit"nomexnomex )

function 
domowe thePlayer )
 
setPedSkin thePlayer21 )
end
addEventHandler 
"onMarkerHit"domowedomowe )
18. Gracze w markerze
Witam. To znowu ja. Teraz nie dzia?a mi funkcja pokazuj?ca graczy, kt?rzy s? w markerze. B??d w DB3:

Kod:

ad argument @ 'isElementWithinMarker' [Expected marker at argument 2, got nil]


Kod LUA:

function getElementsInMarker(marker)
elements = {}
    for 
i,v in pairs(getElementsByType("player")) do
        if 
isElementWithinMarker(vmarkerthen
        table
.insert(elementsv)
        
end
    end
return elements
end


Daj? :piwo: :D
19. gui w markerze
Witam mam gui i chc? aby jak si? wchodzi do markera to si? otwiera?o oraz pod ACL i jak klikn? button to si? zamknie. Jak b?dzie trza by?o kod podam :)
20. Dodawnia do acl w markerze
Witajcie kombinuje z tym kode i nie moge zrobi? tak aby doda? si? do acl Policja

local test 
createMarker (-1984.85217886.5474245.20313"cylinder"100255)

function 
dodaj (acc)
if 
acc then
if getAccount(acc) ~= false then
aclGroupAddObject 
(aclGetGroup("Policja"), "user."..acc)
end
addEventHadler 
("onMarkerHit"testdodaj)
21. Skin w markerze
Witam,
Chcia?bym zrobi? skiny na komend? w markerze i w interior 15 i dimenson 50
na ACL Premium, aby troch? skin?w w?o?y?.
Za pomoc daj? :arrow: :piwo:
22. Zmiana tablic w markerze
Witam chc? przerobi? skrypt na zmian? tablicy aby mo?na by?o zmienia? tablic? w markerze

kod:
function PlateText(thePlayer,commandName,text)
    
local Vehicle getPedOccupiedVehicle(thePlayer)
    if 
Vehicle then
        
if text then
            setVehiclePlateText
Vehicletext )
        else
            
outputChatBox("Nale?y wpisa? wiadomo??.",thePlayer)
        
end
    
else
        
outputChatBox("Potrzebujesz pojazdu aby zmieni? rejestracj?!",thePlayer)
    
end
end
addCommandHandler
("tablica",PlateText)

i za za?o?enie tablicy zabiera?o graczowi 1000 z?
za pomoc daje :piwo: i R*


Wiem ?e trzeba u?y?:
zmianatablic createMarker (-162.6331167.72619"cylinder"20,0,0,100 )
addEventHandler("onMarkerHit"zmianatablic, function(e)
takePlayerMoney (PlateText1000 )

Tylko niewiem w jakim miejscu trzeba wstawi?
23. Zmiana wariantu w markerze
Witam potrzebuje pomocy pr?bowa?em zrobi? aby mo?na zmieni? warniant w markerze ale mi niewychodzi

oryginalny zas?b:
[lua]function ustawWariant(kierowca, command, wariant1, wariant2, wariant3)
local wariant1, wariant2, wariant3 = tonumber(wariant1), tonumber(wariant2), tonumber(wariant3)
local pojazd = getPedOccupiedVehicle(kierowca)
if (pojazd and getVehicleController(pojazd) == kierowca) then
local ustaw = setVehicleVariant(pojazd, wariant1, wariant2, wariant3)
if (ustaw) then
end
end
end
addCommandHandler("wariant", ustawWariant)[/lua]





przerobiony:
[lua]m = createMarker (-162.633, 1167.726, 19.795, "cylinder", 1, 255, 0, 0, 255 )

function MarkerHit( hitElement, matchingDimension )
outputChatBox( "Aby zmieni? wariant wpisz /wariant koszt zmiany wariantu to 1000PLN", getRootElement(), 255, 255, 0 )
function ustawWariant(kierowca, command, wariant1, wariant2, wariant3)
local wariant1, wariant2, wariant3 = tonumber(wariant1), tonumber(wariant2), tonumber(wariant3)
local pojazd = getPedOccupiedVehicle(kierowca)
if (pojazd and getVehicleController(pojazd) == kierowca) then
local ustaw = setVehicleVariant(pojazd, wariant1, wariant2, wariant3)
if (ustaw) then
end
end
end
addCommandHandler("wariant", ustawWariant)
addEventHandler( "onMarkerHit", m, MarkerHit )[/lua]

[b][u]Odrazu m?wie ?e skrypt niejest m?j ja ...
24. DxDrawText w danym Markerze
Witam. mam o to taki problem bo nie wiem jak da? DxDrawText do danego Markera o danej Nazwie jak si? w niego wjedzie / wejdzie
Za pomoc Stawiam :piwo:

Skrypt po Stronie Clienta
Zrobione
25. Animacja w markerze
Witam.
Czy jest mo?liwo?? zrobienia markeru po wej?ciu do kt?rego wykonywana jest jaka? dana animacja np. jedzenie.
Za pomoc stawiam :arrow: :piwo:
26. Zmiana tablic w markerze
Witam mam o to taki problem bo nie wiem jak zrobi? z?by by?o to na marker
(chodzi mi o to gdy mamy pojazd i wje?d?amy w marker wyskakuje nam gui z zmiana tablicy)
Za pomoc :arrow: :piwo:

[lua]local screenX, screenY = guiGetScreenSize()
local width, height = 250, 300
local x = (screenX/1.15) - (width/2)
local y = (screenY/2) - (height/2)
PlateWnd = guiCreateWindow(x,y,width,height,"Panel Zmiany Rejestracji",false)
guiWindowSetSizable(PlateWnd,false)
guiWindowSetMovable(PlateWnd, false)
guiSetVisible(PlateWnd, false)
guiSetInputMode("no_binds_when_editing")
editPlate = guiCreateEdit(20, 65, 210, 30, "", false, PlateWnd)
guiEditSetMaxLength(editPlate, 8)
button1Plate = guiCreateButton(13, 257, 110, 30, "OK", false, PlateWnd)
button2Plate = guiCreateButton(127, 257, 110, 30, "Zamknij", false, PlateWnd)
lbl1Plate = guiCreateLabel(45, 21, 188, 17, "Wcisni OK Aby Zmienic Tablice", false, PlateWnd)
ldl2Plate = guiCreateLabel(75, 41, 117, 17, "(Max. 8 Symboli)", false, PlateWnd)
lbl3Plate = guiCreateLabel(40,110,250,17,"Skrypt W Fazie Testow/Poprawek",false,PlateWnd)
guiLabelSetColor(lbl3Plate, 128, 128, 128)
addCommandHandler( "plate", function()
if isPedInVehicle(getLocalPlayer()) then
if (guiGetVisible(PlateWnd) == true) then
guiSetVisible(PlateWnd, false)
showCursor(false)
else
guiSetVisible(PlateWnd, true)
showCursor (true)
...
27. Panel Informacyjny w markerze
Potrzebuje panel informacyjny kt?ry po wej?ciu w marker si? pokazuje za pomoc :arrow: :piwo:
Potrzebuje go do wstawienia tam cen aut
28. 2 gui w 1 markerze
Witam.Mam takie ma?e pytanko umiem zrobi? 1 gui i logowanie do frakcji ale nie wiem jak zrobi? takie zakoncz prace
29. Gui w markerze
Witam mam ma?y problem umiem stworzy? gui ale nie umiem podpisa? go pod marker pomo?e kto????
30. Skrypt na opis w Markerze
Witam mam problem z skryptem wchodz? do markeru i nie wyskakuje na czacie ?adna wiadomosc prosze o pomoc.
Pr?buje tez wjecha? w marker ale to nic nie daje :(

Za Pomoc Zimne :piwo:

Kod
local Marker5 createMarker ( -2076.8999, -113.634.3 "cylinder"1.5255255255170 )
   
addEventHandler("onClientMarkerHit"Marker5, function(el)
    if 
getPedOccupiedVehicle(elthen return end
    
if el ~= getLocalPlayer() then return end
end
)
addEventHandler("onClientMarkerHit"Marker5, function(el)
    
outputChatBox("((Uzyj /vopis <opis auta> I Wystaw Je Na Gie?de ))")
end)


Konsola
31. Pojazd w markerze
Witam.
Robi? skrypt na naprawianie pojazdu, ale nie wiem jak zlokalizowa? pojazd kt?ry znajduj? si? w danym markerze.

np:
local veh =  pojazd kt?ry jest w markerzenazwaMarkera )


Mam nadziej? wiecie o co chodzi.
32. Naprawa pojazdów w Markerze
Wstawia?em wcze?niej m?j skrypt ale ci?gle wypisywa?o "U?y?e? niedozwolonego s?owa, zapoznaj si? z TYM tematem" a TEN temat nie istnieje...

[ Dodano : 2014-10-24, 19:38 ]
Witam, m?g?by mi kto? pom?c? Pr?bowa?em pisa? skrypty i wysz?o mi takie co? i nawet dzia?a?o. A teraz nie dzia?a...


Og?lnie to chodzi, o naprawianie auta poprzez marker. Ma kto? pomys?, dlaczegonie dzia?a?

[lua]
marker = createMarker (1850.090, -1856.221, 12.3, "cylinder", 5.0, 50, 204, 57, 255)
function fix(playerSource)
local theVehicle = getPedOccupiedVehicle(playerSource)

if theVehicle and getVehicleController(theVehicle) == playerSource then
if getPlayerMoney ( playerSource ) < 150 then return end
fixVehicle (theVehicle)
takePlayerMoney (playerSource, 150)
outputChatBox ("Pojazd zosta? naprawiony!" , getLocalPlayer)
end
end

addEventHandler ( "onMarkerHit", marker, fix)


marker = createMarker (1929.090, -2067.221, 12.3, "cylinder", 5.0, 50, 204, 57, 255)
function fix(playerSource)
local theVehicle = getPedOccupiedVehicle(playerSource)

if theVehicle and getVehicleController(theVehicle) == playerSource then
if getPlayerMoney ( playerSource ) < 70 then return end
fixVehicle (theVehicle)
takePlayerMoney (playerSource, 70)
outputChatBox ("Pojazd zosta? naprawiony!" , getLocalPlayer)
end
end
addEventHandler ( "onMarkerHit", marker, fix)


marker = createMarker (487.290, -1...
33. Naprawa pojazdów w Markerze
Mam problem, gdy? nie mam poj?cia jak zrobi?, by marker w chwili gdy gracz nie ma wystarczaj?co pieni?dzy odmawia? naprawy.

Do tej pory metod? pr?b i b??d?w osi?gn??em:
-Ca?kowita odmowa naprawy mimo ?rodk?w
-Naprawa mimo braku ?rodk?w


M?g?by mi kto? pom?c?
Tutaj kod:
Kod:

marker = createMarker (1850.090, -1856.221, 12.3, "cylinder", 5.0, 50, 204, 57, 255)

function fix(playerSource)
local theVehicle = getPedOccupiedVehicle(playerSource)

if theVehicle and getVehicleController(theVehicle) == playerSource then
fixVehicle (theVehicle)
takePlayerMoney (playerSource, 150)
outputChatBox ("Pojazd zosta? naprawiony!" , thePlayer)




end
end

addEventHandler ( "onMarkerHit", marker, fix)
34. Sprawdzenie w ktorym markerze jest gracz
Witam, mam taki ma?e pytanko - jak najpro?ciej sprawdzi? do kt?rego markera wszed? gracz?
Np. mam 2 markery na mapie i gracz wchodzi do ktorego? z nich i pojawia si? info. Gracz wszed? do markera nr.1/2
35. Naprawa w markerze
Mam dwa problemy z napraw? w markerze ;/

1. Gdy wjade w marker skrypt zabiera mi kase dop?ki z niego nie wyjade, a ma zabra? tylko raz.

2. Jak zrobi? by tylko kierowca mog? u?y? tego markeru?

Kod:
function fixCarSF(thePlayer)
    
local car getElementsByType("vehicle")
    for 
kv in ipairs(car) do
        
fixVehicle(v)
        
takePlayerMoney(thePlayer100)
        
outputChatBox("Naprawi?e? pojazd! Tracisz $ 100!"thePlayer0170255true)
    
end
end
addEventHandler
("onMarkerHit"mark1fixCarSF)