Jump to content

Marker "w wielu miejscach"


Recommended Posts

Cześć! Mam pewien problem, mianowicie zrobiłem w dokach marker i przypisałem pod niego GUI. Wszystko pięknie, tylko GUI wyświetla się też po wjechaniu w inne miejsca, nie musi być w nich markera. Po prostu "z dupy".

Robię kod przykładowo tak:

local dokils = createMarker(2480.7099609375,-2494.4326171875,13.671371459961, 2, "cylinder") 
local car = getPedOccupiedVehicle(getLocalPlayer()) 
local apojazd = getVehicleName(car) 
GUIEditor = { 
    button = {}, 
    window = {}, 
    label = {} 
} 
  
function pokazguisa (thePlayer) 
      
      
      if getVehicleController(car)~=getLocalPlayer() then return end 
      if source == dokils then 
   oknosa = guiCreateWindow(286, 101, 301, 367, "Sprzedawanie pojazdu", false) 
guiWindowSetSizable(GUIEditor.window[1], false) 
  
GUIEditor.label[1] = guiCreateLabel(17, 34, 246, 22, "Twój aktualny pojazd: "..apojazd.."", false, oknosa) 
GUIEditor.label[2] = guiCreateLabel(50, 76, 218, 17, "Czy aby na pewno chcesz go sprzedać?", false, oknosa) 
GUIEditor.button[1] = guiCreateButton(66, 153, 176, 54, "Tak", false, oknosa) 
zamknij = guiCreateButton(66, 243, 176, 58, "Anuluj", false, oknosa) 
showCursor(true) 
end 
end 
  
function zamknijguisa() 
    if source == zamknij then 
    guiSetVisible(oknosa,false) 
    showCursor(false) 
end 
end 
  
function sprzedaj (thePlayer) 
if getElementModel(car)== 579 then 
    givePlayerMoney ( thePlayer, 50000 ) 
    outputChatBox("Poprawnie sprzedałeś/aś pojazd Huntler i dostałeś/aś 50000$!", thePlayer, 255,0,0) 
end 
end 
  
  
addEventHandler("onClientMarkerHit", getRootElement(), pokazguisa) 
addEventHandler("onClientGUIClick", getRootElement(), zamknijguisa)     

Co jest źle?

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...