Jump to content

rtx

Members
  • Posts

    39
  • Joined

  • Last visited

Posts posted by rtx

  1. You can only pass 2^31-1 bit integer arguments in the math class.

    This means the maximum number you can represent is: 2147483647

    You're getting a negative value because you're getting an integer overflow, meaning the value you're trying to represent is higher than the value I've just mentioned and therefore the bit signal is affected.

    The solution for your problem is simple (assuming you really need a number that high):

      
    local a = "" 
    for k = 1, 12 do 
       a = a .. tostring(math.random(0,9)) 
    end 
      
    

  2.   
    local maxLen = 8 -- maximum length 
    local a = "Your string here" 
    if #a > maxLen then 
        a = string.sub ( a, 0, maxLen ) .. " ..." 
    end 
      
    

  3. You could loop through a list of models when your resource starts and check if the model is lowLOD by doing something like:

      
    local lowLOD = {} 
    local obj = createObject ( 69, 0, 0, 0 ) 
    for k=A, B do 
       setElementModel ( obj, A ) 
       if getLowLODElement ( obj ) then 
          lowLOD[A] = true 
       end 
    end 
    destroyElement ( obj ) 
      
    

    Not sure if this works - in any case, hope it helps.

  4. You need to make the objects client side.

    After you verify that the player who has hit the colshape is indeed allowed to open the gate you need to trigger a client event.

      
    triggerClientEvent ( player, "yourOpenTheGateEvent", player ) 
      
    

    A better way to do it would be to make it fully client sided. For that you could store the player's login info when he logs in/ out client side (by using triggerClientEvent upon onPlayerLogin/onPlayerLogout).

  5. You have to draw what you want underneath first.

    dxDrawText ( "under" )

    dxDrawText ( "max_pri" )

    If you use post_gui this will not have any effect, unless they're both post_gui

  6.   
    addEvent ( "onPlayerPickUpRacePickup", true ) 
    addEventHandler ( "onPlayerPickUpRacePickup", getRootElement(), 
    function ( id, type, model ) 
      if type == "vehiclechange" and tonumber(id) == 425 then 
        -- your message 
        outputChatBox ( "The hunter has been reached!" ) 
        -- if you want the player's name use 'getPlayerName ( source )' as the source is the player who picked that pickup up 
      end 
    end ) 
      
    

×
×
  • Create New...