Jump to content

-Gus-

Members
  • Posts

    120
  • Joined

  • Last visited

Posts posted by -Gus-

  1. I found the solution, it seems that the map editor treats custom elements as objects (even if they are represented as vehicles or whatever) and rotations are different between objects and vehicles, so you need to convert the rotation from 'object format' to 'vehicle format'. One way to do that is creating a dummy object and setting its rotation to your custom element rotation, and then do getElementRotation(dummyObject, 'ZYX') to get the same rotation in 'vehicle format' (it's called ZYX format actually, and ZXY is for objects in case you wanna know)

    • Like 1
  2. Hello everyone. I wasn't sure If I should post this here because it may not be 100% related to scripting, but I ran into this problem by making a script, so here it goes.

    I'm making a script that uses custom elements defined in an EDF file, and relies heavily on the rotation of those elements because it uses the "forward" vector of their matrices. The problem is that the rotation that the editor gives is somehow bugged, let me show you this with an example:

    Let's say I place one of my custom elements, which is represented within the editor with a vehicle, and set it's rotation to X=345, Y=180, Z=90. I get this:

    120o8lz.jpg

    Now if I do the same with a normal vehicle, and set the exact same rotation I get this:

    2lsi3br.jpg

    Now if I click "OK" and then open the vehicle properties again, the rotation is changed! (this does not happen with my custom element, that one stays with the rotation I set)

    2pzch8k.jpg

    The problem is that if I calculate the "forward" vector for my custom element, what I get is what I would get if the rotation was the second one (in this example X=165, Y=0, Z=270), but that is not the rotation that the editor is showing me (neither visually or in the properties). And even worse: The rotation that I used as an example is the one I get if I rotate the element using the keyboard, I can manually set a different rotation (that gives the same visually) that works fine, but for UX reasons I can't tell my script's users to do that if they run into this bug.

    Here is the code that does the "forward vector" thing:

    saves[cshape]['pos'] = Vector3(autojumpEnd:getData('posX')),autojumpEnd:getData('posY')),autojumpEnd:getData('posZ')))
    saves[cshape]['rot'] = Vector3(autojumpEnd:getData('rotX'),autojumpEnd:getData('rotY'),autojumpEnd:getData('rotZ'))
    saves[cshape]['vel'] = Matrix(saves[cshape]['pos'],saves[cshape]['rot']):getForward() * tonumber(autojump:getData('speed'))

    So my question is: Is this an editor bug? Is it something I'm doing wrong? How can I work this out? Any help is appreciated.

  3. yo lo haria con SQL, creo la tabla con la lista de seriales que alguna vez entraron al server y las vidas que tienen.

    PD: para que un server tenga un script asi tiene que ser uno muy bueno, para que valga la pena el esfuerzo por no perder vidas, porque sino todos dirian "ah perdi una vida, no importa total el server es una mierda" xD

  4. i have the same crash than John_Scott when i start the resource:

    Version = 1.3.1-release-4710.2.010 
    Time = Thu Dec 27 23:49:55 2012 
    Module = C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_50934f2ebcb7eb57\MSVCR90.dll 
    Code = 0xC0000005 
    Offset = 0x0003B9F0 
      
    EAX=00000000  EBX=1DFC42A0  ECX=00000000  EDX=20202039  ESI=0022F11C 
    EDI=1E1A4DF0  EBP=0022F09C  ESP=0022F090  EIP=7187B9F0  FLG=00210246 
    CS=001B   DS=0023  SS=0023  ES=0023   FS=003B  GS=0000 
    

  5. it should be, because i'm checking it with the "isMap" function

      
    if exports.mapmanager:isMap(theMap) then 
    mapRoot = getResourceRootElement(theMap)  
      
    

    also i tried this

      
    function getObjectsInMap (mapname) 
    theMap = getResourceFromName(mapname)  --mapname is supposed to be a string with the folder name 
    Name = getResourceName(theMap) 
    outputChatBox("The resource name is "..Name) 
    end 
      
    

    and it works

  6. for example i have this code:

      
    function getObjectsInMap (mapname) 
    theMap = getResourceFromName(mapname)  --mapname is supposed to be a string with the folder name 
    if exports.mapmanager:isMap(theMap) then 
    mapRoot = getResourceRootElement(theMap) --this returns false 
    objectsInMap = getElementsByType("object",mapRoot) --so this doesn't work 
    end 
    end 
      
    

    i dont know why "getResourceRootElement" returns false (it does when the specified resource doesn't exist) when i previously checked if it's a map with the "isMap" function.

    it works fine if i get the resource element in another way, for example, insead of using "getResourceFromName", using "getRunningGamemodeMap".

    thanks in advance :)

  7. no, segun lo que vi en tu script nearbyPlayer representa a 1 jugador de esa tabla, nearbyPlayers (con la S al final) es la tabla con todos por lo tanto seria #nearbyPlayers en lugar de #nearbyPlayer, quedaria asi

      
    outputChatBox( "[Local]["..#nearbyPlayers.."]"..getPlayerName ( source )..": #ffffff".. message, nearbyPlayer, red, green, blue, true ) 
      
    

    (solo cambie #nearbyPlayer por #nearbyPlayers)

  8. Existe una funcion de lua o algo?

    Para los que no saben que es truncar, es cuando tenes un numero con muchos decimales, usar solo cierta cantidad así queda mas corto, por ejemplo yo tengo este numero: 1.28372376473, si lo trunco quedaría en 1.28 o 1.283 depende cuantos decimales quiera.

  9. the bullet is a dx line 3D but it's not visible in the video due to the bad quality

    EDIT: (this has nothing to do with the bullet but i put it here to avoid double post)

    maybe i will make ithe killcam happen when you shoot with the country rifle too, what do yo think? :D

  10. Hello! i'm here to present my script called "Killcam" it's inspired by Sniper Elite V2 :)

    The script is very simple, when you make a lethal shot with a sniper rifle it shows with slow motion the path of the bullet.

    The resource is compiled, maybe i will upload an open source version in the future but first i want it to be known because if no one knows it someone could steal it.

    Usage:

    1- Get a sniper rifle.

    2- Aim to someone's chest, head or testicles.

    3- Shoot!

    Download:

    https://community.multitheftauto.com/index.php?p=resources&s=details&id=5362

    Changelog:

    --Second Release:

    ----------------------------------------------

    -Added Moving Kill, Moving Headshot and Moving Testicle shot (when you shoot to someone that is walking or running)

    -Fixed bullet direction (sometimes the bullet was pointing to any place but not the target player)

    -Added country rifle

    -Fixed bug when two player shooted at the same time. (it used to count the kill only for who shooted second, now it counts both)

    -----------------------------------------------

    Video:

    HD:

    enjoy! :D

    • Like 3
  11.   
    unbindkey ("tecla", "down", funcion) 
      
    setTimer ( 
    function() 
    bindkey ("tecla", "down", funcion) 
    end, 
    300000,1) 
      
    

    (obviamente cambias "tecla" por la tecla y "funcion" por la funcion que el bind llama)

    eso desbindea la tecla y la vuelve a bindear automaticamente 5 minutos despues.

×
×
  • Create New...