..:D&G:.. Posted February 13, 2016 Share Posted February 13, 2016 Hello guys, I am trying to sync the player's animation from client side to server side, but the event is not triggered... --Client function startMiningSpot(hitPlayer) if (hitPlayer == getLocalPlayer()) and (source == miningSpot) then triggerServerEvent("syncMiningAnim", resourceRoot, hitPlayer, source) outputChatBox("Message shows!") end end addEventHandler( "onClientMarkerHit", getRootElement(), startMiningSpot) --Server function syncMining(hitElement, marker) exports.global:applyAnimation(hitElement, "chainsaw", "CSAW_1", -1, true, false, false) setElementPosition(hitElement, getElementPosition(miningSpot)) setPedRotation(hitElement, getElementData(miningSpot, "msRotation")) outputChatBox("Don't show", hitElement) end addEvent("syncMiningAnim", true) addEventHandler("syncMiningAnim", getRootElement(), syncMining) I know it's kinda late for scripting but maybe I missed something? Because the message from server side doesn't show and the function doesn't give any errors... Maybe I'm too tired? Thanks. Link to comment
Bonus Posted February 13, 2016 Share Posted February 13, 2016 Try this function startMiningSpot(hitPlayer) if (hitPlayer == getLocalPlayer()) then triggerServerEvent("syncMiningAnim", hitPlayer, source) end end addEventHandler( "onClientMarkerHit", miningSpot, startMiningSpot) function syncMining(marker) exports.global:applyAnimation(client, "chainsaw", "CSAW_1", -1, true, false, false) setElementPosition(client, getElementPosition(marker)) setPedRotation(client, getElementData(marker, "msRotation")) outputChatBox("Don't show", client) end addEvent("syncMiningAnim", true) addEventHandler("syncMiningAnim", getRootElement(), syncMining) 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