Jump to content

iam2noob4u

Members
  • Posts

    190
  • Joined

  • Last visited

Everything posted by iam2noob4u

  1. I understand, this is not the issue. The function is to be called on elements so it's a good thing pickups are elements. I think you are confusing the normal pickups (created with createPickup) with the race pickups (created with createObject).
  2. Again: the wiki note in no way makes clear that the function does not work on pickups. The explanation for the elements it doesn't work on is basically that it doesn't work on solid elements. Pickups aren't solid. There is no point in quoting the note multiple times, as it is not an answer to my question. The note clearly excludes vehicles, players and objects. It also mentiones some elements it is particularly useful on. Particularly doesn't mean "only". I'll add another 'needs checking' note to the page and just script my way around the problem
  3. I'm creating a pickup. The reason vehicles, players and objects cannot be made invisible is because they have physics, pickups do not.
  4. I'm having some trouble hiding pickups. For testing purposes I've simplified my script to this: addEventHandler("onResourceStart", root, function() local player = getRandomPlayer(); --lazy way of getting the only player on the server (which is me during testing) local x,y,z = getElementPosition(player); local pickup = createPickup(x+5, y, z, 2, 6, 1000, 100); setElementVisibleTo(pickup, root, false); end); Whether I use root or player as the second argument for setElementVisibleTo: the script creates the shovel pickup, but I can still see it. I'm pretty sure this is a bug - or intended behaviour that is not mentioned on the wiki, but I'd like to be sure before I submit a bug report
  5. If you want to do it using LUA, look here and here. Edit: Or just do what the above post says
  6. The stopping is because the client thinks you haven't completed the game yet. Just like in single player, you can't drive out of LS (or into it), this could probably be fixed by the MTA team. Personally I don't think trains are that buggy at all... I have one spawned on my (test)server, and when players connect to that, everything goes well. Also I've been playing on big freeroam servers, with about 20 trains spawned, and no one crashed because of them. But indeed, they can use quite some polishing, it's just not a high priority what concerns me. Although it would be great to be able to define waypoints for the trains yourself.
  7. It isn't our fault you use a bad format and compression what about 99% compressed JPEG?
  8. 6MB is too much yes... maybe someone can make the tropic model, but with the solid stuff of the carrier... and then just attach the carrier model to it. You could also make the model really simple, like 1 small square [model], and 1 huge square [solid], and then attach the carrier model to it. I don't even know if that's possible as I'm not a modder, but just telling you my idea's
  9. About the carrier, maybe you can use http://nikt.zog.net.au/DRuG/news.php (search for Easter Bay Aircraft Carrier Vehicle), it's a .dff and a .txd file, but they are 5.55 MB together. When DP3 is released, you can also change the handling, so you can make it realistic
  10. try function createMoney(mx,my,mz,level) local x1=(mx-2)+(math.random()*4) local y1=(my-2)+(math.random()*4) local x2=(mx-2)+(math.random()*4) local y2=(my-2)+(math.random()*4) local moneyamount=math.floor(200*level^0.2) setElementData(createPickup(x1,y1,mz,3,1212),"amount",moneyamount) setElementData(createPickup(x2,y2,mz,3,1212),"amount",moneyamount) end and function pickup(player) local money=getElementData(source,"amount") if ( money ) then givePlayerMoney(player,money) destroyElement(source) end end addEventHandler("onPickupUse",root,pickup) and function playerWasted ( ammo, attacker, weapon, bodypart ) local px,py,pz = getElementPosition(source) createMoney(px,py,pz,getElementData(source,"level")) --The last argument should be changed. Unless you have levels on your server (that are stored this way). end addEventHandler ( "onPlayerWasted", root, playerWasted )
  11. log in and use "/debugscript 3" without the quotes, it will show the errors. Try changing "local messageNum = 0" into "messageNum = 0" (again w/o the quotes). I don't really know how local works outside of functions, so just try it.
  12. Redownload, and replace function updatep() local players=getElementsByType("player") for index,player in ipairs(players) do if (timer[player]==true) then local cx,cy,cz = getCameraPosition() local px,py,pz = getElementPosition(player) local distance = getDistanceBetweenPoints3D(cx,cy,cz,px,py,pz) if (processLineOfSight ( cx, cy, cz, px, py, py, true, false, false, true, false, false, false, false, nil ) == false) then if (distance<=160) then if (distance <= 20) then size=1 else size=20/distance end local sx,sy = getScreenFromWorldPosition(px,py,pz+0. if (sx and sy) then image[player] = guiCreateStaticImage(sx,sy-(49*size),49*size,49*size,"img/icon.png",false,nil) if (image[player]) then destroyElement(image[player]) end end end end end end end with function updatep() local players=getElementsByType("player") for index,player in ipairs(players) do if (timer[player]==true) then local cx,cy,cz = getCameraPosition() local px,py,pz = getElementPosition(player) local distance = getDistanceBetweenPoints3D(cx,cy,cz,px,py,pz) if (processLineOfSight ( cx, cy, cz, px, py, py, true, false, false, true, false, false, false, false, nil ) == false) then if (isPlayerDucked(player)==false) then if (distance<=160) then if (distance <= 20) then size=1 else size=20/distance end local sx,sy = getScreenFromWorldPosition(px,py,pz+0. if (sx and sy) then image[player] = guiCreateStaticImage(sx,sy-(49*size),49*size,49*size,"img/icon.png",false,nil) if (image[player]) then destroyElement(image[player]) end end end end end end end end
  13. It would just give me a error about there being no src attribute for the file (while there is). Edit works now. Edit (2): Try this, it should do everything AlienX's does except for the fade in and out (it just appears and disappears). Edit (3): Changed the above again. Edit (4): processLineOfSight doesn't really work well... or I just used it wrong -.-
  14. He has a point you know... Cause it sounds better then my 10 minutes of work... Oh and someone asked why I said it was a gamemode in the meta.xml: I couldn't get the icon.png to work without doing so (for some weird reason).
  15. The spawning worked fine for me (even with broph running). Didn't try on join though... but that should work too (it's also delayed 3 seconds). For automaticly loading one map, remove or rename default.map, and name your map default.map. If you don't want to run any other maps, try commenting addCommandHandler("startmap",loadmap,true) , and just start/stop the resource for loading the map. Also, you can always turn broph off I guess... Well this is created to only load the objects, not run the whole race, or do a freeroam mode (although the last is possible). As far as I know race doesn't have the option to do so (correct me if I'm wrong... then I made a useless resource ).
  16. Try http://www.fileden.com/files/2006/10/16/292619/tryme.rar. It works for me It works for me. Want a screen?
  17. Unrar the resource in the resources folder, and put maps in that folder (so you will have default.map, mymap.map mystuntmap.map in the same folder as the script), etc. You only have to use refresh when you added the resource, no need to do so when a map is added. After that, just type "/startmap mymap.map full" (without the quotes) to load the map - including spawnpoints, IF YOU'RE RUNNING BROPH: both resources will respawn: mine does it later, so it should work. If you only want to load the objects, replace "full" with "objectsonly" (again, without the quotes). If you already have the resource, redownload it (the full and objectsonly parts of the command only work with the newest version).
  18. yeah but the respawning wasn't really working cause there were still other resources running (I'm going to use it for loading only the objects, and play it with those other resources)
  19. Something like http://forum.mtasa.com/viewtopic.php?f=91&t=21655?? (that's mine yes).
  20. This resource will load the objects (tested) and show the metadata at start and on join (half-tested). It also loads the weather (not tested, in the script it says it doesn't work, but it might work). Also it can spawn players automaticly (spawn will have a small delay!). However, there is also an option to only load the objects and do nothing more (that is where it originally was created for). The default map is an unfinished race. I haven't added any commands to the ACL list yet, but if you know how to do it, you should try restricting the startmap function. Any suggestions are welcome Download: here. Edit: I should really thank all the people who helped me on the IRC (mainly with the XML functions). ~ Iam2noob4u
  21. Happens to me too, Windows Vista (Home premium), GeForce 7650 GS, 1GB RAM, server running on same PC. Edit: used /reconnect, and now it doesn't happen. BTW This would happen on my old pc too sometimes... (with race) However the two second delay doesn't happen to me.
  22. In the main menu, press F8 and type "window" (w/o the quotes), MTA will be windowed [the resolution should be set to a lower resolution then the one of your screen], you can edit the file while testing it, so you don't have to restart MTA. Also, syntax errors should show the error when starting the recource, and other errors usually require a player to trigger the code containing them, thus needing you to run MTA.
  23. lol blocking countries is sort of racism (to me) function checkPing() local ping = getPlayerPing(source) -- get the ping from the source element (the player who joined) if (ping > 300) then -- if it's higher than 300... kickPlayer(source, source, "Your ping is too high. If your ping is low normally, try connecting again.") -- kick them end end addEventHandler("onPlayerJoin", getRootElement(), checkPing) -- add the event handler Mostly from the wiki, just changed the ping (100 to 300), and added kickPlayer(). It's not in the control panel, but it works automaticly.
  24. thanks Another question (sorry): How do you set the plate text of a vehicle? I can find getVehiclePlateText in the function list, but not setVehiclePlateText. (This isn't really important so I won't be posting 100s of topics.)
  25. Is it possible to get the computer time with LUA (I want to set the time of the game to the real time)?
×
×
  • Create New...