Jump to content

help


golanu21

Recommended Posts

Posted
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) 

XajVsWV.png

168_zps269f1907.gif[Dev]BloWnRPG - We BloW the World [1%]168_zps269f1907.gif

Posted
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) 

Please do not PM me with scripting related question nor support, use the forums instead.

Posted

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 
) 

Please do not PM me with scripting related question nor support, use the forums instead.

Posted

[10:52:51] WARNING: check\server.lua:20: Bad argument @ 'setElementPosition' [Expected number at argument 2, got nil]

XajVsWV.png

168_zps269f1907.gif[Dev]BloWnRPG - We BloW the World [1%]168_zps269f1907.gif

Posted

I fixed this and edited my post.

Please do not PM me with scripting related question nor support, use the forums instead.

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