Jump to content

undefined

Members
  • Posts

    500
  • Joined

  • Last visited

Posts posted by undefined

  1. random_number = function(first, second)
        if first < 0 and second < 0 then
            return -math.random(math.abs(first), math.abs(second))
        elseif first > 0 and second < 0 then
            if math.random(2) == 1 then
                return math.random(0, first)
            else
                return -math.random(0, math.abs(second))
            end
        elseif first < 0 and second > 0 then
            if math.random(2) == 1 then
                return -math.random(0, math.abs(first))
            else
                return math.random(0, second)
            end
        else
            return math.random(first, second)
        end
    end

     

    Solved.

  2. player_tbl = {
    	index = {
    		in_zone = false,
    		
    		zombie_proof = false,
    		
    		zombies = {},
    		zombie_limit = 60,
    		
    		create_zombie = function(player)
    			outputChatBox("test")
    			if player.zombie_proof or not player.in_zone or isPedDead(player.element) then
    				return
    			end
    			
    			local zombie_count = 0
    			while zombie_count < 3 do
    				triggerClientEvent ("find_spawn_location", player.element)
    				zombie_count = zombie_count + 1
    			end
    		end
    	},
    	
    	players = {}
    }
    
    addEventHandler("onResourceStart", resourceRoot, function()
    	for i, player in ipairs(getElementsByType("player")) do
    		local self = setmetatable({
    			element = player
    		},
    		{
    			__index = player_tbl.index
    		})
    		
    		table.insert(player_tbl.players, self)
    		
    		Timer(function(self)
    			self:create_zombie() -- this line
    			--self.create_zombie(self) -- or this line
    		end, 10000, 0, self)
    	end
    end)

    OD3L3z.png

     

    What is the cause of the mistake?

  3. The GTA is opening when I try to open MTA. How can i fix it?

    I have tried to solve it many times. I formatted the computer. But it did not improve.

  4. Script has 5 parchments. These;
    Extra Health:
    - When you bought a parchment from the extra health section, the parchment increases your maximum health according of the parchment quality you bought. Your money will not be refunded if you cancel.

    Heal:
    - When you bought a parchment from the heal section, your health increases in the amount specified in the specified repetition time. Your money will not be refunded if you cancel.

    Prevent Damage:
    - When you bought a parchment from the prevent damage section, the damage you receive is reduced at the specified rates. Falling, drowning and so on are not included. Your money will not be refunded if you cancel.

    Extra Damage:
    - When you bought a parchment from the extra damage section, when you damage a car or a player with a weapon, your damage increases in the specified rate. Your money will not be refunded if you cancel.

    Money:
    - When you bought a parchment from the money section, the money you give to buy the parchment increases in the specified and the money is returned to you when the time is up. Your money will be refunded if you cancel.

     

    I think it would be useful for freeroam servers. Comment if you encounter an error.

    Click for download

     

    İmages

    Version 1.0.0

    22764.png

     

     

    #CrawL helped me for testing script. Thanks.

    • Like 1
  5. local szefpozicio = {
        {2485.87524, -1666.34705, 13.34380},
        {2487.87526, -1666.34705, 13.34380}
    }
    local szef = createObject (2634, unpack(szefpozicio[1]))
    local szefrectangle = createColRectangle (2485.8720703125, -1665.8211669922, 5, 5)
    
    function szefopen(jatekos)
        if isElementWithinColShape (jatekos, szefrectangle) then
            moveObject (szef, 5000, unpack(szefpozicio[2]))
            outputChatBox (math.random(1, 2))
        end
    end
    addCommandHandler ("felfeszit", szefopen)

     

    • Like 1
  6. addEventHandler("onPlayerLogin", root, function()
        local coin = getAccountCoinValue(source) or 0
        setElementData(source, "moneycoins", coin)
    end)
    
    addEventHandler("onPlayerQuit", root, function()
        local coin = getElementData(source, "moneycoins") or 0
        setAccountCoinValue(source, coin)
    end)
    
    addEventHandler("onResourceStart", resourceRoot, function()
        for _, player in pairs(getElementsByType("player")) do
            local coin = getAccountCoinValue(player)
            if coin then
                setElementData(player, "moneycoins", coin)
            end
        end
    end)

     

    • Like 1
  7. 2 minutes ago, Fist said:

    You still can add extra check variable like this

    
    function shootingWhileMoving()    for i=23,34 do    	if (i ~= 28) then            local wepid = i;            for _,level in pairs({"poor", "std", "pro"}) do                setWeaponProperty(wepid, level, "flag_move_and_aim", true)                setWeaponProperty(wepid, level, "flag_move_and_shoot", true)            end      	end    endend

    but agreed, in this case would better just to use table. :D

    :)

  8. 8 hours ago, Fist said:

    this is better way to write it, less code required.

    
    function shootingWhileMoving()
        for i=23,34 do
            for _,level in pairs({"poor", "std", "pro"}) do
                setWeaponProperty(i, level, "flag_move_and_aim", true)
                setWeaponProperty(i, level, "flag_move_and_shoot", true)
            end
        end
    end
    

     

    Avagard is not use 28 id.

     

    ------

     

    local properties = {
        weapons = {23,24,25,26,27,29,30,31,33,34},
        levels = {"poor", "std", "pro"}
    }
    function shootingWhileMoving()
        for _, id in pairs(properties.weapons) do
            for _, level in pairs(properties.levels) do
                setWeaponProperty(id, levels, "flags", 0x000010)
                setWeaponProperty(id, levels, "flags", 0x000020)
            end
        end
    end

    Try it.

×
×
  • Create New...