Jump to content

Can I unite Resource PLAY with Freeroam in one resource?


GamerDeMTA

Recommended Posts

Freeroam is not a gamemode, I think.

And yes, you can.

-_- i see it on the community as "game mode"

-_- I can't find it in the [gamemodes] directory in the MTA resources package.

But the play gamemode meta says "include resource freeroam", so freeroam isn't a gamemode, or is it?

It isn't, but freeroam and spawnmanager scripts must be running to use play.

Link to comment

PLAY Contains these 3 files:

MAP.

broph.lua

local spawnpoint 
  
addEventHandler("onResourceStart", resourceRoot, 
    function() 
        spawnpoint = getRandomSpawnPoint() 
        resetMapInfo() 
        for i,player in ipairs(getElementsByType("player")) do 
            spawn(player) 
        end 
    end 
) 
  
function spawn(player) 
    if not isElement(player) then return end 
    if get("spawnreset") == "onSpawn" then 
        spawnpoint = getRandomSpawnPoint() 
    end 
    exports.spawnmanager:spawnPlayerAtSpawnpoint(player,spawnpoint,false) 
    repeat until setElementModel(player,math.random(312)) 
    fadeCamera(player, true) 
    setCameraTarget(player, player) 
    showChat(player, true) 
end 
  
function getRandomSpawnPoint () 
    local spawnpoints = getElementsByType("spawnpoint") 
    return spawnpoints[math.random(1,#spawnpoints)] 
end 
  
addEventHandler("onPlayerJoin", root, 
    function() 
        spawn(source) 
    end 
) 
  
addEventHandler("onPlayerQuit",root, 
    function () 
        if getPlayerCount() == 1 and get("spawnreset") == "onServerEmpty" then 
            spawnpoint = getRandomSpawnPoint() 
        end 
    end 
) 
  
addEventHandler("onPlayerWasted", root, 
    function() 
        setTimer(spawn, 1800, 1, source) 
    end 
) 

meta

    "BrophY" description="A playtest/freeroam mode" version="1" type="gamemode" /> 
    resource="freeroam" /> 
    resource="spawnmanager" /> 
     
    
        "*spawnreset" value="onSpawn" 
                 friendlyname="Spawn Reset" 
                 accept="onSpawn,onServerEmpty,onServerStart" 
                 desc="When should a new spawnpoint be chosen?" 
        /> 
    
     
    "broph.map" /> 
    

And Freeroam meta

    -- arc_'s Freeroam script                                                  --> 
     
    -- You are allowed to modify this resource or add functionality to it.     --> 
    -- You may use the modified resource in your server and redistribute it.   --> 
    -- However, the original credits and this license must always stay intact. --> 
    -- Also, give your modified resource a different name, like "'s  --> 
    -- extended freeroam", to avoid confusion for users.                       --> 
     
    "Freeroam GUI" author="arc_" version="1.3.4" /> 
     
    

Edited by Guest
Link to comment
Freeroam is not a gamemode, I think.

And yes, you can.

-_- i see it on the community as "game mode"

-_- I can't find it in the [gamemodes] directory in the MTA resources package.

But the play gamemode meta says "include resource freeroam", so freeroam isn't a gamemode, or is it?

It isn't, but freeroam and spawnmanager scripts must be running to use play.

Lol, i know : :mrgreen: but the community say it's a gamemode but don't care any way it's not a gamemode -_-

Link to comment

Copy broph.lua and the map to the directory of freeroam then edit its meta:

friendlyname="Spawn Reset"

accept="onSpawn,onServerEmpty,onServerStart"

desc="When should a new spawnpoint be chosen?"

/>

friendlyname="Welcome text on start"

accept="true,false"

group="Misc"/>

friendlyname="Remove HEX Codes"

accept="true,false"

group="Misc"

desc="Setting this to true will remove all HEX codes from players' nick when displayed."

/>

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...