flowz Posted June 16, 2014 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. [DEV]Universal Roleplay v1.0 BETA Release Date : Date not set. Website : http://www.universalroleplay.co Contact Email : [email protected] --------------------------------------------------------------------------------
xXMADEXx Posted June 16, 2014 Posted June 16, 2014 (edited) This is your problem: triggerClientEvent("robbedShop") Read the arguments for triggerClientEvent. Edited June 16, 2014 by Guest The Ultimate Lua Tutorial! | MTA PHP SDK
flowz Posted June 16, 2014 Author Posted June 16, 2014 triggerClientEvent( source, "robbedShop") Is it this ? [DEV]Universal Roleplay v1.0 BETA Release Date : Date not set. Website : http://www.universalroleplay.co Contact Email : [email protected] --------------------------------------------------------------------------------
xXMADEXx Posted June 16, 2014 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) The Ultimate Lua Tutorial! | MTA PHP SDK
flowz Posted June 16, 2014 Author Posted June 16, 2014 Thanks. [DEV]Universal Roleplay v1.0 BETA Release Date : Date not set. Website : http://www.universalroleplay.co Contact Email : [email protected] --------------------------------------------------------------------------------
xXMADEXx Posted June 16, 2014 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) The Ultimate Lua Tutorial! | MTA PHP SDK
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