This is what I’ve got so far
Client.lua
-- Change these for your admins
admins = {
'steam:110000105959047',
--'license:',
}
function isAllowedToChange(player)
local allowed = false
for i,id in ipairs(admins) do
for x,pid in ipairs(GetPlayerIdentifiers(player)) do
if debugprint then print('admin id: ' .. id .. '\nplayer id:' .. pid) end
if string.lower(pid) == string.lower(id) then
allowed = true
end
end
end
return allowed
end
RegisterCommand('rpsandy', function(source, args)
if source ~= 0 then
if isAllowedToChange(source) then
TriggerClientEvent('chatMessage', source, '', {255,255,255}, "^1RP Area: ^0Is now in Sandy Shores")
end
else
TriggerClientEvent('playerSpawned1')
end
else
TriggerClientEvent('chatMessage', source, '', {255,255,255}, '^1Error: ^0You do not have permission to use this command.')
end
end
end)
RegisterCommand('rppaleto', function(source, args)
if source ~= 0 then
if isAllowedToChange(source) then
TriggerClientEvent('chatMessage', source, '', {255,255,255}, "^1RP Area: ^0Is now in Paleto Bay")
end
else
TriggerClientEvent('playerSpawned2')
end
else
TriggerClientEvent('chatMessage', source, '', {255,255,255}, '^1Error: ^0You do not have permission to use this command.')
end
end
end)
RegisterCommand('rpblaine', function(source, args)
if source ~= 0 then
if isAllowedToChange(source) then
TriggerClientEvent('chatMessage', source, '', {255,255,255}, "^1RP Area: ^0Is now in Blaine County")
end
else
TriggerClientEvent('playerSpawned3')
end
else
TriggerClientEvent('chatMessage', source, '', {255,255,255}, '^1Error: ^0You do not have permission to use this command.')
end
end
end)
RegisterCommand('rpsantos', function(source, args)
if source ~= 0 then
if isAllowedToChange(source) then
TriggerClientEvent('chatMessage', source, '', {255,255,255}, "^1RP Area: ^0Is now in Los Santos")
end
else
TriggerClientEvent('playerSpawned4')
end
else
TriggerClientEvent('chatMessage', source, '', {255,255,255}, '^1Error: ^0You do not have permission to use this command.')
end
end
end)
RegisterCommand('rpmap', function(source, args)
if source ~= 0 then
if isAllowedToChange(source) then
TriggerClientEvent('chatMessage', source, '', {255,255,255}, "^1RP Area: ^0Is now Map Wide")
end
else
TriggerClientEvent('playerSpawned5')
end
else
TriggerClientEvent('chatMessage', source, '', {255,255,255}, '^1Error: ^0You do not have permission to use this command.')
end
end
end)
Server.lua
AddEventHandler("playerSpawned1", function(spawn)
TriggerEvent("chatMessage", "", { 255, 255, 255 }, "^1RP Area: ^0Is now in Sandy Shores")
end)
AddEventHandler("playerSpawned2", function(spawn)
TriggerEvent("chatMessage", "", { 255, 255, 255 }, "^1RP Area: ^0Is now in Paleto Bay")
end)
AddEventHandler("playerSpawned3", function(spawn)
TriggerEvent("chatMessage", "", { 255, 255, 255 }, "^1RP Area: ^0Is now in Blaine County")
end)
AddEventHandler("playerSpawned4", function(spawn)
TriggerEvent("chatMessage", "", { 255, 255, 255 }, "^1RP Area: ^0Is now in Los Santos")
end)
AddEventHandler("playerSpawned5", function(spawn)
TriggerEvent("chatMessage", "", { 255, 255, 255 }, "^1RP Area: ^0Is now Map Wide")
end)
Just need to add coords with a function to teleport new players when (‘playerSpawned’ function(spawn)