synskidz Posted January 11, 2017 Share Posted January 11, 2017 (edited) player_account = getPlayerAccount(source) function RewardLevel ( ) local wonge = source local UP = tonumber ( getAccountData ( player_account, "level" ) ) or 0 if ( UP == 1 ) then outputChatBox( "test") elseif ( UP == 2 ) then givePlayerMoney ( wonge, 50000 ) outputChatBox( "Reward Level 2 : get $50,000!") elseif ( UP == 3 ) then setPedStat(wonge, 24, 585) outputChatBox( "Reward Level 3 : increase Max HP!" ) end end addEvent("onPlayerChangeLevel", true) addEvent("onPlayerLevelUP", true) addEventHandler("onPlayerChangeLevel", getRootElement(), RewardLevel) addEventHandler("onPlayerLevelUP", getRootElement(), RewardLevel) it got error : Bad argument @ 'getAccountData' [Expected account at argument 1, got boolean] and not get the reward. HELP! Edited January 11, 2017 by synskidz Link to comment
' A F . Posted January 11, 2017 Share Posted January 11, 2017 addEvent("onPlayerChangeLevel", true) addEvent("onPlayerLevelUP", true) function RewardLevel ( ) local wonge = source local UP = tonumber ( getAccountData ( getPlayerAccount ( wonge ) , "level" ) ) or 0 if ( UP == 1 ) then outputChatBox( "test") elseif ( UP == 2 ) then givePlayerMoney ( wonge, 50000 ) outputChatBox( "Reward Level 2 : get $50,000!") elseif ( UP == 3 ) then setPedStat(wonge, 24, 585) outputChatBox( "Reward Level 3 : increase Max HP!" ) end end addEventHandler("onPlayerChangeLevel", getRootElement(), RewardLevel) addEventHandler("onPlayerLevelUP", getRootElement(), RewardLevel) 1 Link to comment
synskidz Posted January 11, 2017 Author Share Posted January 11, 2017 22 minutes ago, Default said: addEvent("onPlayerChangeLevel", true) addEvent("onPlayerLevelUP", true) function RewardLevel ( ) local wonge = source local UP = tonumber ( getAccountData ( getPlayerAccount ( wonge ) , "level" ) ) or 0 if ( UP == 1 ) then outputChatBox( "test") elseif ( UP == 2 ) then givePlayerMoney ( wonge, 50000 ) outputChatBox( "Reward Level 2 : get $50,000!") elseif ( UP == 3 ) then setPedStat(wonge, 24, 585) outputChatBox( "Reward Level 3 : increase Max HP!" ) end end addEventHandler("onPlayerChangeLevel", getRootElement(), RewardLevel) addEventHandler("onPlayerLevelUP", getRootElement(), RewardLevel) it got no error report but still not get the reward and the outputChatBox not displayed. thanks for replying Link to comment
synskidz Posted January 11, 2017 Author Share Posted January 11, 2017 help stuck here Link to comment
RekZ Posted January 11, 2017 Share Posted January 11, 2017 I think you post in the Wrong section , to get the leven use local Level = exports.exp_system:getPlayerLevel ( player ) or i think you can use the function function RewardLevel ( oldLevel , newLevel ) if ( newLevel == 1 ) then outputChatBox( "test" ) elseif ( newLevel == 2 ) then givePlayerMoney ( source , 50000 ) outputChatBox( "Reward Level 2 : get $50,000!" ) elseif ( newLevel == 3 ) then setPedStat( source , 24, 585) outputChatBox( "Reward Level 3 : increase Max HP!" ) end end addEvent("onPlayerLevelUP", true) addEventHandler("onPlayerLevelUP", getRootElement(), RewardLevel) 1 Link to comment
synskidz Posted January 11, 2017 Author Share Posted January 11, 2017 1 hour ago, RekZ said: I think you post in the Wrong section , to get the leven use local Level = exports.exp_system:getPlayerLevel ( player ) or i think you can use the function function RewardLevel ( oldLevel , newLevel ) if ( newLevel == 1 ) then outputChatBox( "test" ) elseif ( newLevel == 2 ) then givePlayerMoney ( source , 50000 ) outputChatBox( "Reward Level 2 : get $50,000!" ) elseif ( newLevel == 3 ) then setPedStat( source , 24, 585) outputChatBox( "Reward Level 3 : increase Max HP!" ) end end addEvent("onPlayerLevelUP", true) addEventHandler("onPlayerLevelUP", getRootElement(), RewardLevel) thanks dude, so far so good. if any error, would u help me again? hehehe. big thanks btw Link to comment
RekZ Posted January 11, 2017 Share Posted January 11, 2017 No problem , if you need help you can send me a PM :3 Good Luck 1 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