Jump to content

tommymaster

Members
  • Posts

    75
  • Joined

  • Last visited

Everything posted by tommymaster

  1. Hi! I have a resource made for client side, and it's name is GUI. When a player joins, the first line of the login system is to export from that resource. But sometimes it can do it, sometimes it can't. And if it can't, I usually enter the "list" command to my server console, and it is running there. But after i restart it, it works. Maybe the resource is not ready on client side? And why does it say "server resource", if all the resource's script type is "client"? + When it does not work, i need to restart the resource, reconnecting is not enough. Line I get the error on: gui = exports.gui I export from client-side, but there are triggers into the GUI script from server side. <include resource="gui"/> Maybe this will fix it.
  2. --script1.lua function output() print ("ok") end --script1 meta.xml <meta> <script src="script1.lua" type="server"/> <export function="output"/> </meta> --script2.lua output() --script2 meta.xml <meta> <include resource="script1"/> <script src="script2.lua" type="server"/> </meta> Still does not work.
  3. Hi! I know about the "call", and "exports" function, but is there an other way, like in C++, that i can include an other script, from an other directory? As i know "require" is not allowed in MTASA.
  4. Hi! I want to make a script, in which for example the player gives 2 xyz positions, and in every 50 meters there would be a marker, which would lead the player to the position. I am aware, that there is a script by default, but i can't really read it. So anyone please explain me, how to do it?
  5. Hi! I want to replace the circular gta sa minimap, i want to leave the black circle there, just replace the default gta sa looking minimap. How can i do that? As i know it is a txd, but on what will i need to load my txd to?
  6. sorry, it was still displaying your old comment, i'll try it. it is still not working. even if i try switching isLocal to true.
  7. it is not giving any error. the function gets defined way before it would trigger the function that contains addEventHandler
  8. --this gets triggered from server side: local window = guiCreateWindow(0, 0, 500, 500, "News", false) local browser = guiCreateBrowser (0, 10, 500, 500, true, false, false, window) local theBrowser = guiGetBrowser (browser) addEventHandler ("onClientBrowserCreated", theBrowser, setURL) --end of function function setURL() loadBrowserURL (source, "http://localhost/index.html") end Still it does not work.
  9. Hi! This is my code: window = guiCreateWindow(0, 0, 500, 500, "News", false) browser = guiCreateBrowser (0, 10, 500, 500, true, false, false, window) theBrowser = guiGetBrowser (browser) loadBrowserURL (theBrowser, "http://localhost/index.html") This is inside a clientsided function what gets triggered from server size. The window called "News" is getting displayed, but the index.html file of my local host won't. I am using XAMPP, and the file index.html exists, and i can view it in Google Chrome, by setting the URL to "http://localhost/index.html". What may the problem be, could you please help? I want to set up an easy HTML page, and by clicking onto texts it will redirect me to an other HTML file, and if possible, change these files without restarting the resource. Is this possible here?
  10. yeah thanks, now it outputs the valid coordinates. but now how can i add blips? i mean i add the blips with create blip, and using "for" i get their positions and blip icons, then draw it on the f11 map using onClientRender, but with what coordinates? could you please write an example for this with commentaries? i learn better from them.
  11. Sadly it is still not working. It outputs like 3000 if i click on the center.
  12. Thank you, but what i want to do, is click on the image, and get the real x y z coordinates according to the screen position i clicked on the map. Like in the freeroam resource, when i use the map button, select where i want to go, but i don't want to go there, just output the coordinates of the clicked position on the image.
  13. Hi! I draw a map on a player's screen, and i would like to make a mod in which the player clicks on the rendered map image, it outputs the coordinates to the debug log. For example if i click on the center of the map, the real coordinates should be like 0, 0, 0 but it outputs the screen coordinates, for example my screen's resoluion is 1920x1080, i click on the center, and i get like 960, 540 instead of 0, 0. First i would like to just display the real coordinates where i clicked, i was trying to fix this but i had no idea how i can solve this. Later on i would like to draw a playerblip where the player is being on the map by adding a blip there, and rendering it on the radar, and i don't really know how to solve this too. And of course, later i would like to add other blips. But i would like the blips to match the real coordinates. I am using MTA San Andreas\MTA\cgui\images\radar.jpg as the radar image. mapVisible = false toggleControl ("radar", false) map = {} map["size"] = 1024 function showMap(button, state) if button == "F11" and state == true then if mapShown == false then mapVisible = true addEventHandler ("onClientRender", root, renderMap) showCursor (true) else mapVisible = false removeEventHandler ("onClientRender", root, renderMap) showCursor (false) end end end addEventHandler ("onClientKey", root, showMap) x, y = guiGetScreenSize() mx, my = 1920, 1080 function renderMap() dxDrawImage (x/2 - map["size"]/2, y/2 - map["size"]/2, map["size"], map["size"], "images/map.jpg") end function click(button, state, aX, aY) if button == "left" and state == "down" then --iprint (x-map["size"]) iprint (aX - map["size"]) --x y z is not accurate end end addEventHandler ("onClientClick", root, click)
  14. Hi! For example if in my script i use getElementData or just simply call something that's value is either nil or false, how can i use the or? I mean outputChatBox ("player's element data" or "no data") And the "no data" would only get put in the chatbox if the element's specified data is nil or false? I have seen this in scripts, but i never knew it's usage.
  15. Hi! I tried to find out the GTA SA map size, so far i got 3072 on Y, i think the X is just as wide as this. I want to switch the F11 map to a custom map, which looks like the GTA V map, just in GTA SA version. Could you guys tell me where to find the right image in resolution (3072x3072), and any tip how to switch the default radar to a new one? And i would like to make a radar that only displays the surrounding houses and blips, not the whole map.
  16. and if for example if i have a string as variable like this: "1x5" how can i take out the "1x", and the opposite, how could i take out "x5"?
  17. thanks, i solved it by not using a client-sided table, but setting the table as elementdata. it's easier for me.
  18. Thanks. It seems to work this way. I want to see the items of the table, but it outputs like "table: 0x......." in the log instead the items of the table. How may i fix this?
  19. Hi! I want to list a client-sided table when a player disconnects. --client items = {} items[1] = "1" items[2] = "2" function saveItems() triggerServerEvent ("listItems", source, items) end addEventHandler ("onClientPlayerQuit", root, saveItems) --server function listItems(items) outputServerLog (""..items..":"..getPlayerName(source).."") iprint (""..items..":"..getPlayerName(source).."") outputDebugString (""..items..":"..getPlayerName(source).."") end addEvent ("listItems", true) addEventHandler ("listItems", root, listItems) I can't see the message at all in the server console.
  20. Hi! After a few minutes of research i finall found a way to take out letters from a string. This is an example: local text = "test3" print (text:gsub('test', '')) It outputs " "3" 1" but i only need number 3 after the word. How may i take out the number 1 after 3 and convert "3" to number?
  21. Hi! I have to problems. For example if i have a string like this: "INTERIOR: 10, OWNER = 1" how could i convert only "10" and only "1" to an int, a remove text from it? And for example how to add / remove underlines ( _ ) between surname and last name?
×
×
  • Create New...