Jump to content

Client-side markers - > Save the server side?


Recommended Posts

Posted

Hi,

I would like to Client-side markers - > Save the server side?

I need it for a client-side query whether the marker is already occupied or not?

marker = createMarker(0, 0, 0, "corona", 2.0, 0, 0, 0, 0, getRootElement()) 
setElementData(marker, "BankState", false) 
  
function onHitBankautomat(player, dim) 
  
    if (getElementData(source, "BankState") == false) 
        setElementData(source, "BankState", true) 
         
    else 
        outputChatBox("The ATM is already taken!", 200, 0, 0) 
    end 
end 
addEventHandler("onClientMarkerHit", marker, onHitBankautomat) 

Unfortunately, the script only works for the Local Clienseitgen markers and not for all client side marker by all players.

I find this very hard and hope someone can help me!

Posted

Because you only markers currently may make Clientseitg with attachElements!

On the server side will not have always been there with problems!

Objekt attachElement with Marker and Event from Server it does not work.

Posted
You may bother using triggerServerEvent with the marker variable as a argument? Do anything you want in the server with it.

Server side doesn't recognize elements created client side.

Posted
Can someone help me with the problem someone else?

https://bugs.multitheftauto.com/view.php?id=8892

try this it should work

bank = createObject(2942, 2489.6000976563, -1667.3000488281, 13) 
marker = createMarker(2489.6000976563, -1667.3000488281, 13, "corona", 2.0, 0, 0, 0, 0, getRootElement()) 
attachElements(marker, bank) 
  
function onHitBankautomat(player, dim) 
    if dim and isElement(player) and getElementType(player) == "player" then  
        outputChatBox("Function triggered!", player, 0, 200, 0) 
    end  
end 
addEventHandler("onMarkerHit", marker, onHitBankautomat) 

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...