Jump to content

Simple.

Members
  • Posts

    1,004
  • Joined

  • Days Won

    1

Posts posted by Simple.

  1. 30 minutes ago, slapztea said:

    @Simple. can you help? 

    How to check when a player changes location? Does the weather automatically change?

    I can do, for example, command check location BUT how to make it so that when the player changed the location the command worked on this event without a command.

     

    use timer

  2. 3 hours ago, slapztea said:

    Hello! Can Is it possible to tie the weather to a specific location?

    For example, rain in Los Santos and clear weather in Las Venturas.

    The player who is in Los Santos sees the rain but player who is in Las Venturas see clear weather(sunny etc)

    That is, at the same time that there was different weather in different states. Is it possible?

    getZoneName
    setWeather

    client side

  3. 8 hours ago, lockdw said:

    It doesn't work... Where should i paste this ?

     

    What about this message ? https://prnt.sc/rg4d33

    server/main.Lua

     

    factor = 0.03
    local BlockedModel = {
    	-- [Car id] = true,
    	  [411] = true,
    	  [457] = true,
      }
    
    function createVehicles(player)
    	for i,v in ipairs(getElementsByType("vehicle")) do
    		fuel = math.random(70,80)
    		setElementData(v, "fuel", fuel)
    	end
    end
    
    function processFuel(player)
    	for i,v in ipairs(getElementsByType("vehicle")) do
    		if not BlockedModel[getElementModel ( v )] then 
    			local fuel = getElementData(v, "fuel") or math.random(70,80)
    			if (getVehicleEngineState(v) and fuel > 0 ) then
    				fuel = fuel - factor
    			end
    			if (fuel <= 0.99) then
    				fuel = 0
    				setVehicleEngineState(v, false)
    				
    			end
    			setElementData(v, "fuel", fuel)
    		end
    	end
    end
    
    createVehicles()
    setTimer(processFuel, 1000, 0)

     

  4. 2 hours ago, lockdw said:

    Sup! I have this function in my server. But i want that only players who is in "gang" ACL could use it. How can i do this?

    Like, if you're not in the "gang" ACL, you can't even start the function. The pannel will not appears to you. 

    
    function IniciarVendaArmas (source, Arma_Selecionada, getID, getPreco, getMunicao, WeaponID)
    local Jogador = getPlayerID(getID)
    local Preco = tonumber(getPreco)
    local Municao = tonumber(getMunicao)
    local MunicaoAtual = getElementData(source, "TS:MuniAtual") or 0
    

    IniciarVendaArmas = StartWeaponSelling

    Jogador = player

    Preco = price

    Municao = ammo

    MunicaoAtual = current ammo

    local account = getPlayerAccount ( player )
    if account and not isGuestAccount ( player ) then
    	if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(player)), aclGetGroup('Acl name here')) then
    		-- your code here
    	end
    end
        

     

  5. 2 hours ago, iPollo said:

    Okay, and about the table, I found an example of a table structure (below)

    
    local items = {
    	['apple'] = {desc = 'A green apple', name = 'apple', objectid = '2134'}
    }
    

    how should i do, using tabel.insert, to add a new item without doing it manually in the table itself, leaving it like this:
     

    
    local items = {
    	['apple'] = {desc = 'A green apple', name = 'apple', objectid = '2134'}
    	['medkit'] = {desc = 'A healing item', name = 'Medic Kit', objectid = '431'}
    }
    

    I know that initially it is like this:

    
    table.insert(items, 'medkit', ...)
    

    what should I put to fill in the fields within the 'medkit' index

    You can do it in two ways

    items['medkit'] = {desc = 'A healing item', name = 'Medic Kit', objectid = '431'}

    or

    table.insert(items, 'medkit', {desc = 'A healing item', name = 'Medic Kit', objectid = '431'})

     

    • Thanks 1
  6. local screenWidth, screenHeight = guiGetScreenSize ( )
    local scroll = guiCreateScrollBar(15,81,24,245,false,false)
    local scroll2 = guiCreateScrollBar(45,81,24,245,false,false)
    local scroll3 = guiCreateScrollBar(75,81,24,245,false,false)
    
    local R, G, B = 0, 0, 0
    
    
    addEventHandler( "onClientGUIScroll", root, 
    function()
    	local ScrollValue = guiScrollBarGetScrollPosition ( source )
        if source == scroll then
        	R = (255/100) * ScrollValue
    	elseif source == scroll2 then
    		G = (255/100) * ScrollValue
    	elseif source == scroll3 then
    		B = (255/100) * ScrollValue
    	end
    end)
    
    function createText ( )
        local playerX, playerY, playerZ = getElementPosition ( localPlayer )       -- Get our player's coordinates.
        local playerZoneName = getZoneName ( playerX, playerY, playerZ )          -- Get name of the zone the player is in.
    
        -- Draw zone name text's shadow.
        dxDrawText ( playerZoneName, 44, screenHeight - 41, screenWidth, screenHeight, tocolor ( 0, 0, 0, 255 ), 1.02, "pricedown" )
        -- Draw zone name text.
        dxDrawText ( playerZoneName, 44, screenHeight - 43, screenWidth, screenHeight, tocolor ( R, G, B, 255 ), 1, "pricedown" )
    end
    
    function HandleTheRendering ( )
        addEventHandler ( "onClientRender", root, createText ) -- keep the text visible with onClientRender.
    end
    
    addEventHandler ( "onClientResourceStart", resourceRoot, HandleTheRendering )

    @+Source|>

    • Like 1
  7. 7 hours ago, +Source|> said:

    وش المشكله هنا

    
    local R, G, B = 255, 255, 255
    
    local R2, G2, B2 = guiScrollBarGetScrollPosition( GUIEditor.scrollbar[1] ), guiScrollBarGetScrollPosition( GUIEditor.scrollbar[2] ), guiScrollBarGetScrollPosition( GUIEditor.scrollbar[3] )
    
    
    
    addEventHandler( "onClientGUIScroll", root,
    	function( Scrolled )
    		if Scrolled == GUIEditor.scrollbar[1] then
    			if R2 <= 1.0 then
    				R = 255
    			elseif R2 == R2 + 2.0 then
    				R = R - 5
    			end
    		end
    	end
    )
    

     

    وش تبي تسوي بالضبط؟

  8. 26 minutes ago, DmAr511 said:

    يب :]

    لاني بسوي جوائز

    local LevelData = "Level"
    local ExpData = "Exp"
    function giveXP ( player, exp )
    	if isElement ( player ) and getElementType ( player ) == 'player' then
    		if exp and type ( exp ) == "number" then
    			local level = getElementData ( player, LevelData ) or 1
    			local currentXp = getElementData ( player, ExpData ) or 0
    			if currentXp + exp > level * 100 then
    				setElementData ( player, LevelData, level + 1 )
    				setElementData ( player, ExpData, ( currentXp + exp ) - ( level * 100 ) )
    				outputChatBox ( 'Level up to '..level+1, player)
    			else
    				setElementData ( player, ExpData, currentXp + exp )
    				outputChatBox ( 'Exp up to '..currentXp + exp, player)
    			end
    		end
    	end
    end

    هذا نظام لفلات بسيط ماجربته بس إن شاء الله مضبوط

    يبقى عليك حفظ اللفل والاكس بي

    ولما يقتل تعطيه اكس بي

    عدله بالي يناسبك

  9. local showComponents = false
    bindKey("f5", "down", function() showComponents = not showComponents end)
    
    
    addEventHandler("onClientRender", root,
        function()
    
            if (showComponents) then
                for _, veh in pairs(getElementsByType("vehicle", root, true)) do
                    for compname in pairs(veh:getComponents()) do
                        local x, y = getScreenFromWorldPosition(veh:getComponentPosition(compname, "world"))
    
                        if (x) then
                            dxDrawText(compname, x, y, 0, 0, tocolor(255, 255, 255))
                        end
                    end 
                end
            end
    
        end
    )

    هذا مثال من الويكي ممكن يساعدك

  10. لما ياخذ اكس بي سو تحقق

    إذا الاكس بي مع الزيادة اكثر من الحد

    زود للاعب لفل واخصم من الاكس بي الحد حق اللفل وعطه الاكس بي الباقي ?

     

    مثال

    EXP = givenXP + currentXP
    if EXP > limitXP then
        level = level + 1
        currentEXP = EXP - limitXP
        limitXP = level * 100
     end
      

    مجرد مثال عن الطريقة الي بتسويها

  11. addEventHandler("onVehicleEnter", root, function (player, _, jacked)
    	if isElement(jacked) and getElementType(player) == "player" and getElementType(jacked) == "player" and (getTeamName(getPlayerTeam(player)) ~= 'Police') then
    		setElementData(player, "Charges", tonumber(getElementData(player, "Charges"))+30)
    	end
    end)

     

    • Thanks 1
  12. 1 hour ago, Ad[N]a[N]e said:

    السلام عليكم ورحمة الله وبركاته 

    عندي مشكلة في لوحة ابي ازيد لها اشياء ما تبغا تنزاد ..اللوحة :

    
    local screenW, screenH = guiGetScreenSize()
    clanwarwnd = guiCreateWindow((screenW - 800) / 5, (screenH - 800) / 5, 800, 800, "Clanwar Panel", false)
    guiSetVisible(clanwarwnd, false)
             
    cjoin = guiCreateButton(49, 35, 169, 37, "Enable Command 'cjoin'", false, clanwarwnd)
    stgm = guiCreateButton(233, 35, 169, 37, "Start Game + Open Doors", false, clanwarwnd)
    edgm = guiCreateButton(49, 87, 169, 37, "End Game + Close Doors", false, clanwarwnd)
    rfwn = guiCreateButton(233, 87, 169, 37, "Rifa Win  + Top Players", false, clanwarwnd)
    mfwn = guiCreateButton(49, 138, 169, 37, "Mafia Win  + Top Players", false, clanwarwnd)
    adjoin = guiCreateButton(233, 138, 169, 37, "Admins Join Only", false, clanwarwnd)
    slapall = guiCreateButton(49, 185, 169, 37, "Slap All Players", false, clanwarwnd)
    closewnd = guiCreateButton(233, 185, 169, 37, "Close Window", false, clanwarwnd)

    و انا اريد زيادة دا الكود 

    
            Points_EditBox = guiCreateEdit(49, 185, 169, 37, "", false, clanwarwnd)
            Points_Label = guiCreateLabel(0.46, 0.65, 0.08, 0.03, "Points :", false, clanwarwnd)
            guiSetFont(Points_Label, "default-bold-small")
            guiLabelSetHorizontalAlign(Points_Label, "center", false)
    

    كمان ما اقدر ازيد فيه طوله وعرضه وش المششكلة ؟؟

        local screenW, screenH = guiGetScreenSize()
                clanwarwnd = guiCreateWindow((screenW - 800) / 5, (screenH - 800) / 5, 800, 800, "Clanwar Panel", false)
                guiWindowSetMovable(clanwarwnd, false)
                guiWindowSetSizable(clanwarwnd, false)
                 guiSetVisible(clanwarwnd, false)
                cjoin = guiCreateButton(49, 35, 169, 37, "Enable Command 'cjoin'", false, clanwarwnd)
                stgm = guiCreateButton(233, 35, 169, 37, "Start Game + Open Doors", false, clanwarwnd)
                edgm = guiCreateButton(49, 87, 169, 37, "End Game + Close Doors", false, clanwarwnd)
                rfwn = guiCreateButton(233, 87, 169, 37, "Rifa Win  + Top Players", false, clanwarwnd)
                mfwn = guiCreateButton(49, 138, 169, 37, "Mafia Win  + Top Players", false, clanwarwnd)
                adjoin = guiCreateButton(233, 138, 169, 37, "Admins Join Only", false, clanwarwnd)
                slapall = guiCreateButton(49, 185, 169, 37, "Slap All Players", false, clanwarwnd)
                closewnd = guiCreateButton(233, 185, 169, 37, "Close Window", false, clanwarwnd)
                Points_EditBox = guiCreateEdit(49, 185, 169, 37, "", false, clanwarwnd)
                Points_Label = guiCreateLabel(0.46, 0.65, 0.08, 0.03, "Points :", true, clanwarwnd)
                guiSetFont(Points_Label, "default-bold-small")
                guiLabelSetHorizontalAlign(Points_Label, "center", false)
×
×
  • Create New...