Jump to content

TAPL

Retired Staff
  • Posts

    7,337
  • Joined

  • Days Won

    11

Everything posted by TAPL

  1. getPlayerWantedLevel setPlayerWantedLevel getPlayerTeam getTeamFromName cancelEvent Event: "onClientPlayerDamage" Event: "onPlayerDamage" Event: "onPlayerWasted"
  2. You're welcome.
  3. جرب --[[ ]] exports.scoreboard:addScoreboardColumn('Online Time') local t = { } function checkValues( source,arg1,arg2) if (arg2 >= 60) then t[ source ][ 'min' ] = tonumber( t[ source ][ 'min' ] or 0 ) + 1 t[ source ][ 'sec' ] = 0 end if (arg1 >= 60) then t[ source ][ 'min' ] = 0 t[ source ][ 'hour' ] = tonumber( t[ source ][ 'hour' ] or 0 ) + 1 end return arg1, arg2 end setTimer( function( ) for _, v in pairs( getElementsByType( "player" ) ) do if (not t[ v ]) then t[ v ] = { ["hour"] = 0, ["min"] = 0, ["sec"] = 0 } end t[ v ][ 'sec' ] = tonumber( t[ v ][ 'sec' ] or 0 ) + 1 local min,sec = checkValues ( v, t[ v ][ 'min' ] or 0, t[ v ][ 'sec' ] or 0 ) local hour = tonumber( t[ v ][ 'hour' ] or 0 ) setElementData( v, "Online Time", tostring( hour )..':'..tostring( min )..':'..tostring( sec ) ) end end, 1000, 0 ) function onPlayerQuit ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then setAccountData ( playeraccount, "T-Secs", t[ source ][ 'sec' ] or 0 ) setAccountData ( playeraccount, "T-Mins", t[ source ][ 'min' ] or 0 ) setAccountData ( playeraccount, "T-Hours", t[ source ][ 'hour' ] or 0 ) end t[ source ] = nil end addEventHandler ( "onPlayerQuit", root, onPlayerQuit ) function onPlayerLogin (_, playeraccount ) if ( playeraccount ) then local Secs = getAccountData ( playeraccount, "T-Secs" ) local Mins = getAccountData ( playeraccount, "T-Mins" ) local Hours = getAccountData ( playeraccount, "T-Hours" ) if ( Secs and Mins and Hours ) then t[ source ] = { ["sec"] = Secs, ["min"] = Mins, ["hour"] = Hours } end end end addEventHandler ( "onPlayerLogin", root, onPlayerLogin ) addCommandHandler("gv", function (player,cmd,PlayerName,Time) if PlayerName and Time then local thePlayer = getPlayerFromName(PlayerName) if isElement(thePlayer) then if tonumber(Time) then local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "mbrmg" ) ) then t[thePlayer]["hour"] = tonumber(Time) outputChatBox("#fff000.:[#00ff00 * You Have Successfully Give #ff0000" .. getPlayerName(thePlayer) .. "#00ff00 [ " .. Time .. " hours ] #fff000]:.",player,0,255,0, true) outputChatBox("#fff000.:[ * #ff0000" .. getPlayerName(player) .. " #00ff00 Has Successfully Give You #ff0000 [ " .. Time .. " hours ] #fff000]:.", thePlayer, 0, 255, 0, true) else outputChatBox("#fff000.:[ #ff0000You Are Not #00ff00 Admin #ff0000 Group #fff000]:.", player, 255, 0, 0, true) end else outputChatBox("#fff000.:[ #ff0000* Error in Time #fff000]:.",player,255,0,0, true) end else outputChatBox("#fff000.:[ #FF0000* Player Not Found #fff000]:.",player,255,0,0, true) end else outputChatBox("#fff000.:[ #ff0000* give #fff000]:.",player,255,0,0, true) end end ) ---------------------------------------------------------------------------------------- addCommandHandler("all", function (player,cmd,Time) if tonumber(Time) then local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "mbrmg" ) ) then outputChatBox("#fff000.:[ #ff0000[ " .. getPlayerName(player) .. " ]#00ff00 Has Give All The Players #ff0000 [ " .. Time .. " hours ] #fff000]:.", root,0,255,0, true) for k, v in ipairs (getElementsByType("player")) do t[ v ][ "hour" ] = tonumber( t[ v ][ "hour" ] or 0 ) + Time end else outputChatBox("#fff000.:[ #ff0000You Are Not in #00ff00mbrmg#ff0000 Group #fff000]:.", player, 255, 0, 0, true) end end end )
  4. TAPL

    HELP!!

    For replace txd or dff we use model id and not weapon id, so 30 won't work you need the model id and this can be found on the wiki. https://wiki.multitheftauto.com/wiki/Weapons Model ID for AK-47 is 355.
  5. خطأ اول شي تعلم الأساسيات hitElement هذا من وين جبته؟ + في الكلينت ما يحتاج ارقمنت لاعب toggleControl الفنكشن و هنا بالسطر ذا ما سويت اي شرط يعني الكود ماله اي معنى isElementWithinColShape ( hitElement, cols ) شوف المثال في الويكي هذا يقفل التصويب إذا كان السلاح ميناقن https://wiki.multitheftauto.com/wiki/On ... aponSwitch
  6. هذا سيرفر addCommandHandler("FOX", function(player) setElementPosition(player, 4236.60205, -1831.47852, 1.31225) end) و هذا كلينت addCommandHandler("FOX", function() setElementPosition(localPlayer, 4236.60205, -1831.47852, 1.31225) end) اختار الي يعجبك
  7. local player = getLocalPlayer() addEventHandler("onClientResourceStart", resourceRoot, function() local sW, sH = guiGetScreenSize() wdwList = guiCreateWindow((sW-830)/2, (sH-538)/2, 830, 538, "Spawn List", false) guiWindowSetSizable(wdwList, false) guiWindowSetMovable(wdwList, false) glistMainList = guiCreateGridList((830-711)/2, (538-441)/2, 711, 441, false, wdwList) guiGridListAddColumn(glistMainList, "Spawn Points", 0.9) btnSpawn = guiCreateButton((830-264)/2, (538-35), 264, 35, "Spawn", false, wdwList) addEventHandler("onClientGUIClick", btnSpawn, spawnHandler, false) makeList() showCursor(true, true) end ) function showWindow() if not guiGetVisible(wdwList) then guiSetVisible(wdwList, true) showCursor(true, true) end end addEvent("showWindow", true) addEventHandler("showWindow", player, showWindow) function hideSpawnList() guiSetVisible(wdwList, false) showCursor(false, false) end addEvent("hideWindow", true) addEventHandler("hideWindow", player, hideSpawnList) function makeList() local file = xmlLoadFile("spawnpoints.xml") if file then for _, spawns in ipairs (xmlNodeGetChildren(file)) do local row = guiGridListAddRow(glistMainList) local name = xmlNodeGetAttribute(spawns, "name") local x = xmlNodeGetAttribute(spawns, "x") local y = xmlNodeGetAttribute(spawns, "y") local z = xmlNodeGetAttribute(spawns, "z") local rot = xmlNodeGetAttribute(spawns, "rot") guiGridListSetItemText(glistMainList, row, 1, name, false, false) guiGridListSetItemData(glistMainList, row, 1, {x, y, z, rot}) end xmlUnloadFile(file) end end function spawnHandler(button, state) if button == "left" and state == "up" then local row, col = guiGridListGetSelectedItem(glistMainList) local data = guiGridListGetItemData(glistMainList, row, col) if row and col and row ~= -1 and col ~=-1 then local x, y, z, rot = unpack(data) local skin = getElementModel(player) triggerServerEvent("spawnPlayer", player, x, y, z, rot, skin) end end end addCommandHandler("respawn", showWindow) function startSpawn(x, y, z, rot, skin) spawnPlayer(source, x, y, z, rot, skin) fadeCamera(source, true) setCameraTarget(source) triggerClientEvent(source, "hideWindow", source) outputChatBox("If you wish to change your skin use /skin", source, 255, 0, 0) end addEvent("spawnPlayer", true) addEventHandler("spawnPlayer", root, startSpawn) addEventHandler("onPlayerWasted", root, function() triggerClientEvent(source, "showWindow", source) end )
  8. I can't see where is the turf positions and color and these info been inserted into the database.
  9. تقريباً ذي الفنكشات addCommandHandler getElementPosition createMarker Event: "onMarkerHit" table triggerClientEvent guiCreateWindow guiCreateButton guiSetVisible Event: "onClientGUIClick" triggerServerEvent getPlayerMoney givePlayerMoney takePlayerMoney destroyElement
  10. المفروض ان بطاقات كاش يو موجوده في باكستان
  11. Server Side: addEventHandler("onPlayerLogin", root, function(_, acc) local accSerial = getAccountData(acc, "ASerial") local pSerial = getPlayerSerial(source) if accSerial then if accSerial ~= pSerial then kickPlayer(source, "هنا سبب الكيك") end else setAccountData(acc, "ASerial", pSerial) end end) ولا تنسى تضيف المود بقروب ادمن عشان فنكشن الكيك يحتاج صلاحيات
  12. Have you used the command correctly? /s clothesType /s [0-17]
  13. getSerials = function() local Row = executeSQLQuery("SELECT * FROM blacklist_new") if (type(Row) == "table" and #Row == 0) or not Row then return {} else return Row end end isSerialInBlack = function(serial) local Row = executeSQLQuery("SELECT * FROM blacklist_new WHERE serial = ?", tostring(serial)) if (type(Row) == "table" and #Row == 0) or not Row then return false else return true end end addEventHandler("onResourceStart", resourceRoot, function() executeSQLQuery("CREATE TABLE IF NOT EXISTS blacklist_new (serial,name,reason)") end) addCommandHandler("bl",function(player) if ( isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(player)), aclGetGroup("Console")) ) then triggerClientEvent(player,"show",player) end end) addEvent("getall",true) addEventHandler("getall",root,function() for i,v in ipairs ( getSerials() ) do triggerClientEvent(source,"add",source,v.serial,v.name,v.reason,i) end end) addEvent("addserial",true) addEventHandler("addserial",root,function(serial,name,reason) Row = executeSQLQuery("SELECT * FROM blacklist_new WHERE serial = '"..tostring(serial).."'") if ( #Row == 0 ) then executeSQLQuery("INSERT INTO blacklist_new(serial,name,reason) VALUES('"..tostring(serial).."','"..tostring(name).."','"..tostring(reason).."')") triggerClientEvent(source,"hide",source) else outputChatBox("* This Serial In Black List",source,255,0,0,true) triggerClientEvent(source,"hide",source) end end) addEvent("deleteserial",true) addEventHandler("deleteserial",root,function(serial) executeSQLQuery("DELETE FROM blacklist_new WHERE serial=?", serial) outputChatBox("* This Serial Was Deleted",source,255,0,0,true) triggerClientEvent(source,"hidemain",source) triggerClientEvent(source,"clear",source) end) addEventHandler("onPlayerConnect",root,function(_,_,_,serial) if ( isSerialInBlack(serial) ) then local database = executeSQLQuery ( "SELECT `reason` FROM `blacklist_new` WHERE `serial` =?", serial ) if database[1].reason then cancelEvent(true,"You Are In Black List ("..database[1].reason..").") else cancelEvent(true,"You Are In Black List !") end end end)
  14. Look here: function saveSkin(player,clothesType) As you're using addCommandHandler, the second parameter is the command name, so it should be: function saveSkin(player, cmd, clothesType)
  15. إلا جاب العيد^ شفت كوده بسكايب من الويكي و حطها بكوده Syntax اخذ جرب ذا versionDisplay = textCreateDisplay() versionText = textCreateTextItem("Welcome In Server", 0.195, 0.70, "medium", 8, 255, 255, 255, 1, "right") textDisplayAddText(versionDisplay, versionText) addEventHandler("onResourceStart", resourceRoot, function() for i, player in ipairs(getElementsByType("player")) do textDisplayAddObserver(versionDisplay, player) end end) addEventHandler("onPlayerJoin", root, function() textDisplayAddObserver(versionDisplay, source) end)
  16. Client Side: -- Copyright (c) 2008, Alberto Alonso -- -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without modification, -- are permitted provided that the following conditions are met: -- -- * Redistributions of source code must retain the above copyright notice, this -- list of conditions and the following disclaimer. -- * Redistributions in binary form must reproduce the above copyright notice, this -- list of conditions and the following disclaimer in the documentation and/or other -- materials provided with the distribution. -- * Neither the name of the superman script nor the names of its contributors may be used -- to endorse or promote products derived from this software without specific prior -- written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. local Superman = {} function canceldamage() cancelEvent() end addEventHandler("onClientPedDamage", getRootElement(), canceldamage) -- Settings local ZERO_TOLERANCE = 0.00001 local MAX_ANGLE_SPEED = 6 -- In degrees per frame local MAX_SPEED = 1.0 local EXTRA_SPEED_FACTOR = 1.85 local LOW_SPEED_FACTOR = 0.40 local ACCELERATION = 0.025 local EXTRA_ACCELERATION_FACTOR = 1.8 local LOW_ACCELERATION_FACTOR = 0.85 local TAKEOFF_VELOCITY = 1.75 local TAKEOFF_FLIGHT_DELAY = 750 local SMOKING_SPEED = 1.25 local GROUND_ZERO_TOLERANCE = 0.18 local LANDING_DISTANCE = 3.2 local FLIGHT_ANIMLIB = "swim" local FLIGHT_ANIMATION = "Swim_Dive_Under" local FLIGHT_ANIM_LOOP = false local IDLE_ANIMLIB = "cop_ambient" local IDLE_ANIMATION = "Coplook_loop" local IDLE_ANIM_LOOP = true local MAX_Y_ROTATION = 55 local ROTATION_Y_SPEED = 3.8 -- Static global variables local thisResource = getThisResource() local rootElement = getRootElement() local localPlayer = getLocalPlayer() local serverGravity = getGravity() -- -- Check for admin -- function canFly() return getElementData(localPlayer, "canFly") end -- -- Utility functions -- local function isPlayerFlying(player) local data = getElementData(player, "superman:flying") if not data or data == false then return false else return true end end local function setPlayerFlying(player, state) if state == true then state = true else state = false end setElementData(player, "superman:flying", state) end local function iterateFlyingPlayers() local current = 1 local allPlayers = getElementsByType("player") return function() local player repeat player = allPlayers[current] current = current + 1 until not player or (isPlayerFlying(player) and isElementStreamedIn(player)) return player end end function Superman:restorePlayer(player) setPlayerFlying(player, false) setPedAnimation(player, false) setElementVelocity(player, 0, 0, 0) setElementRotation(player, 0, 0, 0) --setPedRotation(player, getPedRotation(player)) setElementCollisionsEnabled(player, true) self:destroySmokeGenerators(player) self.rotations[player] = nil self.previousVelocity[player] = nil end function Superman:createSmokeGenerator(player) local generator = createObject(2780, getElementPosition(player)) setElementCollisionsEnabled(generator, false) setObjectScale(generator, 0) return generator end function Superman:createSmokeGenerators(player) if not self.smokeGenerators[player] then local smokeGenerators = {} smokeGenerators[1] = self:createSmokeGenerator(player) attachElements(smokeGenerators[1], player, 0.75, -0.2, -0.4, -40, 0, 60) smokeGenerators[2] = self:createSmokeGenerator(player) attachElements(smokeGenerators[2], player, -0.75, -0.2, -0.4, -40, 0, -60) self.smokeGenerators[player] = smokeGenerators end end function Superman:destroySmokeGenerators(player) if self.smokeGenerators[player] then for k, v in ipairs(self.smokeGenerators[player]) do destroyElement(v) end self.smokeGenerators[player] = nil end end function angleDiff(angle1, angle2) angle1, angle2 = angle1 % 360, angle2 % 360 local diff = (angle1 - angle2) % 360 if diff <= 180 then return diff else return -(360 - diff) end end local function isElementInWater(ped) local pedPosition = Vector3D:new(getElementPosition(ped)) if pedPosition.z <= 0 then return true end local waterLevel = getWaterLevel(pedPosition.x, pedPosition.y, pedPosition.z) if not isElementStreamedIn(ped) or not waterLevel or waterLevel < pedPosition.z then return false else return true end end local function isnan(x) math.inf = 1/0 if x == math.inf or x == -math.inf or x ~= x then return true end return false end local function getVector2DAngle(vec) if vec.x == 0 and vec.y == 0 then return 0 end local angle = math.deg(math.atan(vec.x / vec.y)) + 90 if vec.y < 0 then angle = angle + 180 end return angle end -- -- Initialization and shutdown functions -- function Superman.Start() local self = Superman -- Register events addEventHandler("onClientResourceStop", getResourceRootElement(thisResource), Superman.Stop, false) addEventHandler("onPlayerJoin", rootElement, Superman.onJoin) addEventHandler("onPlayerQuit", rootElement, Superman.onQuit) addEventHandler("onClientRender", rootElement, Superman.processControls) addEventHandler("onClientRender", rootElement, Superman.processFlight) addEventHandler("onClientPlayerDamage", localPlayer, Superman.onDamage, false) addEventHandler("onClientElementDataChange", rootElement, Superman.onDataChange) addEventHandler("onClientElementStreamIn", rootElement, Superman.onStreamIn) addEventHandler("onClientElementStreamOut", rootElement, Superman.onStreamOut) -- Bind keys bindKey("jump", "down", Superman.onJump) -- Register commands addCommandHandler("superman", Superman.cmdSuperman) -- Initializate attributes self.smokeGenerators = {} self.rotations = {} self.previousVelocity = {} end addEventHandler("onClientResourceStart", getResourceRootElement(thisResource), Superman.Start, false) function Superman.Stop() local self = Superman setGravity(serverGravity) -- Restore all players animations, collisions, etc for player in iterateFlyingPlayers() do self:restorePlayer(player) end end -- -- Join/Quit -- function Superman.onJoin(player) local self = Superman local player = player or source setPlayerFlying(player, false) end function Superman.onQuit(reason, player) local self = Superman local player = player or source if isPlayerFlying(player) then self:restorePlayer(player) end end -- -- onDamage: superman is invulnerable -- function Superman.onDamage() local self = Superman
  17. We don't give support with leaked scripts.
  18. الطلب مكرر على ما اعتقد ابحث بالمنتدى
  19. لازم تستخدم الفنكشن ذا عشان تضيف لاعب يظهر له الكلام textDisplayAddObserver
  20. -- استخدم واحد من ذول عشان تسوي الكول شيب createColCircle createColCuboid createColRectangle createColSphere createColTube createColPolygon Event: "onClientPlayerWeaponSwitch" -- حدث عند تغير السلاح isElementWithinColShape -- تتحقق انه موجود داخل الكول شيب لما غير السلاح -- تسوي تحقق لرقم السلاح toggleControl -- (fire) تقفل زر الأطلاق
  21. اللغة العربية في خطر على الأقل حاول تركب جملة مفيده ._. جلست اقرأ الموضوع 10 مرات عشان افهم الي تبيه او على الأقل حسب الي فهمته انك تبي ذا https://forum.multitheftauto.com/viewtopic.php?f=160&t=69694
  22. TAPL

    VIP Only

    triggerClientEvent ( "showPhoneGui", playerSource ) Should be: triggerClientEvent ( playerSource, "showPhoneGui", playerSource )
  23. راح تفهم السالفه هنا https://forum.multitheftauto.com/viewtopic.php?f=163&t=66680
  24. FPS = Frame per second = إطار في الثانية الواحدة بالمختصر المفيد يعني عدد الصور بالثانية الواحده
×
×
  • Create New...