Jump to content

Walid

Members
  • Posts

    1,491
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Walid

  1. You want to remove the Whole string or just the (lowercase or uppercase) letters.
  2. I told you need to use aclReload() because refresh can't reload your ACL.xml file. Example function reload (player, command ) local reloadAcl = aclReload() if ( reloadAcl ) then outputChatBox ( "ACL was successfully reloaded.", player, 255, 0, 0 ) end end addCommandHandler ( "reload", reload )
  3. You can use sth like this string.match(Text here, patterns) patterns %l --- all lowercase letters. %u --- all uppercase letters.
  4. You don't need to stop the server just use aclReload ()
  5. ?? try explain your problem better
  6. Walid

    os.date ?

    You can use sth like this string.format ( "%02d:%02d:%02d", RealTime.hour, RealTime.minute, RealTime.second )
  7. Walid

    os.date ?

    use getRealTime ( ) Example function Date ( ) local RealTime = getRealTime ( ) return string.format ( "%04d/%02d/%02d", RealTime.year + 1900, RealTime.month + 1, RealTime.monthday ), end
  8. Walid

    customblips

    it's client side i already tried it and it's working fine.
  9. Walid

    customblips

    Try to use my code
  10. Maybe i will add an other TUT. thx.
  11. acc it's not defined in your code. Ayways try this it should work addCommandHandler("rechargemp", function (player, cmd, torecharge, ammount) local target = getPlayerFromPartialName( torecharge ) local account = getPlayerAccount ( player ) if (isElement(target)) then local acc = getPlayerAccount(target) if isObjectInACLGroup ( "user."..getAccountName(account), aclGetGroup ( "Admin" ) ) then outputChatBox("You give "..ammount.." to "..torecharge.."") setAccountData( acc, "medalloPoints", tonumber(ammount)) setElementData( target, "medalloPoints", tonumber(ammount)) else outputChatBox("You are not admin",player,255,255,0) end else outputChatBox("This player does no longer exist!",player,255,255,0) end end ) function getPlayerFromPartialName(name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end end end
  12. try to use the The LIMIT keyword like this local check = dbPoll(dbQuery(connection, "SELECT * FROM YourTableName WHERE ExampleGangName =' ?' LIMIT 1" ,tostring(groupByName)), -1) The LIMIT keyword in a SQL query let you specify how much rows you want to get at most.
  13. yep it should be like this local check = dbPoll(dbQuery(connection, "SELECT * FROM YourTableName WHERE ExampleGangName = ?",tostring(groupByName)), -1) if type(check) == "table" and #check == 0 or not check then dbExec(connection, "INSERT INTO YourTableName VALUES (?)",tostring(groupByName)) end
  14. First of all You need to create the table like this Example on resource start function YourFunction() dbExec(connection, "CREATE TABLE IF NOT EXISTS YourTableName (column1 TEXT, column2 TEXT, etc .....)") end addEventHandler("onResourceStart", resourceRoot, YourFunction)
  15. if you don't know nothing about db functions i recommend you to read this dbConnect dbExec dbQuery dbPoll dbFree
  16. "(" missing here function Guest2 () an other one ")" missing. here end) BTW many things wrong in your code.
  17. Use dbExec instead of dbQuery
  18. Walid

    customblips

    Try this local BlipsTable = { [1]={2290.2392578125, 2430.31640625, "img/iconlvpd.png" } [2]={2474.3134765625, 1024.2529296875, "img/iconbank.png" } [3]={2322.4189453125, 549.408203125, "img/iconbencang.png" } [4]={1072.3876953125, 2310.4091796875, "img/iconrrr.png" } [5]={21044.53125, 1015.2919921875, "img/iconthuvien.png" } [6]={1675.0947265625, 1447.7275390625, "img/iconsanbay.png" } [7]={2462.111328125, 2243.763671875 ,"img/iconjobphongvien.png" } [8]={1756.859375, 2077.61328125, "img/iconsocuuhoa.png" } [9]={2330.890625, 2165.7734375, "img/iconcasino.png" } } for i=1,#BlipsTable do local x, y , pic = BlipsTable[i][1], BlipsTable[i][2],BlipsTable[i][3] local Blips = exports.customblips:createCustomBlip ( x, y, 16, 16,pic, 100 ) exports.customblips:setCustomBlipRadarScale(Blips, 1) end
×
×
  • Create New...