Jump to content

UAEpro

Retired Staff
  • Posts

    524
  • Joined

  • Last visited

Everything posted by UAEpro

  1. download another one ^-^
  2. UAEpro

    Again Help

    search in https://community.multitheftauto.com/index.php?p=resources
  3. it's not easy can you fix it ? Serial = getPlayerSerial local _tops = {} query = mysql_query(connect_mysql,"SELECT DISTINCT * FROM `"..tableName.."` ORDER BY `"..tableName.."`.`Money` ASC ") if query then while true do local row = mysql_fetch_assoc( query ) if not row then mysql_query(connect_mysql, "INSERT INTO `"..tableName.."`(name, Money, Date, Serial, CTag) VALUES('"..name.."', '"..Money.."', '"..Date.."', '"..Serial.."','".. CTag.."')") break end if row.Serial then if row.Serial == Serial then if row.Money then if tonumber(row.Money) >= tonumber(Money) then query2 = mysql_query(connect_mysql, "DELETE FROM `"..tableName.."` WHERE `Serial` = '"..Serial.."'") if (not query2) then outputDebugString("Error executing the query: (" .. mysql_errno(connect_mysql) .. ") " .. mysql_error(connect_mysql)) end query = mysql_query(connect_mysql, "INSERT INTO `"..tableName.."`(name, Money, Date, Serial, CTag) VALUES('"..name.."', '"..Money.."', '"..Date.."', '"..Serial.."','".. CTag.."')") else outputChatBox("sorry your Money is worse") end end end else query3 = mysql_query(connect_mysql, "INSERT INTO `"..tableName.."`(name, Money, Date, Serial, CTag) VALUES('"..name.."', '"..Money.."', '"..Date.."', '"..Serial.."','".. CTag.."')") if not query3 then outputDebugString("Error executing the query: (" .. mysql_errno(connect_mysql) .. ") " .. mysql_error(connect_mysql)) end end table.insert( _tops, { Money = row.Money; name = row.name; CTag = row.CTag; } ) end mysql_free_result( query ) i know it's spaghetti
  4. wiki addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function() button = guiCreateButton(20, 200, 150, 30, "Test", false) end ) addCommandHandler("togglebtn", function() local currentState = guiGetProperty(button, "Disabled") if currentState == "False" then guiSetProperty(button, "Disabled", "True") else guiSetProperty(button, "Disabled", "False") end end
  5. if i get the values the table look like this _myTable[1].name = "UAEpro" _myTable[1].serial = "ABC" _myTable[2].name = "UAEpro3" _myTable[2].serial = "ABC" _myTable[3].name = "someoneelse" _myTable[3].serail = "BAC"
  6. my table look like this _top, { name = row.name; Money = row.Money; CTag = row.CTag; Serial = row.Serial; }
  7. function tableUnique(tab, field) local _tempTab = tab for i = 1, #tab do local index = tableSearch(tab, field, tab[i][field]) if(index ~= false or index ~= nil and index ~= i)then table.remove(_tempTab, i) end end return _tempTab end function tableSearch(tab, field, value) for i = 1, #tab do if(tab[i][field] == value)then return i end end return false end line 4 = attempt to index field '?' (a nil value)
  8. hello for example i got a table record player action ------------------------------------------------------------- player name ------------- serial ---------------- action ------------------------------------------------------------- --UAEpro-----------------ABCD-----------------Send Money ---UAEpro2--------------ABCD-----------------got hunter --someoneelse---------BASDF-----------------Send Money ok i want to remove the duplicated serial i mean i want to be in the table different serials so if player has more then action in differents names he will show only 1 per serial Solved by MySQL Experts SELECT * FROM ( select * from `my_table` order by timestamp desc ) as my_table_tmp group by catid order by nid desc
  9. oh my mistake [lua] _top= {} function() table.insert(_top,{row.name,row.Money,row.point}) end insert is a nil
  10. edit if i want to insert the value into a table table.insert(_top,{row.name,row.Money.row.point}) row is a nil value
  11. i tried that ... table expected, got userdata
  12. hello if i got a table contain 3 rows for example playername-----Money-----points UAEpro---------109999-----3124 SoildSnake-------2313-------23 etscfsd----------1234---------43 and i want to get all this value and put it into a gui window how i can get the values ?
  13. UAEpro

    setElementData

    the problem is not from the value or outputchatbox .. i put outputchatbox to know what is the element i just care about (( if gotexp2 == 1 then )) it's always 1 even when i change the value in onMapStarting
  14. UAEpro

    setElementData

    1st getElementData(source,"exp212") must be nill it will say sorry in the chatbox then the value will be 1 so it will not say sorry again until another map start but it's not working
  15. function rankk() local gotexp2 = getElementData(source,"exp212") if gotexp2 == 1 then outputChatBox(gotexp2) outputChatBox("*sorry",source,0,255,0,true) else outputChatBox("ok",source,0,255,0,true) setElementData(source,"exp212",1) end end addEventHandler("onPlayerWasted",getRootElement(),rankk) function new() setElementData(source,"exp212",0) alvw = getElementData(source,"exp212") outputChatBox(""..alvw) end addEvent("onMapStarting",true) addEventHandler("onMapStarting",getRootElement(),new) it always show "sorry" idk why another stupid problem
  16. nvm i didn't now what i did ... but it's worked now sometime i became stupid
  17. what's wrong with this.. i don't know why it's not working addEventHandler("onPlayerSpawn",getRootElement(), function() local account = getPlayerAccount (source) local car1 = getAccountData ( account, "car1" ) local car2 = getAccountData ( account, "car2" ) local car3 = getAccountData ( account, "car3" ) local PVeh= getPlayerOccupiedVehicle (source) if ( PVeh ) then if car1 then outputChatBox("car1") setVehicleColor ( PVeh, car1, car2, car3, 0) else outputChatBox("ELSE") setVehicleColor(PVeh, 3, 3, 3, 3) setVehicleHeadLightColor(PVeh, 255, 0, 0) end end end) nothing show ... not car1 and not ELSE if i remove ( " if ( PVeh ) then " ) everything is ok except setVehicleColor
  18. only the leader can access this menu (or someone with Admin level)
  19. i found the picture in the internet
×
×
  • Create New...