Jump to content

help createMarker in interior


LucasBaker

Recommended Posts

basepfs = createMarker(238.62816, 140.98083, 1003.02344, 'cylinder', 1.0, 255, 0, 0, 150) 
  
function sairBasePF(player) 
setElementDimension (basepfs, 0) 
setElementInterior (basepfs, 3) 
isElementWithinMarker(player, basepfs) 
outputChatBox("[sERVER] Você saiu da HQ da Polícia Federal", player, 0, 255, 0) 
setElementPosition (player, x, y, z) 
setElementInterior (player, 0) 
end 
addEventHandler( "onMarkerHit", basepfs, sairBasePF ) 

3 debugscript not appear in an error and will not appear on the marker position

Link to comment

'elementDimension' & 'elementInterior' have to be out of function with marker and forgot the 'if' & 'then', and I solved it.

basepfs = createMarker(238.62816, 140.98083, 1003.02344, 'cylinder', 1.0, 255, 0, 0, 150) 
setElementDimension (basepfs, 0) 
setElementInterior (basepfs, 3) 
  
function sairBasePF(player) 
   if isElementWithinMarker(player, basepfs) then 
   outputChatBox("[sERVER] Você saiu da HQ da Polícia Federal", player, 0, 255, 0) 
   setElementPosition (player, x, y, z) 
   setElementInterior (player, 0) 
   end 
end 
addEventHandler( "onMarkerHit", basepfs, sairBasePF ) 

Link to comment
'elementDimension' & 'elementInterior' have to be out of function with marker and forgot the 'if' & 'then', and I solved it.
basepfs = createMarker(238.62816, 140.98083, 1003.02344, 'cylinder', 1.0, 255, 0, 0, 150) 
setElementDimension (basepfs, 0) 
setElementInterior (basepfs, 3) 
  
function sairBasePF(player) 
   if isElementWithinMarker(player, basepfs) then 
   outputChatBox("[sERVER] Você saiu da HQ da Polícia Federal", player, 0, 255, 0) 
   setElementPosition (player, x, y, z) 
   setElementInterior (player, 0) 
   end 
end 
addEventHandler( "onMarkerHit", basepfs, sairBasePF ) 

Where is defined x,y, z? Why did you check, again if the player is on the marker since he already hit him (onMarkerHit) ?

You should check if the element is a player before teleporting the player.

Regards.

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