TheIceman1 Posted February 24, 2013 Share Posted February 24, 2013 How to make that,player who is arrested from function (wanted1),That player goes in jail(position) in second function(jail1)?Understand? Why this dont work? Here is player arrested: function wanted1( attacker, attackerweapon, bodypart, loss ) theSkin = getElementModel( attacker ) WL = getPlayerWantedLevel( source ) x, y, z = getElementPosition ( attacker ) if (attackerweapon == 3) and ( theSkin == 280 ) and (loss > 2 and (getPlayerWantedLevel( source ) == 1 ) and ( WL > 0 )) then exports ["guimessages"] : outputServer ( source, "You are arrested by "..getPlayerName(attacker).."." , 25, 25, 255) exports ["guimessages"] : outputServer ( attacker, "You have arrest "..getPlayerName(source).." take him to PD." , 25, 25, 255) showCursor ( source, true ) policecar = createVehicle ( 596, x, y, z ) setTimer ( warpPedIntoVehicle, 100, 1, attacker, policecar ) setTimer ( warpPedIntoVehicle, 200, 1, source, policecar ) markerjail = createMarker(1545.6,-1685.1,13.5,"cylinder",3, 25, 25, 255, 200 ) setElementVisibleTo ( markerjail, getRootElement(), false ) setElementVisibleTo ( markerjail, attacker, true ) end end addEventHandler ("onPlayerDamage", getRootElement(), wanted1) Here he goes in jail: function jail1 ( attacker, loss, player ) money = math.random ( 50, 150 ) time = math.random ( 5000, 15000 ) theSkin = getElementModel( attacker ) WaL = getPlayerWantedLevel( player ) if ( theSkin == 280 ) and (loss > 2 and (getPlayerWantedLevel( player ) == 1 ) and ( WaL > 0 )) then setElementPosition ( player, 0, 0, 0 ) setTimer ( setElementPosition, time, 1, player, 1545.6,-1685.1,13.5 ) setTimer ( setPlayerWantedLevel, time, 1, player, 0 ) destroyElement ( policecar ) destroyElement ( markerpo ) showCursor ( player, false ) givePlayerMoney (attacker, money) end end addEventHandler ( "onMarkerHit", markerjail, jail1 ) Link to comment
DNL291 Posted February 24, 2013 Share Posted February 24, 2013 The parameters of the jail1 function are: hitElement and matchingDimension, because you is attaching the event "onMarkerHit" in this function. 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