Jump to content

IIYAMA

Moderators
  • Posts

    5,973
  • Joined

  • Last visited

  • Days Won

    191

Everything posted by IIYAMA

  1. Just download another version..... There are many versions.
  2. yes, but it is still wasted of bandwidth. It is better to store it in a table. and the strange thing aboth all that the element data never will be set in the script except the element data already exist.
  3. How can you make data only be able to cross between 2 of the 3 scripts. local and non local If you have 3 server.lua scripts and you want only 2 of the 3 able to use the data, is that possible?
  4. Bandwidth wastage or bug fix? This is From the stealth source. (server) local objectlist = getElementsByType ( "object" ) for index, object in ipairs(objectlist) do if ( getElementData ( object, "renew" ) == "1" ) then--wtf? local x,y,z = getElementPosition( object ) local rx,ry,rz = getObjectRotation ( object ) local obid = getElementModel ( object ) destroyElement(object) local newobject = createObject ( obid, x, y, z, rx, ry, rz ) setElementData ( newobject, "renew", "1" )--wtf? end end
  5. Ok thank you again. It was very clear.
  6. ok, thank you But when should you use a local function, when the data inside stay's global? Does this really matter in mta lua? (stopping the line) ";"
  7. I have 2 client scripts. Here I set the value in a local function. exits()--trigger local function exits() myValue = true end But the value will be active in other client scripts. Only when I make the value local. local myValue = true It will stay inside the client file. You can try this sample: script1 local function exits() myValue = true end addEventHandler ( "onClientResourceStart", resourceRoot, exits) script2 function checkexit() outputChatBox("read") if myValue then outputChatBox("exit the script") end end addCommandHandler ( "read", checkexit )
  8. I am trying to use local functions but the value still exit the script. Like as sample: script 1 exits()--trigger local function exits() myValue = true end script2 function checkexit() if myValue then outputChatBox("exit the script") end end addCommandHandler ( "read", checkexit ) ------- It will output for me: "exit the script" What I am doing wrong? Does a local function do something else? This will solve it, but it isn't a local function. local myValue = true-- out of the function exits()--trigger local function exits() myValue = true end
  9. /debugscript 3 take a look in the meta.xml and .map if everything is still there.
  10. and what happend when you change player1 to player2?
  11. maybe bullet sync will solve it, (server mtaserver.conf) I can't see the bug, is the weapon invisible or the bullets invisible or both? Btw try to reduce using element data, it will totally generate teleportation, trust me.
  12. ? spawnPlayer ( player, x, y, z, 0, 287) ------ playerskins = {} --opentable function store(player) playerskins[player]={} local skin = getElementModel (player ) playerskins[player]["skin"]=skin end function deathplayer() local player = source if playerskins[player] == nil then store(player) return -- don't set the data again........ end local skin = getElementModel (player ) playerskins[player]["skin"]=skin end addEventHandler ( "onPlayerWasted", getRootElement(), deathplayer ) function playerexit() local player = source playerskins[player] = {} playerskins[player] = nil end addEventHandler ( "onPlayerQuit", getRootElement(), playerexit ) try it, if there are any erros, let me know.
  13. Is player2 not death? I have that bug sometimes when I kill somebody at a bike, but than I don't see him at all. (with the stealth resource) But that's another story....
  14. I see players teleport with it already, lal. But thank you very much.
  15. Hello, Question: will math.floor be calculated at server or client side? I don't know, because it is maybe possible that the math will be send with the trigger. I use math.floor to reduce high bandwidth. triggerServerEvent("S_SHOOT",getLocalPlayer(),weapon,aHits,math.floor(sX), math.floor(sY), math.floor(z),getTickCount()/1000*45);
  16. It means I don't wanna argument about it. To prevent fights and tears.
  17. http://forum.mtavc.com/viewtopic.php?f=91&t=50682 local g_50p sure,
  18. triggerserverevent triggerclientevent In my opinion element data is useless, why? server to client = trigger event client to client = global table(g_) or trigger event and yes global tables do exist between client and client. But server to client, I don't know. I use Elementdata only for flashbang and tab score.
  19. Very late reaction(sorry), thank you
  20. Wooow!! I didn't even know it existed. THANK YOU!!!
  21. Hello, I got a question, How can I calculate a rotation of something without using "getElementRotation". I have 1 ped that is watching an object. This object will be moving arround the ped. The ped will change it's rotation when the object is moving "setElementRotation". It isn't in the sample, because this ped will be a player. -- I have 2 locations. The one of the ped and the one of the object. This is a sample: local ped = createPed ( 63, 0, 0, 3 ) local object = createObject ( 1337, 5540.6654, 1020.55122, 1240.545, 90, 0, 0 ) function setrotation() local rotate = getPedRotation(ped) setPedRotation ( ped, rotate+40 ) end setTimer(setrotation, 100, 0) -- how can I calculate the rotation of a ped when I have the locations of the direction were the ped is watching to. local x,y,z = getElementPosition( ped ) local x2,y2,z2 = getElementPosition( object ) NO USING getElementRotation, because I have to compare with that one.
  22. Thank you all, Your explanations were very clear.
  23. so: function myFunction( ... ) if ( ... ) then local varArgs = { ... }; -- it can be used here end if ( not varArgs ) then -- it can't be used here. end end right?
×
×
  • Create New...