Jump to content

Arenas with setElementDimension


Sex*

Recommended Posts

Posted (edited)

So?

if no arena is selected:

setElementDimension ( localPlayer, 0 ) 

and if he/she selects an arena:

function checkDxMenuSelection(button,state) 
    if opened == false then return end 
    if (button == "left") and (state == "down") then 
        if selectedMenu ~= 0 then 
             setElementDimension ( localPlayer, selectedMenu ) 
        end 
    end 
end 

Tried also something else in the clientside:

function getUserMouseSelection() 
    if opened == false then return end 
    if isCursorShowing() == false then return 0 end 
    local posX,posY = getCursorPosition() 
    local mouseX, mouseY = posX * screenWidth, posY * screenHeight 
    if (mouseX >= locA) and (mouseX < locB) and (mouseY < locHeightB) and (mouseY >= locHeight) then 
        if not (selectedMenu == 1) then 
setElementDimension ( localPlayer, 1 ) 
setElementData (player,"gamemode","[gamemodes]/[race]/race", true) 
            selectedMenu = 1 
            selectedImg(6) 
            resetImg(1, true) 
            resetImg(2, true) 
            resetImg(3, true) 
            resetImg(4, true) 
            resetImg(5, true) 
  

Havent tested it yet.

Edited by Guest
Posted

So?

if no arena is selected:

setElementDimension ( localPlayer, 0 ) 

and if he/she selects an arena:

function checkDxMenuSelection(button,state) 
    if opened == false then return end 
    if (button == "left") and (state == "down") then 
        if selectedMenu ~= 0 then 
             setElementDimension ( localPlayer, selectedMenu ) 
        end 
    end 
end 

Tried also something else in the clientside:

function getUserMouseSelection() 
    if opened == false then return end 
    if isCursorShowing() == false then return 0 end 
    local posX,posY = getCursorPosition() 
    local mouseX, mouseY = posX * screenWidth, posY * screenHeight 
    if (mouseX >= locA) and (mouseX < locB) and (mouseY < locHeightB) and (mouseY >= locHeight) then 
        if not (selectedMenu == 1) then 
setElementDimension ( localPlayer, 1 ) 
setElementData (player,"gamemode","[gamemodes]/[race]/race", true) 
            selectedMenu = 1 
            selectedImg(6) 
            resetImg(1, true) 
            resetImg(2, true) 
            resetImg(3, true) 
            resetImg(4, true) 
            resetImg(5, true) 
  

Havent tested it yet.

Posted (edited)
setElementData (player,"gamemode","[gamemodes]/[race]/race", true) 

To

setElementData (localPlayer,"gamemode","[gamemodes]/[race]/race", true) 

So only that and others stay the same?

EDIT: If I only change that then its giving me bad arguments.

Edited by Guest
Posted

If I only change that then I have bad arguments. I meant that if I dont change other functions and I only change that function that u told.

Posted
setElementDimension ( source, 0 ) 
  

function checkDxMenuSelection(button,state) 
    if opened == false then return end 
    if (button == "left") and (state == "down") then 
        if selectedMenu ~= 0 then 
             setElementDimension ( selectedMenu ) 
        end 
    end 
end 

function getUserMouseSelection() 
    if opened == false then return end 
    if isCursorShowing() == false then return 0 end 
    local posX,posY = getCursorPosition() 
    local mouseX, mouseY = posX * screenWidth, posY * screenHeight 
    if (mouseX >= locA) and (mouseX < locB) and (mouseY < locHeightB) and (mouseY >= locHeight) then 
        if not (selectedMenu == 1) then 
setElementDimension ( 1 ) 
setElementData (localPlayer,"gamemode","[gamemodes]/[race]/race", true) 
            selectedMenu = 1 
            selectedImg(6) 
            resetImg(1, true) 
            resetImg(2, true) 
            resetImg(3, true) 
            resetImg(4, true) 
            resetImg(5, true) 
        end 
    elseif (mouseX >= locB) and (mouseX < locC) and (mouseY <= locHeightB) and (mouseY >= locHeight) then 
        if not (selectedMenu == 2) then 
setElementDimension ( 2 ) 
setElementData (localPlayer,"gamemode","[gamemodes]/[raceDD]/race", true) 
            selectedMenu = 2 
            selectedImg(5) 
            resetImg(1, true) 
            resetImg(2, true) 
            resetImg(3, true) 
            resetImg(4, true) 
            resetImg(6, true) 
        end 

Also I duplicated and made separate paths but if I try to start RaceDD then Race stops soI cant run multiple gamemodes or wtf.

01033433117f669.jpg

010334331590adb.jpg

010334331749387.jpg

Also modified mtaserver.conf

<resource src="admin" startup="1" protected="0"/> 
    <resource src="defaultstats" startup="1" protected="0"/> 
    <resource src="helpmanager" startup="1" protected="0"/> 
    <resource src="joinquit" startup="1" protected="0"/> 
    <resource src="mapcycler" startup="1" protected="0"/> 
    <resource src="mapmanager" startup="1" protected="0"/> 
    <resource src="resourcebrowser" startup="1" protected="1" default="true"/> 
    <resource src="resourcemanager" startup="1" protected="1"/> 
    <resource src="scoreboard" startup="1" protected="0"/> 
<resource src="afk" startup="1" protected="0"/> 
<resource src="login" startup="1" protected="0"/> 
<resource src="ads" startup="1" protected="0"/> 
<resource src="digital_speed" startup="1" protected="0"/> 
<resource src="spectators" startup="1" protected="0"/> 
<resource src="userpanel" startup="1" protected="0"/> 
<resource src="deathlist" startup="1" protected="0"/> 
<resource src="playerblips" startup="1" protected="0"/> 
<resource src="gamemap" startup="1" protected="0"/> 
<resource src="mapratings" startup="1" protected="0"/> 
<resource src="timescoreboard" startup="1" protected="0"/> 
<resource src="info" startup="1" protected="0"/> 
<resource src="notice" startup="1" protected="0"/> 
<resource src="healthradar" startup="1" protected="0"/> 
<resource src="lights" startup="1" protected="0"/> 
<resource src="carfade" startup="1" protected="0"/> 
<resource src="respawn" startup="1" protected="0"/> 
<resource src="chat" startup="1" protected="0"/> 
<resource src="carteamcolor" startup="1" protected="0"/> 
<resource src="afk" startup="1" protected="0"/> 
<resource src="panel" startup="1" protected="0"/> 
<resource src="pm" startup="1" protected="0"/> 
<resource src="teamsaver" startup="1" protected="0"/> 
<resource src="finish" startup="1" protected="0"/> 
<resource src="arenas" startup="1" protected="0"/> 
    <resource src="spawnmanager" startup="1" protected="0"/> 
    <resource src="votemanager" startup="1" protected="0"/> 
    <resource src="webadmin" startup="1" protected="0"/> 
    <resource src="afkDD" startup="1" protected="0"/> 
<resource src="adsDD" startup="1" protected="0"/> 
<resource src="digital_speedDD" startup="1" protected="0"/> 
<resource src="spectatorsDD" startup="1" protected="0"/> 
<resource src="userpanelDD" startup="1" protected="0"/> 
<resource src="deathlistDD" startup="1" protected="0"/> 
<resource src="playerblipsDD" startup="1" protected="0"/> 
<resource src="gamemapDD" startup="1" protected="0"/> 
<resource src="mapratingsDD" startup="1" protected="0"/> 
<resource src="timescoreboardDD" startup="1" protected="0"/> 
<resource src="infoDD" startup="1" protected="0"/> 
<resource src="noticeDD" startup="1" protected="0"/> 
<resource src="healthradarDD" startup="1" protected="0"/> 
<resource src="lightsDD" startup="1" protected="0"/> 
<resource src="carfadeDD" startup="1" protected="0"/> 
<resource src="respawnDD" startup="1" protected="0"/> 
<resource src="chatDD" startup="1" protected="0"/> 
<resource src="carteamcolorDD" startup="1" protected="0"/> 
<resource src="afkDD" startup="1" protected="0"/> 
<resource src="panelDD" startup="1" protected="0"/> 
<resource src="pmDD" startup="1" protected="0"/> 
<resource src="teamsaverDD" startup="1" protected="0"/> 
<resource src="finishDD" startup="1" protected="0"/> 
<resource src="arenasDD" startup="1" protected="0"/> 
<resource src="RaceDD" startup="1" protected="0"/>  
  
  
    <!-- Race is a default gamemode. Remove the following line to prevent it from starting. -->      
<resource src="Race" startup="1" protected="0"/>  

Posted
setElementDimension ( selectedMenu ) 

You didn't put the element .

setElementDimension ( localPlayer, selectedMenu ) 

?

Posted

WOW, something started happening atleast. Now if I press a image(dont matter which one) then the road and stuff just goes away and I fall to water. In debugscript is bad argument again...

Posted
Post full code and which line.

Lol Im defianetly not going to post my full code...anyway other parts are GUI anyway...so this is all I got about Dimension and stuff.

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