Xeno Posted January 8, 2012 Author Share Posted January 8, 2012 Thank you both, works perfectly <3 Link to comment
Kenix Posted January 9, 2012 Share Posted January 9, 2012 This is worng Correct function start( player ) if isElement( player ) then crate = createObject( 2991,-1353,-185,14 ) local team = getPlayerTeam( player ) local object = createObject( 2991, -1353, -185, 14 ) if team then local police = getTeamFromName( "Police" ) local criminals = getTeamFromName( "Criminals" ) if team == police then outputChatBox( "You're a police officer.", player, 0, 255, 0 ) elseif team == criminal then outputChatBox( "You're a criminal.", player, 0, 255, 0 ) end end end end addEventHandler("onResourceStart", resourceRoot, function( resource ) setTimer( function ( ) local players = getElementsByType( "player" ) for _, player in pairs( players ) do start( player ) end end , 7500, 1) end ) Link to comment
BinSlayer1 Posted January 9, 2012 Share Posted January 9, 2012 assuming it's clientside.. 'player' is not defined when the resource starts, you can only use 'localPlayer', BUT there is no reason why you would pass the localPlayer with a timer, since it exists everywhere in the script and can be used at all times 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