Jump to content

MTA PROBLEM -Expected string at argument 1, got nil


Recommended Posts

Posted

Hy i have a little problem:

there is error : 

WARNING: shop-system/s_generalshop_system.lua:1047: Bad argument @ 'triggerEvent' [Expected element at argument 2, got nil]

This is code :

 function delNearbyGeneralshops(thePlayer, commandName)
    if (exports.integration:isPlayerTrialAdmin(thePlayer)) then
        local posX, posY, posZ = getElementPosition(thePlayer)
        outputChatBox("Deleting Nearby Shop NPC(s):", thePlayer, 255, 126, 0)
        local count = 0
        
        local dimension = getElementDimension(thePlayer)
        
        for k, thePed in ipairs(getElementsByType("ped", resourceRoot)) do
            local pedType = getElementData(thePed, "ped:type")
            if (pedType) then
                if (pedType=="shop") then
                    local x, y = getElementPosition(thePed)
                    local distance = getDistanceBetweenPoints2D(posX, posY, x, y)
                    local cdimension = getElementDimension(thePed)
                    if (distance<=10) and (dimension==cdimension) then
                        local dbid = getElementData(thePed, "dbid")
                        local shoptype = getElementData(thePed, "shoptype")
                        if deleteGeneralShop(thePlayer, "delshop" , dbid) then
                            --outputChatBox("   Deleted Shop with ID #" .. dbid .. " and type "..shoptype..".", thePlayer, 255, 126, 0)
                            count = count + 1
                        end
                    end
                end
            end
        end
        
        if (count==0) then
            outputChatBox("   Deleted None.", thePlayer, 255, 126, 0)
        else
            outputChatBox("   Deleted "..count.." None.", thePlayer, 255, 126, 0)
        end
    end
end
addCommandHandler("delnearbyshops", delNearbyGeneralshops, false, false)
addCommandHandler("delnearbynpcs", delNearbyGeneralshops, false, false) 

Posted
2 minutes ago, NeverUnbeatable said:

I don't see a line with error.

WARNING: shop-system/s_generalshop_system.lua:1047: Bad argument @ 'triggerEvent' [Expected element at argument 2, got nil]

Posted
31 minutes ago, Dimos7 said:

We not give help to leaked scripts also there not triggerEvent int that code 

I buy that script from my friend, and ye... Okay :( 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...