Jump to content

iRack

Members
  • Posts

    17
  • Joined

  • Last visited

Posts posted by iRack

  1. Hi! Can someone help me to solve this problem? Problem : [2019-06-19 17:29:06] ERROR: boxcreated\server.Lua:52: bad argument #2 to 'random' (interval is empty)
    [2019-06-19 17:29:06] ERROR: boxcreated\server.Lua:57: bad argument #1 to 'random' (number expected, got table)

     

    Quote

            if hit and getElementType(hit) == "player" then
                local reward = math.random(100)
                if reward >= settings.possibility[1] then
                    local weapon,ammo = settings.weaponIDs[math.random(#settings.weaponIDs)],math.random(settings.ammoCount[1],settings.ammoCount[2])
                    giveWeapon(hit,weapon,ammo) -- oyuncuya silah ver
                    outputChatBox(getPlayerName(hit).." #FFFFFFfound the gift box and won #FF0000"..getWeaponNameFromID(weapon).." ("..ammo.." ammo) #FFFFFF$ Congratulations!",root,255,255,255,true)
                --    outputChatBox(getPlayerName(hit).." #FFFFFFfound the gift box and won #00FF00"..getWeaponNameFromID(weapon).." ("..ammo.." ammo)",root,255,255,255,true)
                else
                    local money = math.random(settings.cashCount[1],settings.cashCount[2])
                    givePlayerMoney(hit,money) -- oyuncuya para ver
                    outputChatBox(getPlayerName(hit).." #FFFFFfound the gift box and won #FF0000"..money.."#FFFFFF$ Congratulations!",root,255,255,255,true)
                --    outputChatBox(getPlayerName(hit).." #FFFFFFfound the gift box and won #00FF00"..money.."#FFFFFF$",root,255,255,255,true)
                end            
                    local premium = math.random(settings.premiumCount)
                    aclGroupAddObject(aclGetGroup("Premium"), "user."..accountName)
                    outputChatBox(getPlayerName(hit).." #FFFFFfound the gift box and won #FF0000"..premium.."#FFFFFF$ Congratulations!",root,255,255,255,true)
                --    outputChatBox(getPlayerName(hit).." #FFFFFFfound the gift box and won #00FF00"..getWeaponNameFromID(weapon).." ("..ammo.." ammo)",root,255,255,255,true)        
                else
                if settings.health_armor then
                    setElementHealth(hit,100)
                    setPedArmor(hit,100)
                end
                outputChatBox("No hidden gift box found :(",root,255,0,0,true)
            --    outputChatBox("No hidden gift box found :(",root,255,0,0,true)
            end
            setTimer(destroyElement,1500,1,secretBox)
            removeEventHandler("onColShapeHit",col,stopSearch)
            destroyElement(col)
            secretBox = nil
            col = nil
            triggerClientEvent("secretBox:stopRender",resourceRoot,hit)
            outputChatBox("The next gift box will be create in "..settings.createTime.." minutes.",root,0,255,0,true)
        --    outputChatBox("The next gift box will be create in "..settings.createTime.." minute.",root,0,255,0,true)
            createTimer = setTimer(createSecretBox,settings.createTime*60000,1)
        end
    end
     

    52 is:               local money = math.random(settings.cashCount[1],settings.cashCount[2])

    57 is:               local premium = math.random(settings.premiumCount)

    and:

    Quote

    settings = {
        createTime = 160, -- create time (minute)
        searchTime = 5, -- time to search (minute) (disappear when the time expires)
        weaponIDs = {22,23,24,25,26,27,28,29,30,31,32}, -- weapon ids
        ammoCount = {30,60,90}, -- minAmmo,maxAmmo
        cashCount = {3000,1000}, -- minCash,maxCash
        premiumCount = {1},
        possibility = {20,30,50}, -- money,weapon (default: %70 money, %30 weapon, %50 premium acc)
        objectID = 1347, -- box object
        health_armor = true, -- when player find the secret box give health and armor?
        command = "createBox", -- create secret box command
    }

    Help please ? 

  2. ,,You want to show the timestamp before every line on the chat? (or I do not understand...) "

    exactly! Thanks for help! I will buy a script, because it is not working, I think it is a problem between 8 and 19 because it is not working all the script.Your was what I wanted. Thanks for help man! Have a nice day!

    • Like 1
  3. No, I have a resource which is blocking the players colors, all players have the color White at their nick. For every time of chat like this: https://imgur.com/a/4danWtz  Look at that guy [PREMIUM], that in premium chat [/pc] like [/a-chat admin] has before the tag a timestamp with the color green because the chat is made with that color. Or admin chat in this photo https://imgur.com/a/4danWtz . (2)Admin K... has a timestamp between him because is a different chat and the timestamp with another color. I don't know how to explain. This is my chat with your code : https://imgur.com/a/qKgGlCF Thanks for help 

  4. If someone type in the chat (T), the timestamp(timestamp is the [minutes:seconds]Player:<text>] it will be white. If someone type on a different chat like faction chat and that chat is blue, the timestamp will appear will the color blue. Another exemple, if i make a code with OutPutChatBox with #FF0000 (red), the timestamp will apear with the color red. Simple: the Color in chat will be exactly the timestamp color. 

  5. Hi! I have this code and I don't know how to make it to look like this : https://imgur.com/a/LZku5bk . My resource : https://imgur.com/a/RDaXnTk . I want that : when the private chat ( photo with red <<Inspector>> ) is with red, the time stamp will be with red or when I put an ad with color green , the time stamp will be green too. Code:

    Quote

    function theFormat()
        local realtime = getRealTime()
        return
        string.format("%02d:%02d:%02d", realtime.hour, realtime.minute, realtime.second)
    end

    function chattime(text, msgtype)
        local cTime = theFormat()
        local pName = getPlayerName(source)
    if (msgtype == 0) then
        cancelEvent()
        outputChatBox("["..cTime.."] #FFFFFF"..pName..": #ebddb2"..text, getRootElement(), 255, 255, 255, true)
    end
    end
    addEventHandler("onPlayerChat", root, chattime)
     

     

  6. Hi! Can someone help me? It didn't worked for me :(

    addEvent("Arrow", true)
    addEventHandler("Arrow", root, function()
      local l_11_0 = getElementData(source, "carro")
      if not isElement(l_11_0) then
        outputChatBox(" *You do not have a vehicle!", source, 255, 0, 0)
        return 
      end
      if l_11_0 and isElement(l_11_0) then
        if isElement(l_0_5[source]) then
          destroyElement(l_0_5[source])
          outputChatBox(" *The arrow has been removed from your vehicle.", source, 255, 0, 0)
        else
          local l_11_1, l_11_2, l_11_3 = getElementPosition(l_11_0)
          l_0_5[source] = createObject(1318, l_11_1, l_11_2, l_11_3 + 2, 0, 0, 0)
          attachElements(l_0_5[source], l_11_0, 0, 0, 2)
          outputChatBox(" *The arrow has been attached to your vehicle.", source, 0, 255, 0)
        end
      end
    end
    )

    and carro is :

    veiculo = {}
    function carro()
    	if getPedOccupiedVehicle(source) then
    		displayServerMessage(source, "Get Out Of The Vehicle First", "warning")
    		return
    	end
    	if veiculo[source] and isElement(veiculo[source]) then
    		destroyElement(veiculo[source])
    	end
    		local x, y, z = getElementPosition(source)
    		veiculo[source] = createVehicle(541, x, y, z)
    		warpPedIntoVehicle(source, veiculo[source])
    		displayServerMessage(source, "You Got a BMW M4 VIP", "confirm")
    end
    addEvent("carro", true)
    addEventHandler("carro", getRootElement(), carro)

    Please help me. When I try to make the arrow it sais: ''You do not have a vehicle''! Help me please!!

  7. Hi ! Can someone help me with a quest system ? I don't know how to make it like this : When you type [/quests] in chat will appear 2 quests ( it will be reseted at every 24h ) with color yellow. A simple quest : Go and photo the Police Departament or Go to the highest building in Los Santos . When you finish one of them, you will get some money. Please ! I don't know how to do it !

  8. Hi guys ! I have this moddownloader ( https://community.multitheftauto.com/index.php?p=resources&amp;s=details&amp;id=11265  ) and I installed 2 cars, cadrona and elegy, after that I started followed the steps to get the car. When I added it in the folder named 'resources' and activating it, I recognized that the cars are not working. I opeded the folder and I saw the files has 0 MB. Can someone tell my what's wrong. I downloaded another moddownloader and again the same problem . All files was changed at 0 MB. Please help

  9. Hi can someone help me? I want to make a plot with Mapping for a farming. I can make the mapping, but i don't know how to make a plot like this: You, as a player, you can buy a small plot. You can own only that small plot where you can plant seeds. And the question is, how can i make the plot? To buy it with a small icon " i " and if you type [/buy] in chat and to take from the player an ammount of money with and OutPutChatMessage ,,You bought it". I want the rules to create it. Thanks a lot!

  10. Hi, can someone help me ? I don't understand what's wrong. Look at this errors :

    [2019-03-17 07:49:57] Starting rpdemine
    [2019-03-17 07:49:57] WARNING: rpdemine\admin\server.lua:410: Bad argument @ 'getPlayerAccount' [Expected element at argument 1, got nil]
    [2019-03-17 07:49:57] WARNING: rpdemine\admin\server.lua:410: Bad argument @ 'getAccountName' [Expected account at argument 1, got boolean]
    [2019-03-17 07:49:57] ERROR: rpdemine\admin\server.lua:411: attempt to concatenate local 'accName' (a boolean value)
    [2019-03-17 07:49:57] WARNING: rpdemine\fraktion\ambulance\base.lua:107: Bad argument @ 'getPlayerAccount' [Expected element at argument 1, got nil]
    [2019-03-17 07:49:57] WARNING: rpdemine\fraktion\ambulance\base.lua:115: Bad argument @ 'getPlayerFromName' [Expected string at argument 1, got nil]

    This is the script :

    Quote

    function teleprotect ( thePlayer)
      local vehicle = getPedOccupiedVehicle(playerSource)  
      if vehicle then 
        setElementVelocity(vehicle,0,0,0) 
        setElementPosition (vehicle, 4131.3872070313, -1759.1988525391, 3) 
      else 
        setElementPosition (playerSource, 4131.3872070313, -1759.1988525391, 3) 
      end 
      outputChatBox ("You Have Been Teleported To The Highway!!", playerSource, 0, 255, 0) 
    end 
                local accName = getAccountName(getPlayerAccount(thePlayer))
                 if isObjectInACLGroup("user."..accName, aclGetGroup("Admin")) then
       outputChatBox ( "Server: You are not an owner!", thePlayer, 0, 255, 0 )    
             setElementPosition (thePlayer, 4131.3872070313, -1759.1988525391, 3) 
        else
            outputChatBox (getPlayerName(thePlayer) .. ' #BEBEBEASf ! ', source, 255,255,255,true)
       end
    addCommandHandler ("highway", teleprotect) 

    (Here I want to go to the highway with my car )

    And this :

    Quote

    function healPlayer(player, cmd, name, price)
      if not name or not price then
        outputChatBox("/heal [Player_Name] [Price]", player, 255, 255, 255, true)
      else
          end
        end
          local gang = getPlayerAccount(thePlayer)
       if (gang) then
        if getAccountData(gang, "keks.fraktion") == 3 then
             outputChatBox("hp <name> <price>", thePlayer)
        else
         outputChatBox("You are not a member of Paramedic!", thePlayer, 255, 0, 0)
        end
           end
        local target = getPlayerFromName(name)
        if target then
          if getPlayerMoney(target)>=tonumber(price) then
            takePlayerMoney(target, tonumber(price))
            givePlayerMoney(player, tonumber(price))
            setElementHealth(target, 100)
            outputChatBox(getPlayerName(player) .. " healed you!", player, 255, 255, 255, true)
            outputChatBox("You healed " .. getPlayerName(target), player, 255, 255, 255, true)
          else
            outputChatBox("Can't pay the healing", player, 255, 255, 255, true)
          end
        else
          outputChatBox("I can't find the target!", player, 255, 255, 255, true)
        end
    addCommandHandler("heal", healPlayer)

    (This is a faction system, if you are in the faction named ''Paramedic Departament'' with ID 3, you will be able to use the command [/heal]. What's wrong with this scripts ? thanks a lot guys !!! :)

  11. Hi ! Can someone help me ? I want: ONLY in that cylinder you can use command [/ad], only in it, I don't know how to do it. ( it's an advertisement system for RPG ) Thanks a lot ! :)

     

     

    function Advertisment(thePlayer, commandName, ...)
    		local players = getElementsByType("player")
    		local playerName = getPlayerName ( thePlayer )
    		local chatContent = {...}
    		for index, player in ipairs ( players ) do
    			outputChatBox( "Advertisment from " .. playerName.. ": " ..table.concat ( chatContent, " "), player, 0, 190, 40)
    		end
    	end
    addCommandHandler( "ad", Advertisment )
    
    cylinder = createMarker(1168.6981201172, -1489.6285400391, 21.756763458252, "cylinder", 5, 100, 0, 0)
    setElementInterior(cylinder, 0)
    
    function Advertisment (thePlayer)
     if source == Advertisment then
      setElementInterior(thePlayer, 0)
      setElementPosition(thePlayer, 1168.6981201172, -1489.6285400391, 22.756763458252)
     elseif source == cylinder then
      outputChatBox("Type [/ad] to publish your advertisment.", thePlayer, 255, 255, 0)
      end
    end
    addEventHandler("onMarkerHit", getRootElement(), Advertisment)

     

×
×
  • Create New...