Sex* Posted July 1, 2013 Share Posted July 1, 2013 (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 July 1, 2013 by Guest Link to comment
denny199 Posted July 1, 2013 Share Posted July 1, 2013 Because "player" isn't defined. It's even saying it in the errorlog. "[Expected element at argument 1, got nil]" Link to comment
Sex* Posted July 1, 2013 Author Share Posted July 1, 2013 And how it would be defined? Link to comment
Sex* Posted July 1, 2013 Author Share Posted July 1, 2013 localPlayer Very useful information, give me an example. Link to comment
Sex* Posted July 1, 2013 Author Share Posted July 1, 2013 player > localPlayer I dont understand without an example... Link to comment
Cadu12 Posted July 1, 2013 Share Posted July 1, 2013 localPlayer is same as getLocalPlayer(), only in client-side. Link to comment
iPrestege Posted July 1, 2013 Share Posted July 1, 2013 localPlayer is a player client side element . Link to comment
Sex* Posted July 1, 2013 Author Share Posted July 1, 2013 Oh...but what of these I got to modify? Link to comment
iPrestege Posted July 1, 2013 Share Posted July 1, 2013 player from dim function to > localPlayer Link to comment
Sex* Posted July 1, 2013 Author Share Posted July 1, 2013 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. Link to comment
iPrestege Posted July 1, 2013 Share Posted July 1, 2013 setElementData (player,"gamemode","[gamemodes]/[race]/race", true) To setElementData (localPlayer,"gamemode","[gamemodes]/[race]/race", true) Link to comment
Sex* Posted July 1, 2013 Author Share Posted July 1, 2013 (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 July 1, 2013 by Guest Link to comment
Sex* Posted July 1, 2013 Author Share Posted July 1, 2013 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. Link to comment
iPrestege Posted July 1, 2013 Share Posted July 1, 2013 So? Post the code you have now. Link to comment
Sex* Posted July 1, 2013 Author Share Posted July 1, 2013 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. 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"/> Link to comment
iPrestege Posted July 1, 2013 Share Posted July 1, 2013 setElementDimension ( selectedMenu ) You didn't put the element . Link to comment
Sex* Posted July 1, 2013 Author Share Posted July 1, 2013 setElementDimension ( selectedMenu ) You didn't put the element . setElementDimension ( localPlayer, selectedMenu ) ? Link to comment
iPrestege Posted July 1, 2013 Share Posted July 1, 2013 If you want the localPlayer then this is it. Link to comment
Sex* Posted July 1, 2013 Author Share Posted July 1, 2013 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... Link to comment
iPrestege Posted July 1, 2013 Share Posted July 1, 2013 Post full code and which line. Link to comment
Sex* Posted July 1, 2013 Author Share Posted July 1, 2013 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. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now