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?
[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 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...
[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
...
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?
if he == localPlayer then if isElementWithinMarker(localPlayer, koszar) then if source == koszar then
setElementModel(localPlayer , 277)
if isElementWithinMarker(localPlayer, nomex) then elseif source == nomex then
setElementModel(localPlayer , 278)
if isElementWithinMarker(localPlayer, domowe) then elseif source == domowe then
setElementModel(localPlayer , 21) end
end
end
end
end
end)
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
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 = {
{x = -129.60000610352, y = 56.299999237061, z = 3.1},
{x = -153.60000610352, y = -7.3000001907349, z = 3.1},
{x = -182.69999694824, y = -79.599998474121, z = 3.1},
{x = -193, y = -75.900001525879, z = 3.1},
{x = -167.10000610352, y = -4.3000001907349, z = 3.1},
{x = -144.80000305176, y = 61.799999237061, z = 3.1}
}
Witam. To znowu ja. Teraz nie dzia?a mi funkcja pokazuj?ca graczy, kt?rzy s? w markerze. B??d w DB3:
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(v, marker) then
table.insert(elements, v) end
end return elements
end
Witajcie kombinuje z tym kode i nie moge zrobi? tak aby doda? si? do acl Policja
local test = createMarker (-1984.85217, 886.54742, 45.20313, "cylinder", 1, 0, 0, 255)
function dodaj (acc)
if acc then if getAccount(acc) ~= false then
aclGroupAddObject (aclGetGroup("Policja"), "user."..acc) end
addEventHadler ("onMarkerHit", test, dodaj)
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( Vehicle, text )
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 i
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]
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]
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
[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)
...
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
addEventHandler("onClientMarkerHit", Marker5, function(el)
if getPedOccupiedVehicle(el) then 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)
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)
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
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 k, v in ipairs(car) do fixVehicle(v) takePlayerMoney(thePlayer, 100) outputChatBox("Naprawi?e? pojazd! Tracisz $ 100!", thePlayer, 0, 170, 255, true) end
end
addEventHandler("onMarkerHit", mark1, fixCarSF)