Jump to content

ali

Members
  • Posts

    132
  • Joined

  • Last visited

Posts posted by ali

  1. well at line 10 you wrote  elseif isPedInVehicle(player) then

    what if the hitElement you defined as player was a vehicle your asking your script to check that is your vehicle inside your vehicle

    would it not be more suitable to use elseif getElementType(player) == "vehicle" then 

    something like this

    franMark1 = createMarker(1762.6, -1813.4, 12.6, "cylinder", 5, 255, 0, 0, 35)
    franMark2 = createMarker(1805, -1748.6, 51.5, "cylinder", 5, 255, 0, 0, 115)
     
    function teleport(player)
    	if (source == franMark1) then
    		
    		if is_group(player) or is_admin(player) then
            setElementPosition(player, 1791, -1780, 53)
            setElementFrozen(player, true)
            setTimer(setElementFrozen, 300, 1, player, false)
    		elseif getElementType(player) == 'vehicle' then
    		  vehiclesit = getVehicleOccupant(player,0)
    		  if vehiclesit then
    		setElementPosition(player, 1791, -1780, 53)
            setElementFrozen(player, true)
            setTimer(setElementFrozen, 300, 1, player, false)
    		end
    		end
    	
        elseif (source == franMark2) then
            if is_group(player) or is_admin(player) then
    		setElementPosition(player, 1775.8, -1821.3, 14.5)
            setElementFrozen(player, true)
            setTimer(setElementFrozen, 300, 1, player, false)
    		end
        end
    	end
    
    addEventHandler("onMarkerHit", root, teleport)

    (not tested)

  2. 12 hours ago, Donald Duck said:

    Why not link to the site directly? if someone is too dumb to understand how to order a server without watching a video first they shouldn't order a server at all to save the internet from a lot of pain and suffer caused by lack of security and eventual bot nets they may be involved with.

    well thats true but cant destroy a child's dream to make a server for him to play with his friends

    • Like 1
  3.   
      
    addCommandHandler("texts",function(cmd,...) 
    Newmsgg = table.concat({...}," ") 
    setElementData(localPlayer,"localMsg",false) 
    setElementData(localPlayer,"localMsg",Newmsgg) 
    addEventHandler("onClientRender",root,drawText) 
    if not isTimer(removeChatBubble) then 
    removeChatBubble = setTimer(function() 
    removeEventHandler("onClientRender",root,drawText) 
    end,10000,1) 
    else 
    killTimer(removeChatBubble)  
    removeChatBubble = setTimer(function() 
    removeEventHandler("onClientRender",root,drawText) 
    setElementData(localPlayer,"localMsg",false) 
    end,10000,1) 
    end 
    end) 
      
    local screenWidth, screenHeight = guiGetScreenSize ( )  
      
      
      
    -function drawText() 
    for i,v in ipairs(getElementsByType("player")) 
        local playerX, playerY, playerZ = getElementPosition ( localPlayer )  
    dxDrawRectangle(500,screenHeight - 550,275,75,tocolor(255,255,255,80)) 
    dxDrawText(Newmsgg,500,screenHeight - 550 ,screenWidth,screenHeight,tocolor(0,0,0,255),1,"pricedown") 
    end 
      
    

    I want the dxdrawings to be seen by everyone in a short distance

  4. ok guys thx for your help but now i am having another problem here

    qWWEVz6.png

    after i got 25 it should have been 35 as i gave 10

    but it gave me 9 in the next turn it gave me ten

  5. well i made some tweeks and it seems like my script is not picking up the playerName stated in

     playerName = guiGridListGetItemText ( player_grid, row, guiGridListGetSelectedItem ( player_grid ), 1 ) 
    

    client side 's part

    addEventHandler ( "onClientGUIClick", guiRoot, 
        function ( ) 
            if ( source == close_butt ) then 
                guiGridListRemoveRow ( player_grid, row ) 
                guiSetVisible ( cookie_window, false ) 
                showCursor ( false ) 
            elseif ( source == give_butt ) then 
                playerName = guiGridListGetItemText ( player_grid, row, guiGridListGetSelectedItem ( player_grid ), 1 ) 
               -- local pp = getPlayerFromName ( playerName ) 
                outputDebugString(playerName) 
                local amount = tonumber ( guiGetText ( value_edit ) ) 
                triggerServerEvent ( "recivePlayer", localPlayer, playerName, amount) 
            end 
        end 
    ) 
    

    server side whole

    addEvent ( "recivePlayer", true ) 
    addEventHandler ( "recivePlayer",root, 
        function ( playerName, amount ) 
        local pp = getPlayerFromName ( playerName ) 
            local acc = getPlayerAccount ( pp ) 
             outputDebugString ( playerName.."LOL"..amount) 
            if isGuestAccount ( acc ) then 
                return 
            end 
            local cookies = getAccountData ( acc,"n.cook" ) 
            if ( not cookies) then 
                setAccountData ( acc, "n.cook", tonumber ( amount ) ) 
                 
            else 
                setAccountData ( acc, "n.cook", cookies + tonumber ( amount ) ) 
            end   
        end 
    ) 
    

    what i get

    6uw1kly.png

  6. this is part of the client side

    addEventHandler("onClientGUIClick",cookie_window, 
    function() 
    if (source == close_butt) then guiGridListRemoveRow ( player_grid, row ) 
    guiSetVisible(cookie_window,false) 
    showCursor(false) 
    elseif (source == give_butt) then 
    playerName = guiGridListGetItemText ( player_grid, row, guiGridListGetSelectedItem ( player_grid ), 1 ) 
    pp = (getPlayerFromName(playerName)) 
    amount = (guiGetText(value_edit)) 
    triggerServerEvent("recivePlayer",resourceRoot,pp,amount) 
      
    end 
      
    end 
    ) 
    

    this is the whole server side

      
    addEvent("recivePlayer",true) 
    addEventHandler("recivePlayer",root, 
    function(pp,amount) 
    acc = getPlayerAccount(pp) 
    if  isGuestAccount(acc) == false then 
    cookies = getAccountData(acc,"n.cook") 
    if not (cookies) then 
    setAccountData(acc,"n.cook",tonumber(amount)) 
    outputChatBox("lol") 
    else  
    setAccountData(acc,"n.cook", cookies + tonumber(amount)) 
    end 
    end 
    end 
    ) 
    

    error says

    B7apvQP.png

  7. I have a grid with all the players name online now i want to be able to get their account data called "n.cook" and also change that data how can i do it (reminder i only have Nick of the users)

  8.   
    local screenW, screenH = guiGetScreenSize() 
    local window = guiCreateWindow((screenW - 1024) / 2, (screenH - 768) / 2, 1024, 768, "Web browser", false) 
    local browser = guiCreateBrowser(9, 50, 987, 645, false, false, false, window) 
      
      
    local theBrowser = guiGetBrowser(browser) 
    addEventHandler("onClientBrowserCreated", theBrowser,  
        function() 
            loadBrowserURL(source, "http://google.com") 
        end 
    ) 
      
    

    why do i keep getting blank screen?

×
×
  • Create New...