Jump to content

Rockyz

Members
  • Posts

    1,862
  • Joined

  • Days Won

    8

Everything posted by Rockyz

  1. بالتوفيق بس عندي سؤال, ليه ترفع الموضوع وهو اول واحد اصلا
  2. Rockyz

    Lua f*k sh*t

    local countCheckpoint = (getElementData(player, "countCheckpoitBusRoad") or 0) +1
  3. لازم تطرح اكوادك كامل ولا ماقدر اشوف مشكلة thePoints
  4. اطرح اكوادك كامل ..
  5. الخطأ من thePoints مو معرف
  6. addEventHandler('onClientGUIClick', root, function() if source == aircar then if thePoints >= 100000 then triggerServerEvent ('car', getLocalPlayer(source), 'car') setWorldSpecialPropertyEnabled('aircars', true) else outputChatBox('[6rB Time] لاتملك نقاط المسابقات الكافية', 255, 0, 0, true) end end end)
  7. هذا الخطأ الأول ولا الثاني ؟
  8. الخطأ الأول يعني انك قاعد تقارن شيء بدون قيمة مع رقم الخطأ الثاني انت حاط شي زيادة او غلط اطرح سطر الخطأ الثاني ..
  9. executeSQLQuery('CREATE TABLE IF NOT EXISTS saveText (playerText TEXT, playerSerial TEXT)') addCommandHandler('mytext', function(player, cmd, ...) local text = table.concat({...}, ' '); if text:gsub('%s', '') ~= '' then outputChatBox(''..text..' : تم وضع كلمة الترحيب الخاصة بك وهي', player, 255, 0, 0, true) local theText = executeSQLQuery('SELECT * FROM saveText WHERE playerSerial = ?', getPlayerSerial(player)) if #theText > 0 then executeSQLQuery('UPDATE saveText SET playerText=? WHERE playerSerial=?', text, getPlayerSerial(player)) else executeSQLQuery('INSERT INTO saveText (playerText, playerSerial) VALUES(?, ?)', text, getPlayerSerial(player)) end end end) addEventHandler('onPlayerJoin', root, function() local text = executeSQLQuery('SELECT * FROM saveText WHERE playerSerial = ?', getPlayerSerial(source)) if #text > 0 then outputChatBox(text[1].playerText..' : كلمة الترحيب', root, 255, 0, 0, true) end end)
  10. Rockyz

    The last reply

    Hai! I was bored and I made this topic for reply and reply and reply and reply... The last who reply this topic will win. Win what? I really don't care about prices I just wanna enjoy the time . On this topic, you also can reply with no-sense posts, like "hvidfhgvhdbcudfguvge" or... "TROLOLOL". Just reply something . Okay! I'll start, how I guess, I will not be the last who reply that topic hehe.
  11. @N3xT كنت تقدر تختصر كذا : addCommandHandler('samshop511106', function() local visible = not guiGetVisible(GUIEditor.window[1]) guiSetVisible(GUIEditor.window[1], visible) showCursor(visible) end);
  12. كنت تقدر تختصر الجدول حقك كذا : for i = 411, 611 do
  13. هذا الي تبيه ؟
  14. local delayTable = {}; local chatDelay = 5 function clearChat(player) local accountname = getAccountName(getPlayerAccount(player)) if hasObjectPermissionTo(player, 'command.mute', true) then if getTickCount()-(delayTable[player] or 0)>chatDelay*1000 then outputChatBox(' ') outputChatBox(getPlayerName(player) .. '#ffffff قام بمسح الشات', root, 0, 255, 255, true) delayTable[player] = getTickCount() else outputChatBox('Please wait '..math.floor((chatDelay*1000-(getTickCount()-delayTable[player]))/1000)..' Seconds', player, 255, 0, 0, true) end end end addCommandHandler('Clear', clearChat)
  15. غير السورس كود لـ: guiEnable = {}; local types = {['second']=1000, ['minute']=1000*60, ['hour']=1000*60*60, ['ms']=1}; addEvent('onClientGUIDelayStart', true); addEvent('onClientGUIDelayEnd', true); function guiSetDelay(gui, delay) assert(getElementType(gui):find('gui-'), 'bad argument guiSetDelay @1 gui-element expected got '..(isElement(gui) and getElementType(gui) or type(gui))) assert(type(delay)=='table', 'bad argument guiSetDelay @2 table expected got '..type(delay)) local canContinue for key in pairs(types) do if delay[key] then canContinue = true; break end end if canContinue then guiSetEnabled(gui, false); guiEnable[gui] = {oldString = guiGetText(gui), element = gui} local ms = 0; for key, value in pairs(delay) do if types[key] then ms=ms+(types[key]*value) end end guiEnable[gui].timer = setTimer(function() guiSetEnabled(gui, true) if isTimer(guiEnable[gui].timer) then killTimer(guiEnable[gui].timer);guiSetText(gui,guiEnable[gui].oldString);guiEnable[gui]=nil;end; triggerEvent('onClientGUIDelayEnd', guiEnable[gui].element) local newTable = {}; for _, value in pairs(guiEnable) do table.insert(newTable, value) end if #newTable == 0 and isTimer(timerCheck) then killTimer(timerCheck) end end, ms, 1) if guiEnable[gui].timer then timer() if not isTimer(timerCheck) then timerCheck = setTimer(timer, 1000, 0);end; setTimer(function() local details = getTimerDetails(guiEnable[gui].timer);guiSetText(guiEnable[gui].element, msToString(details)); end, 50, 1) triggerEvent('onClientGUIDelayStart', guiEnable[gui].element) end end end function timer() for _, value in pairs(guiEnable) do if isTimer(value.timer) then local details = getTimerDetails(value.timer);guiSetText(value.element, msToString(details)); end end end function msToString(ms) if ms and type(ms)=='number' then local second = (ms and (ms>=1000 and ms) or 1000)/1000 local minute = second/60 return ('%02d:%02d:%02d'):format(math.floor(minute/24), math.floor(minute%60), math.floor(second%60)) end return false end اذا تبي تضيف شي عندما يبدء المؤقت addEventHandler('onClientGUIDelayStart', resourceRoot, function() --Your code end) واذا تبي تضيف شي عندما ينتهي المؤقت addEventHandler('onClientGUIDelayEnd', resourceRoot, function() --Your code end)
  16. سويت لك فنكشن مفيد يساعدك guiEnable = {}; local types = {['second']=1000, ['minute']=1000*60, ['hour']=1000*60*60, ['ms']=1}; function guiSetDelay(gui, delay) assert(getElementType(gui):find('gui-'), 'bad argument guiSetDelay @1 gui-element expected got '..(isElement(gui) and getElementType(gui) or type(gui))) assert(type(delay)=='table', 'bad argument guiSetDelay @2 table expected got '..type(delay)) local canContinue for key in pairs(types) do if delay[key] then canContinue = true; break end end if canContinue then guiSetEnabled(gui, false); guiEnable[gui] = {oldString = guiGetText(gui), element = gui} local ms = 0; for key, value in pairs(delay) do if types[key] then ms=ms+(types[key]*value) end end guiEnable[gui].timer = setTimer(function() guiSetEnabled(gui, true) if isTimer(guiEnable[gui].timer) then killTimer(guiEnable[gui].timer);guiSetText(gui,guiEnable[gui].oldString);guiEnable[gui]=nil;end; local newTable = {}; for _, value in pairs(guiEnable) do table.insert(newTable, value) end if #newTable == 0 and isTimer(timerCheck) then killTimer(timerCheck) end end, ms, 1) timer(true) if not isTimer(timerCheck) then timerCheck = setTimer(timer, 1000, 0);end; setTimer(function() local details = getTimerDetails(guiEnable[gui].timer);guiSetText(guiEnable[gui].element, msToString(details)); end, 50, 1) end end function timer(b) for _, value in pairs(guiEnable) do if isTimer(value.timer) then local details = getTimerDetails(value.timer);guiSetText(value.element, msToString(details)); end end end function msToString(ms) if ms and type(ms)=='number' then local second = (ms and (ms>=1000 and ms) or 1000)/1000 local minute = second/60 return ('%02d:%02d:%02d'):format(math.floor(minute/24), math.floor(minute%60), math.floor(second%60)) end return false end كودك يصير كذا : elseif ( source == btn.mp5 ) then guiSetDelay(source, {ms = 300000}) playSound("open.wav") triggerServerEvent('giveWeapon_', localPlayer , 0 , 29, 1000 , "MP5" )
  17. -- server setTimer(function() TopTime = {} for _, player in ipairs(getElementsByType('player')) do table.insert(TopTime, {name = getPlayerName(player), time = {timeString = getElementData(player, 'PlayTime'), realTime = stringTime(getElementData(player, 'PlayTime'))}}) end table.sort(TopTime, function(a, b) return(tonumber(a.time['realTime']) or 0)>(tonumber(b.time['realTime']) or 0) end) triggerClientEvent(root, 'getTopTime', root, TopTime) end, 1000, 0) -- client addEvent('getTopTime', true) addEventHandler('getTopTime', root, function(TopTime) guiGridListClear(gridlistTime) for k, v in ipairs(TopTime) do local row = guiGridListAddRow(gridlistTime) guiGridListSetItemText(gridlistTime, row , 1 , k .. '-' , false , false) guiGridListSetItemColor(gridlistTime , row , 1 , 255,255,0) guiGridListSetItemText(gridlistTime,row,2,TopTime[k].name:gsub('#%x%x%x%x%x%x',''),false,false) guiGridListSetItemColor(gridlistTime , row , 2 , 255,255,0) guiGridListSetItemText(gridlistTime,row,3,TopTime[k].time['timeString'],false,false) guiGridListSetItemColor(gridlistTime , row , 3 , 255,255,0) end end) function stringTime(v) local v = split(tostring(v),(':'):byte()); return tonumber(v[1]..v[2]..v[3]) end
  18. --SERVER SIDE: function serial( ) if eventName == 'onResourceStart' then for k, v in ipairs(getElementsByType('player')) do setElementData(v, 'serial', getPlayerSerial(v)) end else setElementData(source, 'serial', getPlayerSerial(source)) end end addEventHandler('onResourceStart', resourceRoot, serial) addEventHandler('onPlayerJoin', root, serial) --CLIENT SIDE nonshowing = { ['my Serial'] = true, } function SetPlayersInGD(grid) if grid then if getElementType(grid) == 'gui-gridlist' then if guiGridListClear(grid) then for _, player in ipairs(getElementsByType('player')) do if not nonshowing[getPlayerSerial(player)] then local row = guiGridListAddRow(grid) guiGridListSetItemText(grid, row, 1, getPlayerName(player), false, false ) guiGridListSetItemText(grid, row, 2, getPlayerTime(player), false, false ) guiGridListSetItemColor(grid, 0, 1, 255, 0, 0, 255, true, false) guiGridListSetItemColor(grid, 0, 2, 0, 255, 0, 255, true, false) end end end end end end _getSerial = getPlayerSerial function getPlayerSerial(p) return (isElement(p) and getElementType(p) == 'player') and getElementData(p, 'serial') or _getSerial() end
  19. Rockyz

    a question

    What are you trying to do ?
×
×
  • Create New...