Hell-Mate Posted March 2, 2014 Author Share Posted March 2, 2014 Instead of setPlayerTeam ( source, getTeamFromName ( "Civilian" ) ) And chagnder resource_name to name of resource, where you got this event. Error : trashman/trash_s.lua:20: exports : Call to non-running server resource (resource_name) EDIT : And chagnder resource_name to name of resource, where you got this event. ( i dont understand what u mean ) Link to comment
WhoAmI Posted March 2, 2014 Share Posted March 2, 2014 resource_name to name of resource, where you got the couse i send you. There, were you got this "Criminal job". Link to comment
Hell-Mate Posted March 2, 2014 Author Share Posted March 2, 2014 Now there is another Error > ERROR : trashman/trash_s.lua:20: call: failed to call 'robberjob:setPlayerTeam' Link to comment
WhoAmI Posted March 2, 2014 Share Posted March 2, 2014 Ah, you must export function in meta (in this criminal job resource) >function="setPlayerTeam" type="client" />> Link to comment
WhoAmI Posted March 2, 2014 Share Posted March 2, 2014 Oh, my bad, change to type="server" Link to comment
Hell-Mate Posted March 2, 2014 Author Share Posted March 2, 2014 I fixed it by adding --Client addEvent ( "destroyonleave", true ) function destroyonleave () destroyElement ( robhouseMarker ) destroyElement ( robhouseBlip ) end addEventHandler ( "destroyonleave", getRootElement (), destroyonleave ) --Server _setPlayerTeam = setPlayerTeam addEvent( "onPlayerChangeTeam", true ) function setPlayerTeam ( thePlayer, theTeam ) if not thePlayer or not theTeam then return false end local oldTeam = getPlayerTeam( thePlayer ) triggerEvent ( "onPlayerChangeTeam", thePlayer, theTeam, oldTeam ) return _setPlayerTeam ( thePlayer, theTeam ) end addEventHandler ( "onPlayerChangeTeam", root, function ( theNewTeam, theOldTeam ) local teamName = getTeamName( theNewTeam ) if teamName ~= "Criminal" then triggerClientEvent ( "destroyonleave", theNewTeam, theOldTeam, teamName ) end end ) and thank you very much bro for telling me the exporting thingy Thanks Link to comment
Hell-Mate Posted March 2, 2014 Author Share Posted March 2, 2014 Oh, my bad, change to type="server" i also tried this and nothing so i did like i posted in the previous reply, and also made the type="server" and now worked but i still dont know if it will destroy for only me or all players .. will test it when any friend join my server later. Link to comment
WhoAmI Posted March 2, 2014 Share Posted March 2, 2014 Well, you have to change that triggerClientEvent ( "destroyonleave", theNewTeam, theOldTeam, teamName ) to triggerClientEvent ( source, "destroyonleave", root ) Link to comment
Hell-Mate Posted March 2, 2014 Author Share Posted March 2, 2014 Well, you have to change that triggerClientEvent ( "destroyonleave", theNewTeam, theOldTeam, teamName ) to triggerClientEvent ( source, "destroyonleave", root ) it worked without this change .. can u explain what this change will edit please ? and im really very sorry for wasting your time Link to comment
WhoAmI Posted March 2, 2014 Share Posted March 2, 2014 Couse if you use this 1st trigger it will trigger this event for ALL player on server, but if you use 2nd one it will do event only for player, who changed team. Link to comment
Hell-Mate Posted March 2, 2014 Author Share Posted March 2, 2014 Couse if you use this 1st trigger it will trigger this event for ALL player on server, but if you use 2nd one it will do event only for player, who changed team. Okay Thanks bro , #Solved #LockRequest 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