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 i5 7400 3.0GHZ B150M-GAMING 3 DDR4 HyperX FURY 8GB 2133Mhz DDR4 Galax GTX 1060 6GB OC
off Posted January 6, 2014 Author Posted January 6, 2014 Nothing wrong. Tested? i5 7400 3.0GHZ B150M-GAMING 3 DDR4 HyperX FURY 8GB 2133Mhz DDR4 Galax GTX 1060 6GB OC
off Posted January 6, 2014 Author Posted January 6, 2014 Nothing wrong. Tested? killer is dayz ? No. i5 7400 3.0GHZ B150M-GAMING 3 DDR4 HyperX FURY 8GB 2133Mhz DDR4 Galax GTX 1060 6GB OC
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 ) The Ultimate Lua Tutorial! | MTA PHP SDK
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" /> i5 7400 3.0GHZ B150M-GAMING 3 DDR4 HyperX FURY 8GB 2133Mhz DDR4 Galax GTX 1060 6GB OC
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