Jump to content

1LoL1

Members
  • Posts

    944
  • Joined

  • Last visited

Posts posted by 1LoL1

  1. client-side = blip createBlip ( float x, float y, float z [, int icon = 0, int size = 2, int r = 255, int g = 0, int b = 0, int a = 255, int ordering = 0, float visibleDistance = 99999.0 ] )
    
    server-side = blip createBlip ( float x, float y, float z [, int icon = 0, int size = 2, int r = 255, int g = 0, int b = 0, int a = 255, int ordering = 0, float visibleDistance = 99999.0, visibleTo = getRootElement( ) ] )

     

  2. 3 hours ago, Tycka said:

    Hello, for example I have function like this:

     

    
    function HP ( )setElementData(source, "HP", 100)end addEvent( "HP", true )addEventHandler( "HP", getRootElement(),HP )

    How to make that after this function is used, next time it can be used after 15minutes? (For every player individually)

    function HP ()
    setElementData(source, "HP", 100)
    end 
    addEvent("HP", true)
    addEventHandler("HP", getRootElement(), HP)
    
    setTimer(HP, 900000, 0)

    or

    addEvent("HP", true)
    addEventHandler("HP", getRootElement(), function ()
    setTimer(function()
    setElementData(source, "HP", 100)
    	end, 900000, 0)
    end)

    But if you want to health then use "setElementHealth"

  3.  

    local hillAreaLS = createColRectangle ( -164.82, -2912.12, 65.28, 3150, 2300 ) 
    
    
    function hill_EnterLS (plr) 
    if (getElementType(plr) == "player") then
    triggerClientEvent ( plr, "SAEGGroups:Kills", plr ) 
    end
    addEventHandler ( "onColShapeHit", hillAreaLS, hill_EnterLS ) 
    
    function hill_LeaveLS (plr) 
    if (getElementType(plr) == "player") then
    triggerClientEvent ( plr, "SAEGGroups:KillsHide", plr ) 
    end
    end
    addEventHandler ( "onColShapeLeave", hillAreaLS, hill_LeaveLS )

     

  4. 1. [admin] --> admin --> server.lua --> admin_server.lua:

    mdata = reason~="" and ( "" .. reason .. "" ) or "" to mdata = reason~="" and ( "(" .. reason .. ")" ) or ""

    2. [admin] --> admin --> conf --> messages.xml 

    <all>$player has been muted for $data2 $data</all>

     

  5. Wrong section. What do you have in meta.xml? 

    <script src="file.lua" type="server"/>

    or

    <script src="file.lua" type="client"/> -- This is client-side

    ?

    If file.lua have in meta "client" then paste your code and use /restart <resource>

  6. Try this one:
    addEventHandler("onClientRender",root,function() 
        for _,phone in ipairs(getElementsByType("Object")) do 
            if (getObjectModel(phone) == 1216) or (getObjectModel(phone) == 1363) then 
                local x,y,z = getElementPosition(getLocalPlayer()) 
                local vx,vy,vz = getElementPosition(phone) 
                if (getDistanceBetweenPoints3D(x,y,z,vx,vy,vz) <= 4) then 
                        dxDrawLine(18 - 1, 536, 286, 536, tocolor(0, 0, 0, 254), 1, false) 
                        dxDrawLine(286, 536, 286, 479 - 1, tocolor(0, 0, 0, 254), 1, false) 
                        dxDrawRectangle(18, 479, 268, 57, tocolor(0, 0, 16, 238), false) 
                        dxDrawImage(28, 487, 44, 39, "images/phone.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
                        dxDrawText("Press E to use the phone.", 78, 487, 276, 526, tocolor(236, 233, 0, 254), 0.45, "bankgothic", "center", "center", false, false, false, false, false) 
                    end 
                end 
            end 
        end 
    end) 
    

    Make sure that the phones are added by script or .map file

    But by doing this

    for _,phone in ipairs(getElementsByType("Object")) do 
    if (getObjectModel(phone) == 1216) or (getObjectModel(phone) == 1363) then 
    

    it grabs all of the phone OBJECTS in the map, whether they are added by map, script or not added at all.. The script doesn't work yet

    Look what Wumbaloo said..

    for _,phone in ipairs(getElementsByType("object")) do 
    

    and use

    getElementModel() not getObjectModel()

  7. Error/warning?

    function met (source) 
    if hasObjectPermissionTo(source, "function.kickPlayer") then 
    triggerClientEvent(source, "szvzas", getRootElement()) 
    end 
    end 
      
    addCommandHandler("k",met) 
      
    function valaszok (source) 
    --if hasObjectPermissionTo(source, "function.kickPlayer") then 
    triggerClientEvent(source, "valaszok", getRootElement()) 
    end 
    --end 
    

  8. Google told me:

    "If you get 1.#IND or nan, look for illegal operations."

    Seems like 1.#IND and 1.#QNAN are similar.

    You can test with debugscript every variable.

    So you could see which of these variables cause the problem.

    So how i can fix?

  9. Can you please show me where you put the line?
    setElementPosition(element,objx,objy,objz) 
                setElementRotation(element,offrx,offry,offrz,"ZXY") 
                if ( not tonumber ( tostring ( objx ) ) or not tonumber ( tostring ( objy ) ) or not tonumber ( tostring ( objz ) ) ) then return end 
                if ( not tonumber ( tostring ( offrx ) ) or not tonumber ( tostring ( offry ) ) or not tonumber ( tostring(offrz ) ) ) then return end 
                outputDebugString ( tostring (objx).."-"..tostring(objy).."-"..tostring(objz).." | "..tostring(offrx).."-"..tostring(offry).."-"..tostring(offrz) ) 
            else 
                setElementPosition(element,getElementPosition(ped)) 
            end 
        end 
    end 
    addEventHandler("onClientPreRender", getRootElement(), putAttachedElementsOnBones) 
    

  10. ...

    Again:

    Put this code before the lines which let you get the warnings:

    outputDebugString ( tostring (objx).."-"..tostring(objy).."-"..tostring(objz).." | "..tostring(offrx).."-"..tostring(offry).."-"..tostring(offrz) ) 
    

    Then try to get the warning again.

    If you get the warning look at the output 1 line BEFORE the warning.

    What is written there?

    Warning111111.png

    Warning222222.png

  11. When you get the warning, what is the output before the two warnings?

    When i use skin ID 0 then i get warnings..

    When i use others skins i get green INFO: objx, ojby, objz, offrx, offry, offrz (numbers)

×
×
  • Create New...