Jump to content

[HELP]Police


Recommended Posts

function LSPDCuff (attacker, attackerweapon, bodypart, loss) 
  if (attackerweapon == 3) and (loss > 2 ) then 
  setElementPosition (source,227.10449221875, 111.24414062, 999.015625, true) 
  takePlayerMoney (source, 100) 
  givePlayerMoney (attacker, 1000) 
  end 
end 
addEventHandler ("onPlayerDamage", getRootElement(), LSPDCuff 

How to make this when player have wanted level then Police can Jail?

Edited by Guest
Link to comment
function LSPDCuff (attacker, attackerweapon, bodypart, loss) 
  if (attackerweapon == 3) and (loss > 2 ) then 
  setElementPosition (source,227.10449221875, 111.24414062, 999.015625, true) 
  takePlayerMoney (source, 100) 
  givePlayerMoney (attacker, 1000) 
  end 
end 

addEventHandler ("onPlayerDamage", getRootElement(), LSPDCuff 
local players = getElementsByType ( "player" ) 
for theKey,thePlayer in ipairs(players) do 
   local level = getPlayerWantedLevel ( thePlayer ) 
   if ( level > 0 ) then 
      outputChatBox ( getPlayerName ( thePlayer ) .. " Has a wanted level of " .. level .. "  stars!" ) 
   end  
end 

function outputWantedLevel () 
local wantedLvl = getPlayerWantedLevel ( ) 
   if wantedLvl == 0 then 
      outputChatBox ( "You clean", 0, 255, 0) 
   else 
      outputChatBox ( "You have "..wantedLvl.." wanted stars!", 255, 0, 0) 
   end 
end 
addCommandHandler ( "wanted", outputWantedLevel ) 

Like this?

Link to comment
function LSPDCuff (attacker, attackerweapon, bodypart, loss) 
  if (attackerweapon == 3) and (loss > 2 and getPlayerWantedLevel == 2 ) then 
  setElementPosition (source,227.10449221875, 111.24414062, 999.015625, true) 
  takePlayerMoney (source, 100) 
  givePlayerMoney (attacker, 1000) 
  end 
end 
addEventHandler ("onPlayerDamage", getRootElement(), LSPDCuff) 

Link to comment
function LSPDCuff (attacker, attackerweapon, bodypart, loss) 
  if (attackerweapon == 3) and (loss > 2 and getPlayerWantedLevel == 2 ) then 
  setElementPosition (source,227.10449221875, 111.24414062, 999.015625, true) 
  takePlayerMoney (source, 100) 
  givePlayerMoney (attacker, 1000) 
  end 
end 
addEventHandler ("onPlayerDamage", getRootElement(), LSPDCuff) 

i try now thnx

Link to comment
function LSPDCuff (attacker, attackerweapon, bodypart, loss) 
  if (attackerweapon == 3) and (loss > 2 and getPlayerWantedLevel == 2 ) then 
  setElementPosition (source,227.10449221875, 111.24414062, 999.015625, true) 
  takePlayerMoney (source, 100) 
  givePlayerMoney (attacker, 1000) 
  end 
end 
addEventHandler ("onPlayerDamage", getRootElement(), LSPDCuff) 

Nothing :(

Link to comment
Guest Guest4401
getPlayerWantedLevel == 2 

@X-SHADOW

Do you think a function can ever be a number?

It should be getPlayerWantedLevel(player) == 2

Link to comment
function LSPDCuff (attacker, attackerweapon, bodypart, loss) 
  if (attackerweapon == 3) and (loss > 2 and getPlayerWantedLevel(player) == 2 ) then 
  setElementPosition (source,227.10449221875, 111.24414062, 999.015625, true) 
  takePlayerMoney (source, 100) 
  givePlayerMoney (attacker, 1000) 
  end 
end 
addEventHandler ("onPlayerDamage", getRootElement(), LSPDCuff) 

Like this?

Link to comment

oh Sorry i mest that

and Stars you cant put 2 or 3 or what you like

here

function LSPDCuff (attacker, attackerweapon, bodypart, loss) 
  if (attackerweapon == 3) and (loss > 2 and (getPlayerWantedLevel( source ) == 2 )) then 
  setElementPosition (source,227.10449221875, 111.24414062, 999.015625, true) 
  takePlayerMoney (source, 100) 
  givePlayerMoney (attacker, 1000) 
  end 
end 
addEventHandler ("onPlayerDamage", getRootElement(), LSPDCuff) 

Link to comment
oh Sorry i mest that

and Stars you cant put 2 or 3 or what you like

here

function LSPDCuff (attacker, attackerweapon, bodypart, loss) 
  if (attackerweapon == 3) and (loss > 2 and (getPlayerWantedLevel( source ) == 2 )) then 
  setElementPosition (source,227.10449221875, 111.24414062, 999.015625, true) 
  takePlayerMoney (source, 100) 
  givePlayerMoney (attacker, 1000) 
  end 
end 
addEventHandler ("onPlayerDamage", getRootElement(), LSPDCuff) 

thnx its WORK

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...