abdalbaset Posted December 4, 2014 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)
abdalbaset Posted December 5, 2014 Author 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
WASSIm. Posted December 5, 2014 Posted December 5, 2014 can you post script when player die and line create colshape ?
Ab-47 Posted December 5, 2014 Posted December 5, 2014 Or do you mean safezones? Like a player gets killed randomly anywhere on the map and spawns within a colshape?
abdalbaset Posted December 6, 2014 Author 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
WASSIm. Posted December 6, 2014 Posted December 6, 2014 you mean spawn in random safezone ? if is it, post your full code
abdalbaset Posted December 6, 2014 Author 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
abdalbaset Posted December 6, 2014 Author Posted December 6, 2014 where other safezones ? Just one i am going to use it as DM area player get killed and respawn there
Banex Posted December 10, 2014 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 )
Moderators IIYAMA Posted December 10, 2014 Moderators 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.
abdalbaset Posted December 11, 2014 Author 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
abdalbaset Posted December 11, 2014 Author 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
Banex Posted December 14, 2014 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 )
abdalbaset Posted December 18, 2014 Author Posted December 18, 2014 thanks man ,another thing how can i make counter to count players kills and show who is the top killer
abdalbaset Posted December 23, 2014 Author Posted December 23, 2014 kills addEventHandler( "onPlayerWasted", getRootElement(), function( killer ) givePlayerMoney( killer, 100 ) kills=kills+1 end ) like that?
Castillo Posted December 23, 2014 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
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