Setting Up Server Side Blip

My following code displays blips however when the command is executed it places a blip on me, but other players see the blip on them instead of me. How can I fix this to only show a blip on the player that executes the command?

delete_blip_after = 60000 -- 300 000 milliseconds = 5 minutes
blip_sprite = 1

RegisterNetEvent('911:AddBlip')
AddEventHandler('911:AddBlip', function(v, calltype)
	local ped = GetPlayerPed(PlayerId(v))
	local pos = GetEntityCoords(ped)
 	local blip = AddBlipForCoord(pos.x, pos.y, pos.z)
 	local Street0, Street1 = Citizen.InvokeNative( 0x2EB41072B4C1E4C0, pos.x, pos.y, pos.z, Citizen.PointerValueInt(), Citizen.PointerValueInt())
 	local Street0_name,Street1_name = GetStreetNameFromHashKey(Street0),GetStreetNameFromHashKey(Street1)
 	
 	Citizen.Trace(v..'/'..calltype)

 	if calltype == '911' then
		SetBlipSprite( blip, blip_sprite )
 		SetBlipColour( blip, 1 )
 		SetBlipAsShortRange( blip, false)
 		SetBlipAsMissionCreatorBlip( blip, true)
 		SetBlipFlashes(blip, true)
		BeginTextCommandSetBlipName("STRING")
 		Citizen.InvokeNative( 0x6C188BE134E074AA, '911 call' )
		EndTextCommandSetBlipName( blip)
 		Citizen.CreateThread(function()
 			if DoesBlipExist(blip) then
 				Citizen.Wait(delete_blip_after)
 				RemoveBlip(blip)
 			end
 		end)
 		TriggerEvent('chatMessage', "^5[911]", {30, 144, 255}, "(^3 Location: ^4" .. Street0_name .. ' ^5'.. Street1_name..'^0 )')
 	elseif calltype == 'pan' then
		SetBlipSprite( blip, blip_sprite )
 		SetBlipColour( blip, 3 )

		SetBlipAsShortRange( blip, false)
 		SetBlipAsMissionCreatorBlip( blip, true)
 		SetBlipFlashes(blip, true)
		BeginTextCommandSetBlipName("STRING")
 		Citizen.InvokeNative( 0x6C188BE134E074AA, 'Panic call' )
 		EndTextCommandSetBlipName( blip)
 		Citizen.CreateThread(function()
			if DoesBlipExist(blip) then
 				Citizen.Wait(delete_blip_after)
 				RemoveBlip(blip)
			end
 		end)
 		TriggerEvent('chatMessage', "^5[911]", {30, 144, 255}, "(^3 Location: ^4" .. Street0_name .. ' ^5'.. Street1_name..'^0 )')
 	else
 		Citizen.Trace('WTF?')
 	end
 end)

Edit by Havoc: Added code tags and removed quote blocks… Please use code tags in future :slight_smile:

Change this line. I do not believe PlayerId accepts arguments. Instead do this.

local ped = GetPlayerPed(source)

This then would get the ped of the source you pass in some how.

Did you find a fix for this? I’m having the same problem.