Jump to content

Marker Creator! Help ?


sel3a

Recommended Posts

Guys i am trying to make the marker when you type something it shows up i've made with the objects when you type the command it shows up. but i can't make when type the command a marker shows up.

This is the script:

  
sel3a1 = {} 
  
addCommandHandler ( "put", function(plr) 
team = getPlayerTeam ( plr ) 
if getTeamName ( team ) ~= "Criminals" then return end 
x,y,z = getElementPosition ( plr ) 
r1,r2,r3 = getElementRotation ( plr ) 
Sel3a = createObject ( 3108, x, y, z, r1, r2, r3 ) 
table.insert ( sel3a1, Sel3a ) 
end) 
  
  
addCommandHandler ( "remove", function(plr) 
team = getPlayerTeam ( plr ) 
if getTeamName ( team ) ~= "Criminals" then return end 
for k,v in ipairs ( sel3a1 ) do 
destroyElement ( v ) 
end 
end) 
  

i tried to change the CreateObject to createMarker like

Sel3a = createMarker ( cylinder, x, y, z, r1, r2, r3 ) 

but it didn't work please help. Thanks

Link to comment

mate i did the script with the marker the color of it keep changing i can't put it but when i remove it it works the marker will be gone but the ''debug script 2'' its keep spamming with.

WARNING: [test]\marker\add.lua: 38 Bad argument @ 'setMarkerColor' [Expected element at argument 1]

this is the script /:

sel3a1 = {} 
addCommandHandler ( "put", function(plr) 
team = getPlayerTeam ( plr ) 
if getTeamName ( team ) ~= "Admin" then return end 
x,y,z = getElementPosition ( plr ) 
r1,r2,r3 = getElementRotation ( plr ) 
Sel3a = createObject ( 3108, x, y, z-1, r1, r2, r3 ) 
  
table.insert ( sel3a1, Sel3a ) 
end) 
  
  
sel3a5002 = {} 
  
  
local v = {sel3a1,sel3a5002} 
local u = {sel3a1,sel3a5002} 
  
addCommandHandler ( "remove", function(plr) 
team = getPlayerTeam ( plr ) 
if getTeamName ( team ) ~= "Admin" then return end 
for k,v in ipairs (sel3a5002)  do 
destroyElement ( v ) 
end 
for k,u in ipairs (sel3a1)  do 
destroyElement ( u ) 
end 
end) 
  
addCommandHandler("put",function(plr) 
team = getPlayerTeam ( plr ) 
if getTeamName ( team ) ~= "Admin" then return end 
x,y,z = getElementPosition ( plr ) 
r1,r2,r3 = getElementRotation ( plr ) 
local Sel3a = createMarker ( x, y, z-1, 'cylinder', 1,255,0,0) 
setTimer(function () 
if Sel3a then 
setMarkerColor(Sel3a, math.random(0,255), math.random(0,255), math.random(0,255), 90) 
table.insert ( sel3a5002, Sel3a) 
end 
end,100,0) 
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...