Jump to content

Best-Killer

Members
  • Posts

    494
  • Joined

  • Last visited

Everything posted by Best-Killer

  1. so , where the proble m ?? in sql or in NGsql (i'm using nerd gaming scripts & editing them , making new scripts to them )
  2. ye ye mysql
  3. Xampp
  4. i fixed it ^^thx all
  5. Okk i'll try ^^
  6. if ( tostring ( get ( "CONNECTION_TYPE" ) ):lower() == "mysql" ) then outputConsole ( "Attempting to connect as MySQL... Please wait") db = dbConnect( "mysql", "dbname="..tostring(get("DATABASE_NAME"))..";host="..tostring(get("MYSQL_HOST"))..";port="..tostring(get("MYSQL_PORT"))..";unix_socket=/opt/lampp/var/mysql/mysql.sock", tostring(get("MYSQL_USER")), tostring(get("MYSQL_PASS")), "share=1;autoreconnect=1" ); elseif ( tostring ( get ( "CONNECTION_TYPE" ) ):lower() == "sqlite" ) then db = dbConnect ( "sqlite", tostring(get("DATABASE_NAME")) .. ".sql" ); else error ( tostring(get("CONNECTION_TYPE")) .. " is an invalid SQL connection -- valid: mysql, sqlite" ); end if not db then print ( "The database has failed to connect") return else print ( "Database has been connected") end function db_query ( ... ) local data = { ... } return dbPoll ( dbQuery ( db, ... ), - 1 ) end function db_exec ( ... ) return dbExec ( db, ... ); end dbexe failed, (1064) you have an error in your sql syntax; check the manual that corresponds to your mariaDB server version for the right syntax to use near
  7. i'm using SQL
  8. Guys i'm making a bank system i want know how to make Id of the marker !! example : i create marker 2 markers now when player hitmarker number 1 the gui will be showen to the player if the player hit marker number 1 he get in the gui panel : ----Bank System (1)--- if the player hit marker number 2 he get in the gui : ----Bank System (2)--- hope you unerstand me
  9. bad argument #1 to 'sort' (table expected, got boolean ) Client------- local screenW, screenH = guiGetScreenSize() function killListGui() killgrid = guiCreateGridList(865, 590, 159, 178, false) guiGridListAddColumn(killgrid, "Gang", 0.5) guiGridListAddColumn(killgrid, "Kills", 0.5) guiSetAlpha(killgrid, 0.73) dxDrawRectangle(865, 590, 159, 178, tocolor(0, 0, 0, 180), false) guiSetVisible ( killgrid,true ) end addEventHandler("onClientResourceStart", resourceRoot,killListGui) dx = function() dxDrawRectangle(865, 590, 159, 178, tocolor(0, 0, 0, 180), false) 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 bindKey('f4','down', function() if isEventHandlerAdded ("onClientRender", root,dx) then removeEventHandler("onClientRender", root,dx) else triggerServerEvent( 'getData', localPlayer ) addEventHandler("onClientRender", root,dx) end end) addEvent( 'setData', true ) addEventHandler ( 'setData', root, function(data) guiGridListClear ( killgrid ) table.sort ( data, function (a,b) return ( tonumber(a.kills) or 0 ) > ( tonumber(b.kills) or 0 )end) for k,v in ipairs ( data ) do local Row = guiGridListAddRow(killgrid) guiGridListSetItemText(killgrid,Row,1,v.name,false,false) guiGridListSetItemText(killgrid,Row,2,v.kills,false,false) if k == 10 then break end -- هذا بس 10 ويوقف تقدر تعدله او تحذف السطر . end end) serve------ Kills_ = {} addEventHandler('onResourceStart',resourceRoot,function () exports.NGSQL:db_exec("CREATE TABLE IF NOT EXISTS `group_stuff` ( name, kills "); end ) 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_exec("SELECT * FROM `group_stuff` WHERE name=?", groupPlayer) if ( type ( Sel ) == "table" and #Sel == 0 or not Sel ) then exports.NGSQL:db_exec(" INSERT INTO `group_stuff` (name, kills) VALUES(?,?)",groupPlayer , Kills_[Killer]) else exports.NGSQL:db_exec(" UPDATE `group_stuff` SET kills = ? WHERE name = ?", Kills_[Killer], groupPlayer) end end end) addEvent ( 'getData', true) addEventHandler ( 'getData', root, function() local db = exports.NGSQL:db_exec("SELECT * FROM `group_stuff` ") if ( type ( db ) == "table" and #db == 0 or not db ) then return end triggerClientEvent ( source, 'setData', source, db ) end )
  10. any one ??
  11. with addEventHandler('onResourceStart',resourceRoot,function () exports.NGSQL:db_exec("CREATE TABLE IF NOT EXISTS `group_stuff` ( name VARCHAR(20), kills VARCHAR(40)"); end ) and exports.NGSQL:db_exec(" UPDATE `group_stuff` SET kills = ? WHERE name = ?", Kills_[Killer], groupPlayer) and that client side : local screenW, screenH = guiGetScreenSize() function killListGui() killgrid = guiCreateGridList(865, 590, 159, 178, false) guiGridListAddColumn(killgrid, "Gang", 0.5) guiGridListAddColumn(killgrid, "Kills", 0.5) guiSetAlpha(killgrid, 0.73) dxDrawRectangle(865, 590, 159, 178, tocolor(0, 0, 0, 180), false) guiSetVisible ( killgrid,true ) end addEventHandler("onClientResourceStart", resourceRoot,killListGui) dx = function() dxDrawRectangle(865, 590, 159, 178, tocolor(0, 0, 0, 180), false) 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 bindKey('f4','down', function() if isEventHandlerAdded ("onClientRender", root,dx) then removeEventHandler("onClientRender", root,dx) else triggerServerEvent( 'getData', localPlayer ) addEventHandler("onClientRender", root,dx) end end) addEvent( 'setData', true ) addEventHandler ( 'setData', root, function(data) guiGridListClear ( killgrid ) table.sort ( data, function (a,b) return ( tonumber(a.Kills) or 0 ) > ( tonumber(b.Kills) or 0 )end) for k,v in ipairs ( data ) do local Row = guiGridListAddRow(killgrid) guiGridListSetItemText(killgrid,Row,1,v.name,false,false) guiGridListSetItemText(killgrid,Row,2,v.kills,false,false) if k == 10 then break end -- هذا بس 10 ويوقف تقدر تعدله او تحذف السطر . end end) error : bad argument #1 to 'sort' (table expected, got boolean )
  12. you're right but still same error
  13. server Kills_ = {} addEventHandler('onResourceStart',resourceRoot,function () exports.NGSQL:db_exec("CREATE TABLE IF NOT EXISTS `group_stuff` ( name, kills , arrests )") end ) 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_exec("SELECT * FROM `group_stuff` WHERE name=?", groupPlayer) if ( type ( Sel ) == "table" and #Sel == 0 or not Sel ) then exports.NGSQL:db_exec(" INSERT INTO `group_stuff` (name, kills) VALUES(?,?)",groupPlayer , Kills_[Killer]) else exports.NGSQL:db_exec(" UPDATE `group_stuff` SET name =?, kills =? ",groupPlayer,Kills_[Killer]) end end end) addEvent ( 'getData', true) addEventHandler ( 'getData', root, function() local db = exports.NGSQL:db_exec("SELECT * FROM `group_stuff` ") if ( type ( db ) == "table" and #db == 0 or not db ) then return end triggerClientEvent ( source, 'setData', source, db ) end ) Client : local screenW, screenH = guiGetScreenSize() function killListGui() killgrid = guiCreateGridList(865, 590, 159, 178, false) guiGridListAddColumn(killgrid, "Gang", 0.5) guiGridListAddColumn(killgrid, "Kills", 0.5) guiSetAlpha(killgrid, 0.73) dxDrawRectangle(865, 590, 159, 178, tocolor(0, 0, 0, 180), false) guiSetVisible ( killgrid,true ) end addEventHandler("onClientResourceStart", resourceRoot,killListGui) dx = function() dxDrawRectangle(865, 590, 159, 178, tocolor(0, 0, 0, 180), false) 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 bindKey('f4','down', function() if isEventHandlerAdded ("onClientRender", root,dx) then removeEventHandler("onClientRender", root,dx) else triggerServerEvent( 'getData', localPlayer ) addEventHandler("onClientRender", root,dx) end end) addEvent( 'setData', true ) addEventHandler ( 'setData', root, function(data) guiGridListClear ( killgrid ) table.sort ( data, function (a,b) return ( tonumber(a.Kills) or 0 ) > ( tonumber(b.Kills) or 0 )end) for k,v in ipairs ( data ) do local Row = guiGridListAddRow(killgrid) guiGridListSetItemText(killgrid,Row,1,v.name,false,false) guiGridListSetItemText(killgrid,Row,2,v.kills,false,false) if k == 10 then break end -- هذا بس 10 ويوقف تقدر تعدله او تحذف السطر . end end) error : dbexe failed, (1064) you have an error in your sql syntax; check the manual that corresponds to your mariaDB server version for the right syntax to use near 'kills , arrests)
  14. Bump*
  15. error : bad argement to #1 'ceil' number (expected , got boolean) Line 9 function carhud() local sWidth,sHeight = guiGetScreenSize() if isPedInVehicle(localPlayer) then vehicle = getPedOccupiedVehicle(localPlayer) health = math.ceil ( getElementHealth ( vehicle ) / 10 ) speedx, speedy, speedz = getElementVelocity ( vehicle) actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5) kmh = math.ceil(actualspeed * 180) fuel = math.ceil(getElementData ( vehicle, "fuel" )) dxDrawImage((400/1024)*sWidth, (550/768)*sHeight, (250/1024)*sWidth, (200/768)*sHeight, "outras/background.png",0,250,10,tocolor(0,0,0,255)) dxDrawImage((570/1024)*sWidth, (575/768)*sHeight, (25/1024)*sWidth, (150/768)*sHeight, "outras/line.png",0,0,0,tocolor(255,255,255,255)) dxDrawImage((595/1024)*sWidth, (570/768)*sHeight, (19/1024)*sWidth, (45/768)*sHeight, "outras/lock.png",0,0,0,tocolor(255,255,255,255)) dxDrawImage((595/1024)*sWidth, (620/768)*sHeight, (19/1024)*sWidth, (45/768)*sHeight, "outras/engine.png",0,0,0,tocolor(255,255,255,255)) dxDrawImage((595/1024)*sWidth, (670/768)*sHeight, (19/1024)*sWidth, (45/768)*sHeight, "outras/light.png",0,0,0,tocolor(255,255,255,255)) dxDrawText(tostring (kmh).." Km/H",(470/1024)*sWidth, (585/768)*sHeight, (20/1024)*sWidth, (40/768)*sHeight, tocolor(255,255,255,255), (sWidth/1024)*0.65, newFont3,"left","top",false,false,false) dxDrawImage((430/1024)*sWidth, (575/768)*sHeight, (30/1024)*sWidth, (50/768)*sHeight, "outras/speed.png",0,0,0,tocolor(255,255,255,255)) dxDrawText(tostring (fuel).."%",(470/1024)*sWidth, (635/768)*sHeight, (20/1024)*sWidth, (50/768)*sHeight, tocolor(255,255,255,255), (sWidth/1024)*0.75, newFont3,"left","top",false,false,false) dxDrawImage((430/1024)*sWidth, (625/768)*sHeight, (30/1024)*sWidth, (50/768)*sHeight, "outras/fuel.png",0,0,0,tocolor(255,255,255,255)) dxDrawText(tostring (health).."%",(470/1024)*sWidth, (680/768)*sHeight, (20/1024)*sWidth, (50/768)*sHeight, tocolor(255,255,255,255), (sWidth/1024)*0.75, newFont3,"left","top",false,false,false) dxDrawImage((430/1024)*sWidth, (675/768)*sHeight, (30/1024)*sWidth, (50/768)*sHeight, "outras/wrench.png",0,0,0,tocolor(255,255,255,255)) end end addEventHandler("onClientVehicleEnter", getRootElement(), function(thePlayer) if thePlayer == getLocalPlayer() then addEventHandler("onClientRender", getRootElement(), carhud) end end ) addEventHandler("onClientVehicleStartExit", getRootElement(), function(thePlayer) if thePlayer == getLocalPlayer() then removeEventHandler("onClientRender", getRootElement(), carhud) end end )
  16. i won't it output in the defualt mta chat and that scripts is support system did you understand me @KariiiM
  17. already i checked it Look at this ss : what i have to do ?? i know how to get text from the editbox ...... ect and but how to make dxtext moving up i hope that you understand me
  18. Some one explain to me how to make a chatbox dx ?
  19. thx for cameratarget but i know engineImportTXD engineLoadDFF but how to make player chose what he want use the skin and the defult one's
  20. Hello Guys , i'm making mta csgo project i want ask some Question 1-is there way to make mods skins ? (i mean i want the default weapon skins and the new mods skins the player can choose what he want use ) 2- how change camera like csgo 3-there a way to make replay killer ? (when player kill some one and the other want watch how he killed him (you know what i mean guys )) Note: I won't code or something -.- i need just what i have to use Functions/Events
  21. Thanks Guys
  22. how to i can make system in the login panel or something idk i want player can make 2 account the max of accounts the player can make only 2 how i can do it ?
  23. post code
  24. i'm using modloader how i can replace it ?
  25. Best-Killer

    marker

    guys there is a way to change marker mod ?
×
×
  • Create New...