Jump to content

DarkLink

Members
  • Posts

    610
  • Joined

  • Last visited

Everything posted by DarkLink

  1. Hmmm its possible to get the real position according to a gui element that uses relative position? Thanks!
  2. Thanks for your reply, but still not working, look the image: http://s16.postimage.org/g16fbrbab/text.png Thanks again..
  3. Hi there , I am having some problem over here.. I created a label using guiCreateLabel, and used as parent a gui tab panel of a window.. but the text doenst appear all, because when it reaches the right side of the tab panel, it doesnt show the rest, do u understand? I tryed to moveToFront my label using guiBringToFront ( https://wiki.multitheftauto.com/wiki/GuiBringToFront ) , but didnt work, can someone help me? Thanks alot!
  4. Hi there, I am trying to make a script over here, and is not working.. Look my code: function setVehiResp() local vehi = createVehicle ( 497, x, y, z + 1) addEventHandler("onVehicleExplode", vehi, function() setRespwnTim(x,y,z) end ) end addEventHandler("heliUpgrade", getRootElement(), upgradeHeliSpawn) function setRespwnTim(x,y,z) setTimer(function(x, y, z) createVehicle(497, x,y,z+1) addEventHandler("onVehicleExplode", this, function() setRespwnTim(x,y,z) end) end, 2000,1, x,y,z) -- this is the line 20 end WARNING: [gamemodes]\[bp]\bp\server_money.lua:20: Bad argument @ 'addEventHandler' [Expected element at argument 2, got nil] The argument "this" was suppose to work.. since its the element that the event was attached, the element vehi.. Thanks alot in advance!
  5. player on your checkForTeam function is not defined mate.. change to this: function checkForTeam(player) if getPlayerTeam(player) == nil then --Output some stuff end end
  6. Hi there, I have some events that are attached to some GUI elements, right? If I delete the main window, I know that all elements that are children of that window will also be deleted... and the event handlers that were attached to those elements ? Should I remove all the handlers before removing the main element of the gui ? Or there is somekind of memory garbage collector, that removes unused event handlers ? Thanks alot in advance!!!
  7. Ye thats right, I didnt had time to explain better, but this is it. Grennie go check your meta.xml and give us feedback
  8. Maybe his problem is about meta.xml , because he tryed fixing with that player argument and still now working.. Show us your meta.xml file, u should have a pointer to your script file refering to a client side script on the tag... Good luck
  9. Hi again 50p, just one more question: If I have a folder called maps on my folder of my gamemode, and I start my resource gamemode, and then one of the maps gets started... The resource of the map is children of the resource of the gamemode , right? I notice here : https://wiki.multitheftauto.com/wiki/Element_tree And "Resource Map Root Element" (my map?!) is children of "Resource Root"(my gamemode resource?!) right? So if I use the resourceRoot of my gamemode resource would catch events fired to my map resource, right? Thanks alot in advance!!
  10. Yeah, if you want something to happen only when your resource starts then use resourceRoot for "onResourceStart" but if you want your gamemode to do something when map for your gamemode starts then you will have to use root because resources are not children of other resources or your gamemode resource (well they could be but it'd be more confusing for you). Okay thanks mate, I think I got it
  11. Sorry about my mistake, was not getElementTree() but getElementRoot(). And my doubt is, if I want to trigger the event "onGamemodeMapStart" only work to my resource.. I though I would need to use getResourceRoot(getThisResource()) .. do understand ? I dont want to catch triggered events from other resources, only mine . I guess I make myself clear now Thanks again for ur patience
  12. About the purple ones I was talking about the squares on the image of the link I give you of the element tree. How can I refer to the root of my gamemode's resource and map's resource, I mean some element root that would refer to both, but not getElementTree() because it refers to the root of everything.. Thanks alot for all your help
  13. You want to handle any gamemode so you need to use root or getRootElement(). If you attach the handler to your own resource for onGamemodeMapStart it will never be triggered because when maps starts (this is another resource) which is at the same level as your gamemode resource in the element tree the event will not be triggered. Event is triggered for an element or its children in the element tree. Many people here on the forums seem to need to learn one of the most important things in MTA which is in fact element tree. Hmmm I guess I understood, I know that the resource of the map and the resource of the gamemode, are on the same lvl of the element tree, and if I use getResourceRootElement(getThisResource()) , I may refer to the resource of the gamemode and not the resource of the map.. So I need to use the parent of this both (resource of map and resourve of gamemode) , and would work ? Like on element tree: https://wiki.multitheftauto.com/wiki/Element_tree Would be the purple ones, Resource Root right ? thats what I should use... not "getElementRoot()" because it refers to the "ROOT" on that element tree. right? Thanks alot for ur explanation
  14. Thanks alot guys, I already notice that I really need to use "getElementRoot()" But if someone experienced could explain me why , I would be really appreciated..
  15. If I use : getResourceRootElement(getThisResource()) as second argument, it doesnt work, have u a clear explation? Thanks.
  16. I know that dxDrawText are sync with getElementData.. if my dxDrawText uses data from elements, and I change that data, dxDrawText will show the changes.. And a text on a label of a gui ? also updates when I change data? Thanks lot in advance
  17. I know and it works, but why cant it be getResourceRootElement(getThisResource()) can u explain me? thanks
  18. Hi there again, I always had this problem.. never understand this good, can someone explain me why this function is not called?? function startMoneyWidgets() setElementData(team_policeSP, "money", 1000) setElementData(team_immigrantsSP, "money", 1000) outputServerLog("I DONT READ THIS") -- this doesnt appear on my server log.. end addEventHandler("onGamemodeMapStart", getResourceRootElement(getThisResource()), startMoneyWidgets) I have checked , and this event is triggered! I guess the problem is the second argument, but I choose this second argument, because I just want to call this function when the event is triggered on my resource , you see ?? I would appreciate some help, thanks alot! EDIT: I know that if I use getRootElement() on the second argument, it works, but why doesnt work how I set it up ? using getResourceRootElement(getThisResource()) ?? I only want to trigger it on my resource .. thanks
  19. I read on google that I could use string.format, but I though it was a better way... forgot about math.round, didnt know about the second argument Thanks alot guys
  20. Hi there, I have a number like: "8.149461548822" and I want to only show it using 2 decimals is it possible ? like : "8.15" . is it possible ? Thanks alot in advance.
  21. Ahhh right! Forgot about this way ehhe Thanks alot mate
  22. Ahh ! thanks alot mate
×
×
  • Create New...