Jump to content

Walid

Members
  • Posts

    1,491
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Walid

  1. Read this EGYPT and MTA
  2. try sth like this local query = dbQuery(database, "SELECT * FROM houselist" ) local result, numrows = dbPoll(query, -1) if (result and numrows > 0) then for index, row in pairs(result) do local id = row['id'] local houseName = row['houseName'] local houseOwner = row['houseOwner'] -- bla bla bla -- You code here end end
  3. Try to use this make sure to add ID column into your db. function getFreeID() local result = dbPoll(dbQuery(con, "SELECT ID FROM houselist ORDER BY ID ASC"), -1) newID = false for i, id in pairs (result) do if id["ID"] ~= i then newID = i break end end if newID then return newID else return #result + 1 end end
  4. Try this addEventHandler ( "onClientGUIMove", getRootElement(), function() if not isDragging then isDragging = true; end end ); The important thing I mentioned in my first post is putting d into the 'Options' box. This will show which file/line number/function is using the most CPU.
  5. You can use the Web interface to view the Lua Timing on clients (check Incl Clients at the top) Enter d into the options box, and you can see which functions are using most CPU.
  6. I think you should see this : [Preview | Development] Debug Console it's already created by Necktrox.
  7. Walid

    سوال

    outputChatBox(getPlayerName(source).." Your text here "..getPlayerName(player),root,255,0,0)
  8. ??? i already gave you the solution function clickingClothesShop(button,state) if button == "left" and state == "up" then if(source == ClothesShopGuiGridlist) then local row, col = guiGridListGetSelectedItem(ClothesShopGuiGridlist) if ( row and col and row ~= -1 and col ~= -1 ) then local itemName = guiGridListGetItemText(ClothesShopGuiGridlist, row, col ) if itemName == "bla bla" then -- put your code here elseif itemName == "bla bla2" then -- put your code here end end end end end
  9. all what you need is : guiStaticImageLoadImage() so it must be like this : function clickingClothesShop(button,state) if button == "left" and state == "up" then if(source == ClothesShopGuiGridlist) then local row, col = guiGridListGetSelectedItem(ClothesShopGuiGridlist) if ( row and col and row ~= -1 and col ~= -1 ) then local itemName = guiGridListGetItemText(ClothesShopGuiGridlist, row, col ) guiStaticImageLoadImage(pictureGui,"path/"..itemName..".png") end end end end
  10. what are talking about , try to explain your problem better or post some SS.
  11. all what you need is : -- Function getElementData() setElementData() getAccountData() setAccountData() -- Events onPlayerQuit onPlayerLogin
  12. Make sure that you add this in your meta.xml file <file src="files/bump.txd" /> <file src="files/bump.dff"/> <file src="files/bump.col" />
  13. try this function clickingClothesShop(button,state) if button == "left" and state == "up" then if(source == ClothesShopGuiGridlist) then local row, col = guiGridListGetSelectedItem(ClothesShopGuiGridlist) if ( row and col and row ~= -1 and col ~= -1 ) then local itemName = guiGridListGetItemText(ClothesShopGuiGridlist, row, col ) outputChatBox("Item name: "..itemName,255,255,0) end end end end
  14. [quote name=..&G:..]Works perfectly now, thanks You are welcome
  15. Lol hhhh :fp: , as i can see he said i'm using downloadFile so he can use onClientFileDownloadComplete() event to check if the file has been saccessfully downloaded or not.
  16. try this local year = timeDate.year + 1900 local month = timeDate.month + 1
  17. Try this function PedirReforco(thePlayer) if thePlayer and isElement(thePlayer) then local x, y, z = getElementPosition(thePlayer) local location = getZoneName ( x, y, z ) for index, players in pairs(getElementsByType("player")) do local accName = getAccountName (getPlayerAccount (players)) if isObjectInACLGroup ("user."..accName, aclGetGroup ("ComandosPolicia")) then local NickChamador = getPlayerName(players) local sx, sy, sz = getElementPosition(players) local dist = getDistanceBetweenPoints3D(x, y, z, sx, sy, sz) outputChatBox ("#000000[#ff0000POLICIA#000000] #c1c1c1O jogador "..NickChamador.." pediu reforços mais proximo de "..location.." a "..math.floor(dist).." Km/H.", players, 255, 255, 255, true) end end end end addCommandHandler("reforço", PedirReforco)
  18. Sorry i don't undrestand what you want exactly.
  19. replace nick1 to nick here before outputChatBox ("#000000[#ff0000POLICIA#000000] #c1c1c1O jogador "..NickChamador.." pediu reforços mais proximo de "..location.." a "..math.floor(dist).." Km/H.", nick1, 255, 255, 255, true) after outputChatBox ("#000000[#ff0000POLICIA#000000] #c1c1c1O jogador "..NickChamador.." pediu reforços mais proximo de "..location.." a "..math.floor(dist).." Km/H.", nick, 255, 255, 255, true)
  20. do you want sth like this local x, y = guiGetScreenSize() function PlayerNameTags() local players = getElementsByType("player") for k,v in ipairs(players) do if v == getLocalPlayer() then else local r = getElementData(v,"red") local g = getElementData(v,"green") local b = getElementData(v,"blue") local aduty = getElementData(v, "adminduty") local x1,y1,z1 = getElementPosition (getLocalPlayer()) local x2,y2,z2 = getElementPosition (v) local visibleto = getDistanceBetweenPoints3D(x1,y1,z1,x2,y2,z2) if visibleto > 350 then else local sx,sy = getScreenFromWorldPosition ( x2,y2,z2+1.05 ) if not sx and not sy then else dxDrawText (aduty, sx,sy,sx,sy, tocolor(r,g,b,255), 8-visibleto/50, "default-bold", "center","top",false,false,false ) end end end end end addEventHandler("onClientRender",getRootElement(),PlayerNameTags)
  21. it's Client side so you need to replace source with localPlayer.
  22. Walid

    Teams

    getPlayerTeam : This function gets the current team a player is on. getTeamName : This function gets the team name of a team object. so all what you need is local team = getPlayerTeam(source) if (team) then local teamName = getTeamName(team) if (teamName == "Astronaut") then -- your code here end end
×
×
  • Create New...