Jump to content

colshipe stuff


abdalbaset

Recommended Posts

  
local Col = createColCuboid(1290.5771,2100,11.0156, 300, 100, 30) 
local pArea1 = createRadarArea( 1290.5771,2100,200, 150, 32, 32,32) 
  
  
function shapeHit ( thePlayer )  
  
 givePlayerMoney (thePlayer , 1000 ) 
end 
  
addEventHandler('onColShapeHit', Col,shapeHit) 
  
  

that all what i made

Link to comment
local Col = createColCuboid(1290.5771,2100,11.0156, 300, 100, 30) 
local pArea1 = createRadarArea( 1290.5771,2100,200, 150, 32, 32,32) 
bool = false 
  
function shapeHit( thePlayer ) 
    givePlayerMoney (thePlayer , 1000 ) 
end  
addEventHandler('onColShapeHit', Col,shapeHit) 
  
function onWasted() 
    if isElementWithinColShape( source, Col )  
        bool = true 
    end 
end 
addEventHandler ( "onPlayerWasted", getRootElement(), onWasted ) 
  
function onSpawn() 
    if bool then 
    --setElementPosition 
    end 
end 
addEventHandler ( "onPlayerSpawn", getRootElement(), onSpawn ) 

Link to comment
  
local Col = createColCuboid(1290.5771,2100,11.0156, 300, 100, 30) 
local pArea1 = createRadarArea( 1290.5771,2100,200, 150, 32, 32,32) 
bool = false 
  
function shapeHit( thePlayer ) 
    givePlayerMoney (thePlayer , 1000 ) 
end 
addEventHandler('onColShapeHit', Col,shapeHit) 
  
function onWasted() 
    if isElementWithinColShape( source, Col ) 
        bool = true 
    end 
end 
addEventHandler ( "onPlayerWasted", getRootElement(), onWasted ) 
  
  
function onSpawn() 
    if bool then 
    setElementPosition (--here??,1369.93,2194.938,9.757) 
    end 
end 
addEventHandler ( "onPlayerSpawn", getRootElement(), onSpawn ) 
  
  

what should i put instead of "--here??" ,is that serverside or client side ,thanx for your help :)

Link to comment
local Col = createColCuboid(1290.5771,2100,11.0156, 300, 100, 30) 
local pArea1 = createRadarArea( 1290.5771,2100,200, 150, 32, 32,32) 
bool = false 
  
function shapeHit( thePlayer ) 
    givePlayerMoney (thePlayer , 1000 ) 
end  
addEventHandler('onColShapeHit', Col,shapeHit) 
  
function onWasted() 
    if isElementWithinColShape( source, Col )  
        bool = true 
    end 
end 
addEventHandler ( "onPlayerWasted", getRootElement(), onWasted ) 
  
function onSpawn() 
    if bool then 
    --setElementPosition 
    end 
end 
addEventHandler ( "onPlayerSpawn", getRootElement(), onSpawn ) 

it's not working i cant see the colshape on the map anymore

Link to comment

@IIYAMA you're right, I do not really know where I was thinking that day.

This should work:

server side

local Col = createColCuboid(1290.5771,2100,11.0156, 300, 100, 30) 
local pArea1 = createRadarArea( 1290.5771,2100,200, 150, 32, 32,32) 
local inColShape = { } 
  
function shapeHit( thePlayer ) 
    givePlayerMoney (thePlayer , 1000 ) 
end 
addEventHandler('onColShapeHit', Col,shapeHit) 
  
function onWasted() 
    if isElementWithinColShape( source, Col ) then 
        inColShape[source] = true 
    else 
        inColShape[source] = false 
    end 
end 
addEventHandler ( "onPlayerWasted", getRootElement(), onWasted ) 
  
function onSpawn() 
    if inColShape[source] then 
        setElementPosition(source, 1290.5771,2100,11.0156) 
    end 
end 
addEventHandler ( "onPlayerSpawn", getRootElement(), onSpawn ) 

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