[Request] RP Area Change

sweet does it need new fivem-maps like sandy?

Also I will add a whitelist system at one point when I am home.

1 Like

sound great (20 char lim)

It will be a standalone script if that is what you’re asking.

2 Likes

cool (20 char Limit)

did you end up figuring it out?

This is very easy would you prefer essentialmode or steamid based, as I have already done this.

Steam ID for admins (20 Char)

Are you wanting it to teleport you and the other players to that area or just to display in chat.

A chat msg is displayed at the time of change and when a player first joins. And for it to teleport people to the RP Area on join. (Teleport locations could be configured as cords.

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)

1 Like

so in the Spawn Bracket is where the cords would go? @BabbaTundaee

runtime.fivem.net would be a good place to check! Has everything you could possibly need

it says on that site that further configuration is required

Hold on I’m on my phone in bed xD Il try and find it for you

This is what I have atm. Nothing appears in chat when I do a cmd. Is there something wrong?

rpchange.rar (1.1 KB)

This would be great if i download the link above does it work currently @FAXES

No that’s a basic chat message that appears on cmd but does not work yet

@FAXES Could we have just made it so its kind of like a /announcment but instead we change the commands and change the message that gets displayed to all players

I made this a few weeks ago. Right now I’m working on permissions for it.