Jump to content

dam034

Members
  • Posts

    58
  • Joined

  • Last visited

Details

  • Location
    Italia

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

dam034's Achievements

Snitch

Snitch (10/54)

4

Reputation

  1. Dear users, I have a ubuntu server, and I want to create my own LUA compiler. It's not that I don't trust yours, but I want to create my own. What do I have to do? Thanks
  2. Yes, I know this is map editor, but I didn't know in which section post this thread. I posted in this section because I'm creating a resource to do it, with createObject. If kindly someone can suggest me which model to put where, because there are many models, and the right railroad gradient (or how to measure it). Thanks
  3. Dear staff, when I post on this forum, I usually need to attach images. Now I'm using an external webserver where host them, but I want to store them in this forum engine. Is it possible? And how? Thanks
  4. Dear users, in this position: I want to create a gate/fence like this: But I can't find the right model to insert there, and after I need tips regarding the gradient and precision. Help!
  5. Since I don't understand good the english, can you tell me if a variable declared clientside I can (and how) read serverside? Thanks
  6. Today I have another question: if I declare a variable in a lua file executed clientside, can I read it in another lua executed serverside in the same resource? Thanks
  7. Yeah, it's true. I wonder where I left my head. Thanks
  8. Thanks, now it works. And I let to execute a.lua clientside, not shared. Now I have a.lua: basesf = createColPolygon(-1543, 480, -1559, 451, -1597, 399, -1726, 261, -1446, 261, -1446, 293, -1342, 293, -1329, 306, -1329, 435, -1227, 435, -1227, 519, -1515, 519, -1515, 480) lanciarazzi = { } basirazzi = { } sbarra = 0 removeWorldModel(968, 15, -1526, 481, 7) -- sbarra sbarra = createObject(968, -1526.4400439453, 481.39999389648, 6.905, 0, 270, 0) lanciarazzi = { createObject(3884, -1496.8, 590.4, 42.05, 0, 0, 225), -- ponte ferroviario nuovo createObject(3884, -1225, 456, 7.05, 0, 0, 90), -- est nuovo } basirazzi = { createObject(3885, -1496.8, 590.4, 42, 0, 0, 0), -- ponte ferroviario nuova createObject(3885, -1225, 456, 7, 0, 0, 0), -- est nuova } function nonrompere() setObjectBreakable(sbarra, false) for ch, v in ipairs(lanciarazzi) do setObjectBreakable(v, false) end for ch, v in ipairs(basirazzi) do setObjectBreakable(v, false) end end b.lua: function proteggi() nonrompere() addEventHandler("onClientColShapeHit", basesf, inizia) moveObject(sbarra, 4000, -1526.4400439453, 481.39999389648, 6.905, 0, -90, 0, 'InOutQuad') outputChatBox("Attenzione: protezione sulla base di San Fierro abilitata.") end function nonproteggere() removeEventHandler("onClientColShapeHit", basesf, inizia) moveObject(sbarra, -1526.4400439453, 481.39999389648, 6.905, 0, 90, 0, 'InOutQuad') outputChatBox("Attenzione: protezione sulla base di San Fierro disabilitata.") end addEventHandler("onClientResourceStart", resourceRoot, proteggi) addEventHandler("onClientResourceStop", resourceRoot, nonproteggere) addCommandHandler("sibasesf", proteggi) addCommandHandler("nobasesf", nonproteggere) and meta.xml: <meta> <script src="a.lua" type="client" /> <script src="b.lua" type="client" /> </meta> And I removed the OOP because it doesn't work, I don't know why. But I have another problem: when I execute nonproteggere() via the nobasesf command, the function moveObject() isn't executed, it is a simple rotation, why? Thanks
  9. Where do I have to call the function crealanciatori()? Thanks
  10. Dear users, this is the file a.lua: lanciarazzi = { } basirazzi = { } sbarra = 0 function crealanciatori() sbarra = createObject(968, -1526.4400439453, 481.39999389648, 6.905, 0, 270, 0) sbarra.breakable = false lanciarazzi = { createObject(3884, -1496.8, 590.4, 42.05, 0, 0, 225), -- ponte ferroviario nuovo createObject(3884, -1225, 456, 7.05, 0, 0, 90), -- est nuovo } basirazzi = { createObject(3885, -1496.8, 590.4, 42, 0, 0, 0), -- ponte ferroviario nuova createObject(3885, -1225, 456, 7, 0, 0, 0), -- est nuova } end function nonrompere() for ch, v in ipairs(lanciarazzi) do setObjectBreakable(v, false) end for ch, v in ipairs(basirazzi) do setObjectBreakable(v, false) end end This is b.lua: function proteggi(nome, param) nonrompere() addEventHandler("onClientColShapeHit", basesf, inizia) sbarra.move(4000, -1526.4400439453, 481.39999389648, 6.905, 0, -90, 0, 'InOutQuad') outputChatBox("Attenzione: protezione sulla base di San Fierro abilitata.") end function nonproteggere(nome, param) removeEventHandler("onClientColShapeHit", basesf, inizia) sbarra.move(4000, -1526.4400439453, 481.39999389648, 6.905, 0, 90, 0, 'InOutQuad') outputChatBox("Attenzione: protezione sulla base di San Fierro disabilitata.") end addEventHandler("onClientResourceStart", resourceRoot, proteggi) addEventHandler("onClientResourceStop", resourceRoot, nonproteggere) addCommandHandler("sibasesf", proteggi) addCommandHandler("nobasesf", nonproteggere) And this is meta.xml: <meta> <oop>true</oop> <script src="a.lua" type="shared" /> <script src="b.lua" type="client" /> </meta> In function proteggi() and nonproteggere() I can't read the variable sbarra, furthermore the function nonrompere() doesn't work. Where did I go wrong? Thanks
  11. Dear users, I want to let the users to sign-up and sign-in the game when connected to my server. For some reasons (PHP scripts and third-parties API) I can't use simple GUI elements, but a webpage hosted on a LAMP server. Now, I know I need permissions by the player to access that webpage, via requestBrowserDomains function, and I'll say to the players they need to allow those domains to play. I want to load a simple browser when the player joins the game, and to do these steps: load a simple page hosted in the resource which informs the user he needs to allow some domains to play; ask the permission for those domains; load the page hosted externally to sign-in or sign-up; let the user to login to my server in that page; read the result from that script (in JSON) and parse it in a function to login the user in the game; close the browser and spawn the player assigning some properties (e.g. money amount, particular skin, etc...). I read some function documentations and I wrote this clientside code: window = guiCreateWindow( 0.2, 0.2, 0.6, 0.6, "Titolo", true ) dimx, dimy = guiGetSize(window, false) browser = guiCreateBrowser( 0, 28, dimx, dimy, false, false, false, window ) theBrowser = guiGetBrowser( browser ) requestBrowserDomains({'192.168.1.16'}) guiWindowSetMovable ( window, false ) showCursor ( true ) addEventHandler( "onClientBrowserCreated", theBrowser, function( ) loadBrowserURL( source, "http://192.168.1.16/" ) end ) addEventHandler('onClientBrowserWhitelistChange', root, function(lista) outputChatBox(table.getn(lista)) loadBrowserURL( source, "http://192.168.1.16/" ) end ) I'm executing this code to resource start for test, and 192.168.1.16 is the LAN server IP for test, I'll change it in production mode. When the resource starts, the window opens, and asks me for the permission, but when I grant it, does nothing. How can I solve and begin this new login resource? Thanks
  12. Thanks for the explanation I understood. Now, I want to know if a variable/function declared in a lua file is visible: in a lua file of another resource in a http file of the same resource Thanks
  13. Dear users, if in a resource I create many lua files, one for functions, one for variables, one for events, ecc..., are they all visible between them? If I declare a variable in a.lua, can I edit it in b.lua and output in c.lua? I need some particular declaration? Thanks
  14. If it is so, I can place new level crossings where I want, and GTA will execute the open/close command?
  15. So, I did two screenshots: the first without train (link) the second with train (link) As you can see, if there isn't a train near the level crossing, it is open. If there is a train, it closes. I think in the game programming there is an action radius (number) for each level crossing, and if there is a train in that radius, the level crossing closes. Now I want to increase the number of that action radius. Is it possible? Thanks
×
×
  • Create New...