Jump to content

expected string at argument


Best-Killer

Recommended Posts

Posted
local sWidth,sHeight = guiGetScreenSize()


addEvent("SAEGGroups:Kills", true)
addEventHandler("SAEGGroups:Kills", root,function ()
    killgrid = guiCreateGridList(sWidth* (865/1024 ), sHeight*( 590/768 ), sWidth*( 159/1024 ), sHeight*( 178/768) , false)
    guiGridListAddColumn(killgrid, "Gang", 0.5)
    guiGridListAddColumn(killgrid, "Kills", 0.5)
    guiSetAlpha(killgrid, 0.73)   
    dxDrawRectangle(sWidth*865, sHeight*590, sWidth*159, sHeight*178, tocolor(0, 0, 0, 180), false)	
	guiSetVisible ( killgrid,true )
	setTimer ( triggerServerEvent, 15000, 1, "getData", localPlayer )
end
)
  
function isEventHandlerAdded( sEventName, pElementAttachedTo, func ) 
    if  
        type( sEventName ) == 'string' and  
        isElement( pElementAttachedTo ) and  
        type( func ) == 'function'  
    then 
        local aAttachedFunctions = getEventHandlers( sEventName, pElementAttachedTo ) 
        if type( aAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then 
            for i, v in ipairs( aAttachedFunctions ) do 
                if v == func then 
                    return true 
                end 
            end 
        end 
    end 
  
    return false 
end 
Kills_ = {} 

function theLocator() 
    local allLocation = {"Las Venturas", 
    "San Fierro", 
    "Las Venturas", 
    "Los Santos"} 
    local players = getElementsByType ( "player" ) 
    for i, source in ipairs ( players ) do 
     local theLocation = getElementZoneName(source, true) 
       for theKey, allLocation in ipairs(allLocation) do 
        if (theLocation == allLocation) then 
            triggerClientEvent ( source, "SAEGGroups:Kills", source ) 
        end 
    end 
end 
end 

function startLocator() 
setTimer ( theLocator, 15000, 0 ) 
end 
addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), startLocator ) 
  
addEventHandler("onPlayerWasted",root,function ( _,Killer ) 
    if ( Killer and Killer ~= source and getElementType(Killer) == "player" ) then  
            local groupPlayer = exports.SAEGGroups:getPlayerGroup( Killer ) 
                if not Kills_[Killer] then Kills_[Killer] = 0; end 
                    Kills_[Killer] = Kills_[Killer] + 1 
                        local Sel = exports.NGSQL:db_query("SELECT * FROM groups WHERE Name=?", groupPlayer) 
                            if ( type ( Sel ) == "table" and #Sel == 0 or not Sel ) then 
                                exports.NGSQL:db_exec(" INSERT INTO groups ( Kills ) VALUES(?)",Kills_[Killer]) 
            else 
					exports.NGSQL:db_exec(" UPDATE groups SET Kills = ? WHERE name = ?", Kills_[Killer], groupPlayer)
        end 
    end 
end) 




addEvent ( 'getData', true) 
addEventHandler ( 'getData', root, function() 
    local db = exports.NGSQL:db_query("SELECT * FROM groups")  
        if ( type ( db ) == "table" and #db == 0 or not db ) then return end 
            triggerClientEvent ( source, 'setData', source, db ) 
    end 
) 

 

bad argument @ 'guiGridListSetItemText' expected string at argument 4, got boolean

 

the name shoing in gui fine but kills now 

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...