WeeD1 Posted September 15, 2019 Share Posted September 15, 2019 Alguém para me ajudar please? ERROR: Kill\script.Lua:5: Valid wanted levels are between 0 and 6 inclusive function rewardOnWasted ( ammo, killer, killerweapon, bodypart ) if ( killer ) and ( killer ~= source ) then givePlayerMoney ( killer, 500 ) setPlayerWantedLevel ( killer, 6 ) end end addEventHandler ( "onPlayerWasted", getRootElement(), rewardOnWasted ) Link to comment
DNL291 Posted September 16, 2019 Share Posted September 16, 2019 Está certo o código, o WL é válido, e testei aqui está funcionando. Link to comment
Gaimo Posted September 17, 2019 Share Posted September 17, 2019 Não funcionaria da mesma forma sem o if (killer) ?? function rewardOnWasted ( ammo, killer, killerweapon, bodypart ) if ( killer ~= source ) then givePlayerMoney ( killer, 500 ) setPlayerWantedLevel ( killer, 6 ) end end addEventHandler ( "onPlayerWasted", getRootElement(), rewardOnWasted ) Link to comment
DNL291 Posted September 17, 2019 Share Posted September 17, 2019 A primeira condição if ( killer ) é para evitar aviso no debug, pois vai tentar comparar boolean com o player se não existir o killer. 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