Clipper_ Posted December 14, 2017 Share Posted December 14, 2017 (edited) Big thanks to people that gave me ideas for creating this resource. Developped a mode where you can set/remove the hat, but in the real test, I've found this bug when aiming specific weapons that change your camera. Is there any event that can be called when player aims the weapon, in order to make the hat dissapear from screen? (serverside) Edited December 14, 2017 by Clipper_ Link to comment
aka Blue Posted December 14, 2017 Share Posted December 14, 2017 Make the hat alpha 0 when the player is aiming Link to comment
Fist Posted December 14, 2017 Share Posted December 14, 2017 (edited) there is no way doing it through server, and you don't want that either, because if you would hide hat through server when player aims then everyone would see it disappear from his head when he aims with sniper rifle. What you want to do is trigger a custom event on client which sends model to client and stores it into a variable when hat is created for that player and when is removed hat then send again to client that hat was removed so it doesn't throw warnings out also there's an easier version, just set player data "santahat" the model of hat, then check if weapon is aiming with getPedTask() on onClientRender event so it's instantenous and if player is aiming set models alpha to 0 like @aka Blue said or just set element position to 0,0,0, boneattach later will reposition to bone when play won't aim anymore. Also don't forget to remove hat when player disconnects or gets banned, otherwise it's gonna stay in air. Edited December 14, 2017 by Fist Link to comment
Clipper_ Posted December 15, 2017 Author Share Posted December 15, 2017 Can you tell me how can I send the hat to client? In this way I can fix other bugs that are related to local player only. Link to comment
Fist Posted December 15, 2017 Share Posted December 15, 2017 (edited) 5 hours ago, Clipper_ said: Can you tell me how can I send the hat to client? In this way I can fix other bugs that are related to local player only. with triggerClientEvent and triggerServerEvent on other way around, but i recommend you just setting hat model to an element data so it's easier for you to make it. Element datas are synced between server and client on change, from both sides. Edited December 15, 2017 by Fist Link to comment
Clipper_ Posted December 17, 2017 Author Share Posted December 17, 2017 Solved with element data. Thanks 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