Arrest Script error

arrest_client.lua looks like [0_1475337699227_arrest_client.lua](Uploaden van 100%)
arrest_server.lua looks like [0_1475337735978_arrest_server.lua](Uploaden van 100%)

@Policefilip

client
 function checkWantedLevel(name, WantedLevel)
	TriggerClientEvent(name, command, CheckPlayerWantedLevel)
		if commandEntered == "/wanted "..playerName) then
			GetPlayerWantedLevel(WantedLevel)
		if GetPlayerWantedLevel then
			TriggerEvent('chatMessage', ..name.. " has a wanted level of " ..GetPlayerWantedLevel.. "!") -- This works only when followed up by the default guide: http://wiki.kanersps.pw/#Basic%20Scripting --> See change of chat resource!
	else cancelEvent()
end

function tazed (player, weapon)
	weapon = "stun_gun"
	if IsHitBy(weapon) then
	local player = GetPlayerPed(-1)
		FreezeEntityPosition(player, true) then
		SetPedToRagdollWithFall(player, PlayerPed)
	if IsPedRagdoll(GetPlayerPed(-1))
	


function arrest(commandEntered, player)
	TriggerClientEvent(arrest, command, player)
	if commandEntered("/arrest" ..PlayerName) then
		local playerName = GetPlayerName(source)
		local arrestPed = TaskArrestPed(player, target)
			if IsPedBeingArrested(player) = true then
			PlayEntityAnim("random@arrests@busted")
		elseif  IsPedCuffed = true then
			PlayEntityAnim("get_up@cuffed")
		else cancelEvent()
	end
end
addEventHandler(arrest, thePlayer)

server

local players = GetElementType ( "player" ) -- get a table of all the players in the server
for theKey,player in ipairs(players) do -- use a generic for loop to step through each player
   local level = GetWantedLevel ( player ) -- get the wanted level of the player
   if ( level > (WantedLevel) ) then -- if the player has any stars, announce it in the chat:
      print ( GetPlayerName ( name ) .. " has a wanted level of " .. level .. "  stars!" )
   end 
end

I have try everything

Edited with code tags.

@Developer

Not sure if the the top of the script is supposed to be client or it is an accident it is there?

https://kanersps.pw/i/fd4c8728

its a incident because I try to upload the files but dit not accept it

client is the client script and server is the server script

@kanersps client is the client script and server is the server script

@Policefilip What was the conclusion here?

I’m trying to fix the exact same problem with the exact same script. so far what ive gotten is that in the server side lua file that GetElementType isnt a thing and should actually be getElementsByType and a few other things like that. as of current its still broken for the server im trying to fix it for but this is a link to something that helped me very much. https://wiki.multitheftauto.com/wiki/GetPlayerWantedLevel

@JonnyFortino This is not MTA :frowning: http://www.dev-c.com/nativedb/func/info/e28e54788ce8f12d

@Policefilip This is not even close to being a valid script

--client
function checkWantedLevel(name, WantedLevel)
	TriggerClientEvent(name, command, CheckPlayerWantedLevel)
	if commandEntered == "/wanted "..playerName) then
		GetPlayerWantedLevel(WantedLevel)
		if GetPlayerWantedLevel then
			TriggerEvent('chatMessage', ..name.. " has a wanted level of " ..GetPlayerWantedLevel.. "!") -- This works only when followed up by the default guide: http://wiki.kanersps.pw/#Basic%20Scripting --> See change of chat resource!
		else
			cancelEvent()
		end
		function tazed (player, weapon)
			weapon = "stun_gun"
			if IsHitBy(weapon) then
				local player = GetPlayerPed(-1)
				FreezeEntityPosition(player, true) then -- Wtf is this then?
				SetPedToRagdollWithFall(player, PlayerPed)
				if IsPedRagdoll(GetPlayerPed(-1))
					function arrest(commandEntered, player)
						TriggerClientEvent(arrest, command, player)
							if commandEntered("/arrest" ..PlayerName) then
								local playerName = GetPlayerName(source)
								local arrestPed = TaskArrestPed(player, target)
								if IsPedBeingArrested(player) = true then
									PlayEntityAnim("random@arrests@busted")
								elseif  IsPedCuffed = true then
									PlayEntityAnim("get_up@cuffed")
								else
									cancelEvent()
								end
							end
							addEventHandler(arrest, thePlayer)

--server

local players = GetElementType ( "player" ) -- Not a thing!
for theKey,player in ipairs(players) do
	local level = GetWantedLevel( player ) -- GetWantedLevel is not a thing in 5R ( on server )
	if ( level > (WantedLevel) ) then 
		print ( GetPlayerName ( name ) .. " has a wanted level of " .. level .. "  stars!" )
	end 
end

I guess the script that we were trying to use for the server was for something like lspdfr but idk.
Honestly what we were looking for is just to press z and play the Multiplayer cuff animation. But thanks for helping us realize that the script wont work at all.

@albo1125 has a script that does that! Idk if it’s realsed tho :frowning: