xRGamingx Posted February 18, 2018 Share Posted February 18, 2018 Hello Friends, I need you to help me as much as you can! I need that when one player kills another this pointer image of the weapon comes out for 15 seconds example before killing him without the pointer Now when it kills it pointer leaves for 15 seconds -- Link to comment
LLCoolJ Posted February 18, 2018 Share Posted February 18, 2018 local killed_players = {} local imageTexture = dxCreateTexture("icon.png") addEventHandler("onClientPlayerSpawn",getRootElement(), function() if killed_players[source] then killed_players[source] = nil end end) addEventHandler("onClientPlayerWasted",getRootElement(), function(killer) if killer == localPlayer then killed_players[source] = true setTimer(function(source) killed_players[source] = nil end,15000,1,source) end end) addEventHandler("onClientRender",getRootElement(), function() for id,player in ipairs(getElementsByType("player")) do if killed_players[player] then local headPos = Vector3(getPedBonePosition(player,6)) dxDrawMaterialLine3D(headPos.x,headPos.y,headPos.z,headPos.x,headPos.y,headPos.z+0.7,imageTexture,1) end end end) Link to comment
xRGamingx Posted February 19, 2018 Author Share Posted February 19, 2018 (edited) On 18/2/2018 at 04:06, IRBIS said: local killed_players = {} local imageTexture = dxCreateTexture("icon.png") addEventHandler("onClientPlayerSpawn",getRootElement(), function() if killed_players[source] then killed_players[source] = nil end end) addEventHandler("onClientPlayerWasted",getRootElement(), function(killer) if killer == localPlayer then killed_players[source] = true setTimer(function(source) killed_players[source] = nil end,15000,1,source) end end) addEventHandler("onClientRender",getRootElement(), function() for id,player in ipairs(getElementsByType("player")) do if killed_players[player] then local headPos = Vector3(getPedBonePosition(player,6)) dxDrawMaterialLine3D(headPos.x,headPos.y,headPos.z,headPos.x,headPos.y,headPos.z+0.7,imageTexture,1) end end end) Hello friend, your code works as well, but you did it wrong the image must replace the pointer of the weapon, for 15 seconds And you made the image come up to the player who dies :3 look this must be replaced by the image for 15 seconds Edited February 19, 2018 by xRGamingx Link to comment
JeViCo Posted March 8, 2018 Share Posted March 8, 2018 disable crosshair temporary using setPlayerHudComponentVisible + setTimer and then enable it 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