Guest User

Untitled

a guest
May 14th, 2012
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.89 KB | None | 0 0
  1. function onPlayerNightstickArrest ( attacker, weapon, bodypart, loss )
  2.     if isElement(attacker) and (weapon == 3) then
  3.         if (getTeamName(getPlayerTeam(attacker)) == "Police") or (getTeamName(getPlayerTeam(attacker)) == "SWAT") or (getTeamName(getPlayerTeam(attacker)) == "Military Forces") then
  4.             if not(getElementData ( source, "isPlayerArrested" )) and ( getPlayerWantedLevel(source) > 0 ) then
  5.                 setElementData ( source, "isPlayerArrested", true )
  6.                 toggleAllControls ( source, false, true, false )
  7.                 giveWeapon ( source, 0, 0, true )
  8.                 triggerClientEvent( source, "onClientFollowTheCop", source, attacker, source)
  9.                 outputChatBox("You got arrest by " .. getPlayerName(attacker) .. "!", source, 0, 225, 0)
  10.                 outputChatBox("You arrested " .. getPlayerName(source) .. "!", attacker, 0, 225, 0)
  11.             end
  12.         end
  13.     end
  14. end
  15. addEventHandler ( "onPlayerDamage", root, onPlayerNightstickArrest )
Advertisement
Add Comment
Please, Sign In to add comment