off Posted January 6, 2014 Share Posted January 6, 2014 (edited) Anyone know to fix it? Not gaining experience. WARNING: exp_system\server.lua:0: Bad argument @ 'addPlayerEXP' [Expected player element at argument 1, got 54] Server.lua: addEventHandler("onPlayerWasted",root, function (_,killer) if (killer and killer ~= source) then exports.exp_system:addPlayerEXP(killer,25) end end) Edited January 6, 2014 by Guest Link to comment
off Posted January 6, 2014 Author Share Posted January 6, 2014 Nothing wrong. Tested? Link to comment
Gallagher Posted January 6, 2014 Share Posted January 6, 2014 Nothing wrong. Tested? killer is dayz ? Link to comment
off Posted January 6, 2014 Author Share Posted January 6, 2014 Nothing wrong. Tested? killer is dayz ? No. Link to comment
xXMADEXx Posted January 7, 2014 Share Posted January 7, 2014 Not really sure why your code isn't working, but you can try this one: addEventHandler ( "onPlayerWasted", root, function ( _, p ) if ( p and isElement ( p ) and p ~= source ) then exports['exp_system']:addPlayerEXP ( p, 25 ) end end ) Link to comment
Noki Posted January 7, 2014 Share Posted January 7, 2014 Make sure you have the correct syntax in your meta file for exports. Link to comment
off Posted January 7, 2014 Author Share Posted January 7, 2014 Not really sure why your code isn't working, but you can try this one: addEventHandler ( "onPlayerWasted", root, function ( _, p ) if ( p and isElement ( p ) and p ~= source ) then exports['exp_system']:addPlayerEXP ( p, 25 ) end end ) I could not test it yet, but seems to be functional. Make sure you have the correct syntax in your meta file for exports. Está lá... <export function="exports.exp_system" type="server" /> <export type="server" function="addPlayerEXP" /> Link to comment
TAPL Posted January 7, 2014 Share Posted January 7, 2014 You don't need to add or change anything with export, it's already added in exp_system. All you need is to download exp_system (if you haven't yet) and make sure that the resource is running. https://community.multitheftauto.com/index.php?p=resources&s=details&id=1253 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