Jump to content

DarkLink

Members
  • Posts

    610
  • Joined

  • Last visited

Everything posted by DarkLink

  1. I searched on forum and on wiki and didnt found an answer to this.. how can I delete a gui? only with guiSetVisible ? but using visible function it doesnt get removed right..? Thanks!
  2. Yes I know that I can make them global.. and use them normally... but if I dont want it global ? just local on that scope? and then give it to that function that is called on the event handler ? not possible ?
  3. Is possible to pass arguments to the function that is called from the handler?? I mean.. I have this handler: function() local x,y = 10,50 addEventHandler("onClientRender", getRootElement(), doSomething) end function doSomething() -- HOW can I have access here to that arguments above? the x and the y ? thanks alot in advance... end EDIT: I tryed this but doesnt work ! addEventHandler("onClientRender", getRootElement(), showInfoAboutTimes(x,y)) Gives me this error : [2012-07-07 20:43:28] WARNING: bp\client_testbar.lua:11: Bad argument @ 'addEventHandler' [Expected function at argument 3, got none] Thanks again
  4. Hi there, why when I call changeGamemodeMap to some another valid map of the current gamemode running.. all the window goes black ? I guess this function only stops the current map and start a new one ... loading the objects, right ? So why turning the window black ? why cant I keep looking my ped stayin where I was before? This function belongs to mapmanager Thanks alot in advance!
  5. Really ? Thats a pain and I need to instal gta sa again on virtual machine ?
  6. Hi there, I really need to run 3 or 4 clients on my computer, how can I do it? Install 4 virtual machines ? Is there any other option ? I could call someone, but I need to test myself, and on most of cases people dont have patience, and I need time to test many things . Any hint please ? Thanks!
  7. I managed to put it working, like I did, fixing the local thing like I said. I was just trying to know how could we create dinamic amount of options to the startPoll . What you have will work ? Since ur votedata variable has the settings.. but then just have the maps, it must be inside together with the settings, no ? Thanks EDIT: voteBetweenMaps would work, but I can't pass a table of resources (maps) I need to write them, give them as arguments... Much less dynamic Look: bool, int voteBetweenMaps ( resource map1, resource map2, [ resource map3, ... ] )
  8. LOOOOOL found the problem I was creating another found variable, because I use local inside that while Got it fixed, thanks alot 50p ANYWAY, can u answer me this : By the way, yes I need to use [1], [2] ... instead of using a table, I got that , thanks. But that is not such dinamic.. if I want to use more maps on another vote, how do I do it ? have many functions to start different startPolls ? Its not possible to had [1], [2].. using a for on that function startPoll, right ? Thanks alot in advance mate!
  9. The map names are: "bp-official" , "bp-official_2", "bp-official_3", "bp-official_4", "bp-official_5" .. since comparing strings on lua using '==' operator, compare byte by byte, maybe cant find differences ? just asking... but I guess its not that problem..
  10. Hey mate, I got it a few seconds after, was a mistake x) But still is not working... It enters on a infinite loop, i guess on getTable() function Cant understand why, can u help me ? It's simple, never use while loops if you don't know how to make them stop. In your case, "found" will always be false unless stringOfMap is in tableOfMaps. You can't just call a function and pass a table inside a table to the startPoll like you're doing because a list of the options will be a table (in your case) but startPoll only needs 1 table and its values at [1], [2], etc. are the vote options. Anyway, if you want to start any of 3 random maps then use you could use voteBetweenMaps function instead. I was using the wrong variable, but now, it should work right ? Have a look: function getTable() local t = {} local tableOfMaps = {} local maps = getMaps() local stringOfMap = maps[math.random(#maps)] table.insert(tableOfMaps,stringOfMap) for i = 1 , 3 do local found = true while(found ~= false) do stringOfMap = maps[math.random(#maps)] local found = false for a,v in ipairs(tableOfMaps) do -- this is the line 117 ! if( stringOfMap == v ) then found = true end end end table.insert(tableOfMaps,stringOfMap) end for i, v in ipairs(tableOfMaps) do t[i] = {v, "say", getRootElement(), default = false, "I'm the number" .. i .. " with map name : " .. v } end return t end But sill infinite By the way, yes I need to use [1], [2] ... instead of using a table, I got that , thanks. But that is not such dinamic.. if I want to use more maps on another vote, how do I do it ? have many functions to start different startPolls ? Its not possible to had [1], [2].. using a for on that function startPoll, right ? Thanks alot in advance mate!
  11. Hey mate, I got it a few seconds after, was a mistake x) But still is not working... It enters on a infinite loop, i guess on getTable() function Cant understand why, can u help me ?
  12. Hi there 50p , thanks again for all your support , since some years ago u are here, helping me out, I remember I did what u suggested, but I am with some problems over here, error on console: [2012-07-03 15:54:47] ERROR: bp\server_pickweed.lua:117: attempt to call a table value Here is my code and the line 117.. addEvent("say", true) function startP() exports.votemanager:startPoll({ title="Choose a map do change to..", percentage=75, timeout=30, allowchange=false, maxnominations=3, visibleTo=getRootElement(), getTable()} ) end addCommandHandler("poll", startP) function fSay(sayT) outputChatBox("Isto: " .. sayT) end addEventHandler("say", getRootElement(), fSay) function getTable() local t = {} local tableOfMaps = {} local stringOfMap = getMap() table.insert(tableOfMaps,stringOfMap) for i = 1 , 3 do local found = false while(found == false) do stringOfMap = getMap() for a,v in tableOfMaps do -- this is the line 117 ! if( stringOfMap == v ) then found = true end end end table.insert(tableOfMaps,stringOfMap) end for i, v in tableOfMaps do t[i] = {v, "say", getRootElement(), false, "I'm the number" .. i .. " with map name : " .. v } end return t end function getMap() local tb = exports.mapmanager:getMapsCompatibleWithGamemode(exports.mapmanager:getRunningGamemode ()) return getResourceName (tb[math.random(#tb)]) end Thanks alot in advance!! Would appreciate some help dude
  13. Okay thanks alot again, btw how can I set player's parent resource ? is there some function native ?
  14. Hi there, while I am doing my resource, I would like to do it with support for this managers. Because there will be more than one map for the resource, and I would like to while the resource is running, when one match ends, appears the votemanager panel to vote for another map.. u see? I am already using events from mapmanager like : "onGamemodeMapStart" to handle some things, but I dont know how to "connect" votemanager with my resource. Can someone give me some hints please? Thanks alot in advance!
  15. both ofc, yes I only want to clear the data of my resource, not others. if I use as root element my resource, its fine right?
  16. Hi there guys, I have been trying to do something.. but I guess its not possible, is this true? When I destroyElement , some objects from my map file... they get removed from the GTA World and also from .map file ? How can I just remove them from GTA World ? And add them seconds before ? I notice this, because this code : -- before the code, I see the objects on GTA World . for _, object in ipairs( getElementsByType ('object') ) do destroyElement(object) -- it enters here and its fine, I dont see objects on GTA World end for _, object in ipairs( getElementsByType ('object') ) do -- IT doesnt enter this for ! so I guess, the objects were permanently from my .map file ? where are they ? cant I get them again from my .map file while the resource is running ? local x,y,z = getElementPosition(object) createObject(v, x,y,z) end Thanks alot in advance!
  17. I am getting this error on console : [2012-06-27 16:50:36] WARNING: bp\server_money.lua:40: Access denied @ 'stopResource' Where should I add this at acl ? I added on part.. but still doesnt work .. Thanks in advance!
  18. This will only remove data that was set by the resource this code is in. Also, author keeps asking about root element. @DarkLink, you can use getElementChildren to get all the elements and then remove their data with removeElementData Okay thanks alot mate
  19. Hmm didnt know about this, thanks I guess my question is answered
  20. Because I want to spawn the player on another spot ty
  21. How can I destroy a Player ? I mean , the ped itself ? I created it using 'spawnPlayer', now how I destroy that ped ? destroyElement says that cant destroy player, so ? Thanks alot.
  22. Hm I see, and to clear everything.. ? instead of use "player" ? is there something that refers to every type of element?
×
×
  • Create New...