flowz Posted June 16, 2014 Share Posted June 16, 2014 Well i made most of my rob system but when i enter the marker for robbing it says, WARNING: rob-system\server.lua:13 Bad argument @ 'triggerClientEvent' [Expected element at argument 2, got boolean] Server Side -- Error Part function robEnterTwo() if source then setTimer ( function() triggerClientEvent("robbedShop") end, 1000, 1 ) end end addEventHandler("onMarkerHit", robMarker, robEnterTwo) Client Side -- The Event "robbedShop" function robbedShop() givePlayerMoney( 1500 ) end addEvent("robbedShop",true) addEventHandler("robbedShop",root,robbedShop) Help me please! Urgent. Link to comment
xXMADEXx Posted June 16, 2014 Share Posted June 16, 2014 (edited) This is your problem: triggerClientEvent("robbedShop") Read the arguments for triggerClientEvent. Edited June 16, 2014 by Guest Link to comment
flowz Posted June 16, 2014 Author Share Posted June 16, 2014 triggerClientEvent( source, "robbedShop") Is it this ? Link to comment
xXMADEXx Posted June 16, 2014 Share Posted June 16, 2014 triggerClientEvent( source, "robbedShop")Is it this ? No I think you were going for this: function robEnterTwo( p ) if ( isElement ( p ) ) then setTimer ( function( p ) triggerClientEvent ( p, "robbedShop", p ) end, 1000, 1, p ) end end addEventHandler("onMarkerHit", robMarker, robEnterTwo) Link to comment
xXMADEXx Posted June 16, 2014 Share Posted June 16, 2014 You're welcome. (Also, I'm not sure why you're triggering a client event to give the player money, but it's not a good idea. The client side and server side money isn't synced by default, so the server is going to be returning a different value then the client side when you use getPlayerMoney. This also applies to takePlayerMoney) 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