Jump to content

help


golanu21

Recommended Posts

function crmarker (player, cmd, x1, x2, x3 ) 
local x, y, z = getLocalPlayer (player) 
if cmd == "createmarker" then 
    x1 = tonumber( x1 ) 
    x2 = tonumber( x2 ) 
    x3 = tonumber( x3 ) 
    if x1 then 
    if x2 then 
    if x3 then 
marker1 = createMarker ( x, y, z, "cylinder", 255, 0, 0 ) 
marker2 = createMarker ( x1, x2, x3, "cylinder", 255, 0, 0 ) 
else 
outputChatBox ("[invalid Syntax]: /crmarker [x1], [x2], [x3] ", player, 255, 0, 0 ) 
end 
end 
end 
end 
end 
addCommandHandler("createmarker", crmarker) 

Link to comment
function crmarker (player, cmd, x1, x2, x3 ) 
local x, y, z = getElementPosition(player) 
    if x1 and x2 and x3 then 
        marker1 = createMarker ( x, y, z, "cylinder", 255, 0, 0 ) 
        marker2 = createMarker ( tonumber(x1), tonumber(x2), tonumber(x3), "cylinder", 255, 0, 0 ) 
    else 
        outputChatBox ("[invalid Syntax]: /crmarker [x1], [x2], [x3] ", player, 255, 0, 0 ) 
    end 
end 
addCommandHandler("createmarker", crmarker) 

Link to comment

Try this:

function crmarker (player, cmd, x1, x2, x3 ) 
local x, y, z = getElementPosition(player) 
    if x1 and x2 and x3 then 
        px, py, pz = x1, x2, x3 
        marker1 = createMarker ( x, y, z, "cylinder", 255, 0, 0 ) 
        marker2 = createMarker ( tonumber(px), tonumber(py), tonumber(pz), "cylinder", 255, 0, 0 ) 
    else 
        outputChatBox ("[invalid Syntax]: /crmarker [x1], [x2], [x3] ", player, 255, 0, 0 ) 
    end 
end 
addCommandHandler("createmarker", crmarker) 
  
addEventHandler("onMarkerHit", root,  
    function(hitPlayer) 
        if isElement(marker1) and (source == marker1) then 
            if (getElementType(hitPlayer) == "player") then 
                local vehicle = getPedOccupiedVehicle(hitPlayer) 
                if vehicle then 
                    setElementPosition(vehicle, px, py, pz) 
                else 
                    setElementPosition(hitPlayer, px, py, pz) 
                end 
            end 
        end 
    end 
) 

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