I want to make a script that will teleport you to a pre-defined location (coords) using a single chat command, can someone help me?
The script I made unfortunately does nothing :)) Help me fix it pls
My script:
RegisterCommand(“albamare”, function(player)
local user_id = vRP.getUserId({player})
if vRP.hasPermission({user_id, “admin.tickets”}) then
TriggerEvent(SetEntityCoords("-1166.4084472656,-1545.8493652344,19.574619293212") )
TriggerEvent(“chatMessage”, player, “Te-ai teleportat cu succes!”)
I’ve never used vRP, but do you have to TriggerEvent when using things like SetEntityCoords?
RegisterCommand(“albamare”, function(player)
local user_id = vRP.getUserId({player})
if vRP.hasPermission({user_id, “admin.tickets”}) then
SetEntityCoords(player, -1166.4084472656, -1545.8493652344, 19.574619293212)
TriggerEvent(“chatMessage”, player, “Te-ai teleportat cu succes!”)
end
end)
I did another version of Script, but it gives me an error and I don’t realize why
Script:
RegisterCommand(“albamare”, function(player)
SetEntityCoordsNoOffset(entity, -1166.4084472656,-1545.8493652344,19.574619293212, false, false, true)
SetGameplayCamRelativeHeading(0)
if IsPedSittingInAnyVehicle(PlayerPedId()) then
if GetPedInVehicleSeat(GetVehiclePedIsUsing(PlayerPedId()), -1) == PlayerPedId() then
SetVehicleOnGroundProperly(GetVehiclePedIsUsing(PlayerPedId()))
end
end
DoScreenFadeIn(250)
tvRP.notify(‘~g~Teleported success!’)
end
end
end