psyduck Posted January 7, 2016 Share Posted January 7, 2016 i want to write WoW like targeting and i dont know how to make it good my idea is something like that i shot a player/ped/element and i get its id (onPlayerDamage?) and store it somewhere (setElementData?) attaches arrow its id will be available to other functions and if other element is shooted it deataches arrow and removes target and sets new one i was messing around with getPedTarget and other methods but it just was crapp function playerDamage_text ( attacker, weapon, bodypart, loss ) --when a player is damaged local target = getPedTarget ( source ) outputChatBox ( "dmg "..getPlayerName(attacker).." "..getPlayerName(source), getRootElement (), 255, 170, 0 ) setElementData ( source, "tempdata.target", getPlayerName(source) ) local targettest =getElementData( source, "tempdata.target" ) outputChatBox("test target"..targettest) end addEventHandler ( "onPlayerDamage", getRootElement (), playerDamage_text ) function skillTemp(thePlayer, cmd) local value = getElementData( thePlayer, "tempdata.target" ) local player = getPlayerFromName (value) outputChatBox("test target"..value) setPedOnFire (player, true) end addCommandHandler("dg", skillTemp) anybody have some protips how to write it right? Link to comment
myonlake Posted January 7, 2016 Share Posted January 7, 2016 It's a bit advanced, really, not a simple task since you want to have some custom rendering and camera movement and so on... 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