Jump to content

iam2noob4u

Members
  • Posts

    190
  • Joined

  • Last visited

Details

  • Location
    Purmerend, The Netherlands.
  • Occupation
    Student
  • Interests
    MTA :D

Recent Profile Visitors

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

iam2noob4u's Achievements

Mark

Mark (16/54)

0

Reputation

  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 ).
×
×
  • Create New...