Jump to content

SkatCh

Members
  • Posts

    365
  • Joined

  • Last visited

Posts posted by SkatCh

  1. Can't you see it? aGrid1 is nil... it's not defined, the gridlist wasn't created. Show us the code where you created it, it's possibly local variable.

    i add it to local variable :

    local aWindow, aTab,aButton, aEdit,aColumn, aLabel,aGrid1 = {}, {}, {}, {}, {}, {} , {}, {}, {} ,{} 
    

    and now i got this warning in the same lines but :

    [expected gui-element at argument 1 , got table ]

  2. hello community please can any one help me to fix this :

    function addPlayersToGridlist() 
        if (not aColumn or isAdminBrowsing) then return end 
        guiGridListClear(aGrid1)     -- line 502 
        for index, players in pairs(getElementsByType("player")) do  
            local localTeam = getPlayerTeam(players) 
            if (localTeam) then 
                mainR, mainG, mainB = getTeamColor(localTeam) 
            else 
                mainR, mainG, mainB = 255, 255, 255 
            end 
            local row = guiGridListAddRow(aGrid1)  -- line 510 
            local name = getPlayerName(players) 
            guiGridListSetItemText(aGrid1, row, aColumn, name, false, false)  -- line 512 
            guiGridListSetItemColor(aGrid1, row, aColumn, mainR, mainG, mainB)  -- line 513 
            getPlayerRow[players] = row 
        end 
    end 
    

    warnings :

    7502090fd8.jpg

  3. ok i did that thanks i started fine with no errors on MTA Server good but now when i go on my server it say: ERROR: Couldn't parse config cteamloader.lua in resource teams

    it's easy to fix it just check your Teams resource then do the same thing or just post your meta here and i will fix it for you .

  4. guys please i need some help how can i fix this i create a medkits system but i have a problem when i try to save player medkits .

    function getPlayerMedKits(player) 
        local medKits = tonumber(getAccountData(player, "medKits")) or 0 
        return medKits 
    end 
      
    function setPlayerMedKits(player, amount) 
        setAccountData(player, "medKits", tostring(amount)) 
        getPlayerAccount(player, "medKits", tostring(amount)) 
        triggerClientEvent(player, "onMedKitLoad", player, amount) 
        return true 
    end 
    

    warnings :

    -Bad argument @ 'getAccountData' [Expected account at argument 1, got player ]

    -Bad argument @ 'setAccountData' [Expected account at argument 1, got player ]

  5. i think you don't undrestand my question it's just a part from the script i already create the table using sqlite :

    dbExec(con, "CREATE TABLE IF NOT EXISTS gangSysGangs (name TEXT, count TEXT, leader TEXT, lastactive TEXT, message TEXT,turfcolor TINYTEXT, chatcolor TINYTEXT, invitesUsed INTEGER)") 
    

    all what i need is i want to create an export function to call it from turf script to get the group turf color did you undrestand what i mean .

  6. guys please i want to create an export fuction (getGroupTurfColor) to call it when a gang hit a turf area :

    a part of the script :

    function command_turfcolor(player, _, r, g, b) 
        local gang = getPlayerGang(player) 
        if (not gang) then return end 
        if (canPlayerDoActionInGroup(player, "changeTurfColor")) then 
            if (r and g and b) then 
                r = tonumber(r) 
                g = tonumber(g) 
                b = tonumber(b) 
                if (r and g and b) then 
                    if (r >= 0 and r <= 255 and g >= 0 and g <= 255 and b >= 0 and b <= 255) then 
                        local colorTable = {math.floor(r), math.floor(g), math.floor(b)} 
                        dbExec(con, "UPDATE gangSysGangs SET turfColor=? WHERE name=?", toJSON(colorTable), gang) 
                        gangs[gang][5] = colorTable 
                        exports.COG_text:output("Turfcolor set to "..colorTable[1]..", "..colorTable[2]..", "..colorTable[3], player, colorTable[1], colorTable[2], colorTable[3]) 
                    else 
    

    i tried this but it dosen't work :

    function getGroupTurfColor(gang) 
        if (not groupTable) then return 255, 255, 255 end 
        local color = fromJSON(gangs[gang][5]) 
        return colorTable[1], colorTable[2], colorTable[3] 
    end 
    

    function="getGroupTurfColor" type="server"/> 
    

  7. i think your music link must be format pls .

    addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function() 
            playSound(""[url=http://www]http://www[/url].181.fm/winamp.pls?station=181-power&style=mp3&description=Power%20181%20(Top%2040)&file=181-power.pls"") 
        end 
    end 
    ) 
    

    meta

        

    or you can use music from ur computer so you need to add the music file inside ur resource folder then add this in ur meta file.

        "musicName.mp3"  /> 
      
    

×
×
  • Create New...