off Posted January 6, 2014 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
xXMADEXx Posted January 7, 2014 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 )
Noki Posted January 7, 2014 Posted January 7, 2014 Make sure you have the correct syntax in your meta file for exports.
off Posted January 7, 2014 Author 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" />
TAPL Posted January 7, 2014 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
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