Banex Posted October 13, 2014 Posted October 13, 2014 You're welcome Not worry about the future. Very soon it will come.
yoya99 Posted October 13, 2014 Author Posted October 13, 2014 another question how can i make it be shown not only my own also the images of the other players.....hellpppp pls i used that code here: local sx,sy = guiGetScreenSize() function showImage() if getElementData(getLocalPlayer(), "showImage") then dxDrawImage((sx-190)/2, (sy-200)/2, 25, 25, "classicon_player.png" ) else dxDrawImage((sx-190)/2, (sy-200)/2, 25, 25, "classicon_vip.png" ) end end addEventHandler("onClientRender", root, showImage) function setDataOnLogin() if isObjectInACLGroup ("user."..getAccountName (getPlayerAccount( source )),aclGetGroup ( "Admin" )) then setElementData(source, "showImage", true) end end addEventHandler("onPlayerLogin", root, setDataOnLogin) function setDataOnResourceStart() for i, v in ipairs(getElementsByType("player")) do if isObjectInACLGroup ("user."..getAccountName (getPlayerAccount ( v )), aclGetGroup ( "Admin" )) then setElementData(v, "showImage", true) end end end addEventHandler("onResourceStart", resourceRoot, setDataOnResourceStart) function removeDataOnLogout() setElementData(source, "showImage", false) end addEventHandler("onPlayerLogout", root, removeDataOnLogout) And the snail starts to sing
Banex Posted October 13, 2014 Posted October 13, 2014 you are trying to create an image above the player's head? Not worry about the future. Very soon it will come.
yoya99 Posted October 13, 2014 Author Posted October 13, 2014 left of the palyers head yes.....but i want to show the images from other players too.....so i wantto show my own and the images from others And the snail starts to sing
Banex Posted October 13, 2014 Posted October 13, 2014 (edited) try this: addEventHandler( 'onClientRender', root, function() for _, player in ipairs( getElementsByType( 'player') ) do if isElementOnScreen( player ) and getElementData( player, 'showImage' ) then local cx, cy, cz = getCameraMatrix() local vx, vy, vz = getPedBonePosition( player, 8 ) local dist = getDistanceBetweenPoints3D(cx, cy, cz, vx, vy, vz ) local drawDistance = 70.0 local target = getPedTarget(localPlayer) if dist < drawDistance or player == target then if( isLineOfSightClear(cx, cy, cz, vx, vy, vz, true, false, false) ) then x, y = getScreenFromWorldPosition (vx, vy, vz + 0.3) if(x and y) then dxDrawImage(x, y, x + 20, y + 20, "classicon_player.png" ) end end end end end end) Copy the code again Edited October 13, 2014 by Guest Not worry about the future. Very soon it will come.
yoya99 Posted October 13, 2014 Author Posted October 13, 2014 replace ?? aND WHAT IS WITH ELSE? And the snail starts to sing
yoya99 Posted October 13, 2014 Author Posted October 13, 2014 ok any ideas with the topic xp little help ? no error in debug And the snail starts to sing
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