BlueTheFurry Posted February 10, 2015 Share Posted February 10, 2015 Hello, i have a problem with my MTA Script, i am trying to add an Event wich starts the function when a specific resource is started on the client-side, here is the code: addEventHandler('onClientResourceStart', getResourceFromName("myresource"), function() -- insert code here end ) Error: Bad argument @ addEventHandler, expected element at Argument 2, got resource-data Greetings EDIT: Figured Something out, can be closed! Link to comment
novo Posted February 10, 2015 Share Posted February 10, 2015 Although you've apparently solved it, onClientResourceStart's event is the root element in the resource that started. Which means you can't directly use a resource's element, but it's root (getResourceRootElement). Link to comment
Enargy, Posted February 10, 2015 Share Posted February 10, 2015 function start() ---your code here end addEventHandler("onClientResourceStart", resourceRoot, start) sorry I'm at the phone. Link to comment
Recommended Posts