When i reach the blip, the client-side script is working, but the server-side is not and i don’t get any errors. I want to create a ped that can be visible to all players on the server when i reach that blip.
client-side:
--LocalPlayer
local jucator = GetPlayerPed(-1)
print("Local player incarcat client-side")
--[[PedProtejat
local hashProtejat = GetHashKey("a_f_m_bodybuild_0")
RequestModel(hashProtejat)
while not HasModelLoaded(hashProtejat) do
Wait(500)
end
print("Ped Protejat Incarcat")
--PedInamic
local hashInamic = GetHashKey("a_m_m_acult_01")
RequestModel(hashInamic)
while not HasModelLoaded(hashInamic) do
Wait(500)
end
print("Ped Inamic Incarcat")
--MasinaProtejat
local hashMP = GetHashKey("Speedo2")
RequestModel(hashMP)
while not HasModelLoaded(hashMP) do
Wait(500)
end
print("Masina protejat incarcat")
--MasinaInamic
local hashMI = GetHashKey("Cliffhanger")
RequestModel(hashMI)
while not HasModelLoaded(hashMI) do
Wait(500)
end
print("Masina inamica incarcat")
]]
--Zone
local zona1 = vector3(2611.26, 2476.98, 27.01)
local zona2 = vector3(65.16, 6627.89, 31.13)
local zona3 = vector3(618.4, 265.5, 102.72)
--Raza
local radius = 15.00
local start = 0
--Misiunea
RegisterCommand('misiune', function(source, args)
Citizen.CreateThread(function()
local blip1 = AddBlipForCoord(zona1.x, zona1.y, zona1.z)
SetBlipRoute(blip1, true)
while start == 0 do
Wait(500)
if IsEntityInArea(jucator,zona1.x-radius,zona1.y-radius,zona1.z-radius,zona1.x+radius,zona1.y+radius,zona1.z+radius) then
start=1
TriggerEvent("chatMessage", "[Misiune]", {0, 180, 200}, "A mers client-side")
end
end
end)
end,false)
server-side:
--LocalPlayer
local jucator = GetPlayerPed(-1)
print("Local player incarcat client-side")
--[[PedProtejat
local hashProtejat = GetHashKey("a_f_m_bodybuild_0")
RequestModel(hashProtejat)
while not HasModelLoaded(hashProtejat) do
Wait(500)
end
print("Ped Protejat Incarcat")
--PedInamic
local hashInamic = GetHashKey("a_m_m_acult_01")
RequestModel(hashInamic)
while not HasModelLoaded(hashInamic) do
Wait(500)
end
print("Ped Inamic Incarcat")
--MasinaProtejat
local hashMP = GetHashKey("Speedo2")
RequestModel(hashMP)
while not HasModelLoaded(hashMP) do
Wait(500)
end
print("Masina protejat incarcat")
--MasinaInamic
local hashMI = GetHashKey("Cliffhanger")
RequestModel(hashMI)
while not HasModelLoaded(hashMI) do
Wait(500)
end
print("Masina inamica incarcat")
]]
--Zone
local zona1 = vector3(2611.26, 2476.98, 27.01)
local zona2 = vector3(65.16, 6627.89, 31.13)
local zona3 = vector3(618.4, 265.5, 102.72)
--Raza
local radius = 15.00
local start = 0
--Misiunea
RegisterCommand('misiune', function(source, args)
Citizen.CreateThread(function()
while start == 0 do
Wait(500)
if IsEntityInArea(jucator,zona1.x-radius,zona1.y-radius,zona1.z-radius,zona1.x+radius,zona1.y+radius,zona1.z+radius) then
start=1
local hashInamic = GetHashKey("a_m_m_acult_01")
RequestModel(hashInamic)
while not HasModelLoaded(hashInamic) do
Wait(500)
end
print("Ped Inamic Incarcat")
end
end
end)
end,false)

