(s)ection Posted June 18, 2014 Posted June 18, 2014 hi, i am a script someone gived me but the problem its when i create 2 projectiles this make 2 text : scirpt: function onClientProjectileCreationFunc() --thisProjectile = source addEventHandler( "onClientRender", getRootElement(), aoa) setTimer( function() removeEventHandler( "onClientRender", getRootElement(), aoa) addEventHandler( "onClientRender", getRootElement(), boa) end, 666, 1) setTimer( function() removeEventHandler( "onClientRender", getRootElement(), boa) addEventHandler( "onClientRender", getRootElement(), coa) end, 666+666, 1) setTimer( function() removeEventHandler( "onClientRender", getRootElement(), coa) end, 666+666+666+10, 1) end addEventHandler( "onClientProjectileCreation", getRootElement(), onClientProjectileCreationFunc ) function aoa() for index,thisProjectile in ipairs(getElementsByType("projectile")) do local zeType = getProjectileType( thisProjectile ) if zeType == 16 then local pX, pY, pZ = getElementPosition( thisProjectile ) local a, b, c = getElementPosition ( thisProjectile ) --local x, y, z = getScreenFromWorldPosition( tX, tY, tZ ) local maxDistance = 12 local x, y, z = getScreenFromWorldPosition( a, b, c ) local zz, ze, za = getElementPosition ( localPlayer) if zz and ze and za and x and y and z <= 18 then if x and y then local a = dxDrawText( "3", x, y, _, _, tocolor( 255, 0, 0, 255 ), 2, "default", "center", "center" ) end end end end end function boa() for index,thisProjectile in ipairs(getElementsByType("projectile")) do local zeType = getProjectileType( thisProjectile ) if zeType == 16 then local pX, pY, pZ = getElementPosition( thisProjectile ) local a, b, c = getElementPosition ( thisProjectile ) --local x, y, z = getScreenFromWorldPosition( tX, tY, tZ ) local maxDistance = 12 local x, y, z = getScreenFromWorldPosition( a, b, c ) local zz, ze, za = getElementPosition ( localPlayer) if zz and ze and za and x and y and z <= 18 then if x and y then local b = dxDrawText( "2", x, y, _, _, tocolor( 255, 0, 0, 255 ), 2, "default", "center", "center" ) end end end end end function coa() for index,thisProjectile in ipairs(getElementsByType("projectile")) do local zeType = getProjectileType( thisProjectile ) if zeType == 16 then local pX, pY, pZ = getElementPosition( thisProjectile ) local a, b, c = getElementPosition ( thisProjectile ) --local x, y, z = getScreenFromWorldPosition( tX, tY, tZ ) local maxDistance = 12 local x, y, z = getScreenFromWorldPosition( a, b, c ) local zz, ze, za = getElementPosition ( localPlayer) if zz and ze and za and x and y and z <= 18 then if x and y then local c = dxDrawText( "1", x, y, _, _, tocolor( 255, 0, 0, 255 ), 2, "default", "center", "center" ) end end end end end
ADCX Posted June 18, 2014 Posted June 18, 2014 The script appears to be working and I have not encountered any errors. Please specify what is the problem with it.
(s)ection Posted June 19, 2014 Author Posted June 19, 2014 The script appears to be working and I have not encountered any errors. Please specify what is the problem with it. when i launch 2 granades it add it on the both grenade ( multi text on the first grenade ) $
Max+ Posted June 20, 2014 Posted June 20, 2014 why you are using the same functions and events, more than 1 time ?
(s)ection Posted June 20, 2014 Author Posted June 20, 2014 why you are using the same functions and events, more than 1 time ? dont know i dont scripted it soryy
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