jkub Posted December 20, 2008 Share Posted December 20, 2008 is there any event for a player changing skins because i need it for a team script im workin on.. function cop1 ( thePlayer ) local skin = getPlayerSkin ( thePlayer ) if ( skin == 280 ) then setPlayerTeam ( thePlayer, police ) else return end end Link to comment
darkdreamingdan Posted December 20, 2008 Share Posted December 20, 2008 your best bet would be to hack this in yourself. You could do it like this, by importing this into every resource that sets skins: addEvent"onPlayerSkinChange" local mta_setPlayerSkin = setPlayerSkin function setPlayerSkin ( player, id ) local set = mta_setPlayerSkin ( player, id ) if ( set ) then triggerEvent ( "onPlayerSkinChange", player, id ) end return set end It would be tidier to create a skinchange.lua and seperate it there. To use the event you could simply adapt what you've already written: function cop1 ( skin ) if ( skin == 280 ) then setPlayerTeam ( source, police ) else return end end addEventHandler ( "onPlayerSkinChange", getRootElement(), cop1 ) 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