Jump to content

onClientMarkerHit Problem ?????!!!!!


Recommended Posts

Hi Guys ,,

this is my code :

  
marker1 = createMarker(-2319.1865234375, -1837.935546875, 499.82629394531 , "cylinder" , 1, 0, 0, 204, 200) 
  
function markers(thePlayer) 
    if source == marker1 then 
        local x,y,z = getElementPosition(thePlayer) 
        createObject(1655,x+20,y,z) 
        outputChatBox("Object Created !") 
    end 
end 
addEventHandler("onClientMarkerHit",getRootElement(),markers) 
  

Code works fine!

But I have a problem,

When i hit the marker

object and the message shows to all players!

Why?

This is strange

script is a client

Please Is there a solution?

I am very puzzled, because this client, why show all the players?

:cry:

Link to comment
marker1 = marker1 = createMarker(-2319.1865234375, -1837.935546875, 499.82629394531 , "cylinder" , 1, 0, 0, 204, 200) 
  
function markers(thePlayer) 
    if source == marker1 then 
        local x,y,z = getElementPosition(thePlayer) 
        createObject(1655,x+20,y,z) 
        outputChatBox('#FF0000Object Created !',255, 255, 0, true ) 
   end 
end 
addEventHandler("onClientMarkerHit",getRootElement(),markers) 

try this

no one in my server to test sorry u try :oops::P

Link to comment

It's wrong.

marker1 = createMarker(-2319.1865234375, -1837.935546875, 499.82629394531 , "cylinder" , 1, 0, 0, 204, 200) 
  
function markers(thePlayer) 
    if source == marker1 then 
        local x,y,z = getElementPosition(thePlayer) 
        createObject(1655,x+20,y,z) 
        outputChatBox('#FF0000Object Created !',255, 255, 0, true ) 
   end 
end 
addEventHandler("onClientMarkerHit",getRootElement(),markers) 

Link to comment
marker1 = createMarker(-2319.1865234375, -1837.935546875, 499.82629394531 , "cylinder" , 1, 0, 0, 204, 200) 
  
function markers(thePlayer) 
    if thePlayer == getLocalPlayer() then 
        local x,y,z = getElementPosition(thePlayer) 
        createObject(1655,x+20,y,z) 
        outputChatBox('Object Created !',255,255,0) 
   end 
end 
addEventHandler("onClientMarkerHit",marker1,markers) 

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