abdalbaset Posted December 4, 2014 Share Posted December 4, 2014 hello guys, how can i make respawn inside colshipe (example player got killed in the colshipe he will be respawned in it) Link to comment
WASSIm. Posted December 5, 2014 Share Posted December 5, 2014 use this: getPointFromDistanceRotation Link to comment
abdalbaset Posted December 5, 2014 Author Share Posted December 5, 2014 use this: getPointFromDistanceRotation i mean whene player die in the colshipe he get's respawn in it again ,i didnt understand how getPointFromDistanceRotation works Link to comment
WASSIm. Posted December 5, 2014 Share Posted December 5, 2014 can you post script when player die and line create colshape ? Link to comment
Ab-47 Posted December 5, 2014 Share Posted December 5, 2014 Or do you mean safezones? Like a player gets killed randomly anywhere on the map and spawns within a colshape? Link to comment
abdalbaset Posted December 6, 2014 Author Share Posted December 6, 2014 Or do you mean safezones? Like a player gets killed randomly anywhere on the map and spawns within a colshape? yeah exactly Link to comment
WASSIm. Posted December 6, 2014 Share Posted December 6, 2014 you mean spawn in random safezone ? if is it, post your full code Link to comment
abdalbaset Posted December 6, 2014 Author Share Posted December 6, 2014 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
WASSIm. Posted December 6, 2014 Share Posted December 6, 2014 where other safezones ? Link to comment
abdalbaset Posted December 6, 2014 Author Share Posted December 6, 2014 where other safezones ? Just one i am going to use it as DM area player get killed and respawn there Link to comment
Banex Posted December 10, 2014 Share Posted December 10, 2014 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
Moderators IIYAMA Posted December 10, 2014 Moderators Share Posted December 10, 2014 @Banex Serverside is managing multiply players, the variable bool is used by all. Use a table (or elementdata for beginners) instead. Link to comment
abdalbaset Posted December 11, 2014 Author Share Posted December 11, 2014 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
abdalbaset Posted December 11, 2014 Author Share Posted December 11, 2014 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
Banex Posted December 14, 2014 Share Posted December 14, 2014 @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
abdalbaset Posted December 18, 2014 Author Share Posted December 18, 2014 thanks man ,another thing how can i make counter to count players kills and show who is the top killer Link to comment
abdalbaset Posted December 23, 2014 Author Share Posted December 23, 2014 kills addEventHandler( "onPlayerWasted", getRootElement(), function( killer ) givePlayerMoney( killer, 100 ) kills=kills+1 end ) like that? Link to comment
Castillo Posted December 23, 2014 Share Posted December 23, 2014 No, that is a global variable ( wrongly defined too, it should've been kills = 0 ), you need a table to count the kills of each player. http://lua-users.org/wiki/TablesTutorial Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now