Jump to content

Change the Gamemode Name!?


th3cross3r

Recommended Posts

Posted

Hello,

when you are on the Server Browser and see my Server, you see the Gamemode... and the gamemode is by me: MTA:SA ... i wanna change it... where and how? pls help!

greetings,

th3cross3r

Posted

You can change it from the admin panel by lil toady (default) in the "Server" tab, or via scripting using setGameType function.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

That's right, but if you use setGameType in a script onResourceStart, it'll be set every time the resource starts.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

it doesnt works!

-.-

<meta> 
    <info gamemodes="play" type="map" name="GPG* - World" author="Th3Cross3r" version="0.1"></info> 
    <map src="play-GPGworld.map" dimension="0"></map> 
  
setGameType="GPG World Beta v. 0.1" 
     
    <map src="broph.map" /> 
    <script src="broph.lua"/> 
  
</meta> 
  

Posted

setGameType is a function, it doesn't go in meta.xml, you put that in a .lua script.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

I edited the broph.lua data (Play) to this...

addEventHandler("onResourceStart", resourceRoot, 
    function() 
        setGameType ("GPG World Beta v. 0.1") 
        resetMapInfo() 
        for i,player in ipairs(getElementsByType("player")) do 
            spawn(player) 
        end 
    end 
) 
  
function spawn(player) 
    if not isElement(player) then return end 
    repeat until spawnPlayer ( player, 2468+math.random(1,5), -1668+math.random(5,9), 13.4, 90, math.random(312), 0, 0) 
    fadeCamera(player, true) 
    setCameraTarget(player, player) 
    showChat(player, true) 
end 
  
addEventHandler("onPlayerJoin", root, 
    function() 
        spawn(source) 
    end 
) 
  
addEventHandler("onPlayerWasted", root, 
    function() 
        setTimer(spawn, 1800, 1, source) 
    end 
) 

..and it works fine!! Thank you :)

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...