Jump to content

MTA Wanted Level


JohnDoe91286

Recommended Posts

I have a wanted system running on my server, it all works fine exept for the fact that hardcored into MTA the wanted level is set to 0 onPlayerWasted. Is there any way of manually removing this or does it have to be un-hardcored from MTA? I mean, could it be un-hardcored because it gives better oppertunities then? If somebody wanted it how it is now all they would have to use is the code below. And of course, if they wanted it like I do, they just let the wanted level stay as it is.

function resetWanted ()
setPlayerWantedLevel ( source, 0 )
end
addEventHandler ( "onPlayerWasted", getRootElement(), resetWanted )

Link to comment
addEventHandler( "onPlayerWasted", getRootElement( ),
function( )
setElementData( source, "wantedlevelB4death", getPlayerWantedLevel( source ), false );
end
)
 
addEventHandler( "onPlayerSpawn", getRootElement( ),
function( )
local wantedlevel = getElementData( source, "wantedlevelB4death" );
if wantedlevel and wantedlevel > 0 then
setPlayerWantedLevel( source, wantedlevel );
end
end
)

But as I said try. Not sure if it'll work since I'm not sure if level is set back to 0 after all event handlers are executed or just before event is triggered.

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...