function onCrimKill (ammo, attacker, weapon, bodypart)
local police = getTeamFromName("Police Officer")
local criminal = getPlayerWantedLevel(source)
if ( getElementType (attacker) == "player" ) then
if (attacker) then
if attacker == police then
if criminal > 0 then
outputChatBox("You are arrested",source,255,0,0)
return end
outputChatBox("Police mistaken, killed you unwanted",source,255,0,0)
else
outputChatBox("You are not permitted to kill a criminal",attacker,255,0,0)
end
elseif not attacker then
outputChatBox(getPlayerName ( source ).."died from environment")
end
end
end
end
addEventHandler("onPlayerWasted", getRootElement(), onCrimKill)