Jump to content

Smart.

Members
  • Posts

    340
  • Joined

  • Last visited

Posts posted by Smart.

  1. it works with words aswell, after changing to numbers same problem

    #Edit: The first one on top I mean like: Dance/Dj will play always whatever i chose in that combo box, BUT if i change to Classic to be on top of Dance/Dj the classic will always play

    Did you use guiComboBoxGetSelected ?

  2. "An event has been created! Use /eventwarp to be warped to the event!" will only output for the local player. (there is no plr argument clientsided)

    Doesn't matter, they aren't linked, the message will be outputed to everyone, works fine. Btw it was made in like 5 mins some rough work.

    No, the message will not be outpputed to everyone. It will only output to the command executor.

  3. These scripts are good for the beginner, but not for money. I have seen most of these scripts as an example in the WIKI, :/ , suppose it's up to the others!

    You're right, example:

    Ban/Kick a player with a command, already exists within the FR GUI script

    Music/Sound script;

    Client-

    addEventHandler( 'onClientResourceStart', resourceRoot, 
            function( ) 
            local sound = playSound3D( 'http://www.181.fm/winamp.pls?station=181-power&style=mp3&description=Power%20181%20(Top%2040)&file=181-power.pls', 485.87612915039, -11.931990623474, 1000.679687 ) 
            setSoundMaxDistance(sound, 600 ) 
            setElementInterior ( sound, 17 ) 
    end 
    ) 
      
    function event () 
    outputChatBox ( "An event has been created! Use /eventwarp to be warped to the event!", root, 0, 255, 0 ) 
    end 
    addCommandHandler ( "command", event ) 
    

    Server-

    function warp (player) 
    setElementPosition ( player, 485.87612915039, -11.931990623474, 1000.679687 ) 
    setElementInterior ( player, 17 ) 
    end 
    addCommandHandler ( "eventwarp", warp ) 
    

    "An event has been created! Use /eventwarp to be warped to the event!" will only output for the local player. (there is no plr argument clientsided)

  4. Use this code instead of using setElementData and a timer, not tested but should work.

    local sellMarker =  createMarker(2694.72852, -2226.08911, 13.55008, "cylinder", 1.5, 255, 0, 0) 
    local tick = {} 
      
    function sellVehicle(player) 
        if (getElementType(player) == "player") then 
            if (not getPedOccupiedVehicle(player)) then outputChatBox("You need to be in a Vehicle to sell it.", player, 255, 0, 0) return end   
            if (tick[player]) then 
                local theTick = getTickCount() 
                if (theTick - tick[player] < 1800000) then 
                    outputChatBox("Wait 30 minutes.", player, 255, 0, 0) 
                    return 
                end 
            end 
            tick[player] = getTickCount()        
            local vehicle = getPedOccupiedVehicle(player) 
            local reward = math.random(2000, 3000) 
            givePlayerMoney(player, reward) 
            outputChatBox("You have sold the "..getVehicleName(vehicle).. " for "..reward.."!", player, 0, 255, 0) 
        end 
    end 
    addEventHandler("onMarkerHit", sellMarker, sellVehicle) 
    

  5. sellMarker = createMarker ( 2694.72852, -2226.08911, 13.55008, "cylinder", 1.5, 255, 0, 0 ) 
    setElementData( root, 'sellCar', true ) 
      
    function sellVehicle( hit ) 
        if getElementType( hit ) == 'vehicle' then 
            local player = getVehicleOccupant( hit ) 
            if player and getElementData( player, 'sellCar' ) then 
                local reward = math.random( 2000, 3000 ) 
                givePlayerMoney( player, reward ) 
                outputChatBox ( "You have sold the " .. getVehicleName( hit ) .. " for " .. reward .. " !", player, 0, 255, 0 ) 
                destroyElement( hit ) 
                setElementData( player, 'sellCar', false ) 
                setTimer( setElementData, 1800000, 1, player, 'sellCar', true ) 
            else 
                outputChatBox( 'Should you wait a half hour!', player, 255, 0, 0 ) 
            end 
        end 
    end 
    addEventHandler( 'onMarkerHit', sellMarker, sellVehicle ) 
    

    why are you using elementdata with a timer? just use getTickCount

  6. I've been trying to fix an error message on my Debain 6.0 x86 server for quite some while now but I can not seem to solve it..

    This is the error I'm getting is: http://puu.sh/1Hmry and according to the wiki this should fix it

    To fix MODULE: Unable to find modules/mta_mysql.so (libmysqlclient.so.15: cannot open shared object file: No such file or directory)! you have to install libmysqlclient15. You can get it here: http://automation.binarysage.net/?p=1311

    but I'm still getting the same error

  7. local g_pCensoredWords = 
    { 
        "bitch", 
        "gay"; 
    }; 
      
    addEventHandler( "onPlayerChat", root, 
        function( szMsg ) 
            for index, word in ipairs( g_pCensoredWords ) do 
                if ( szMsg:find( word, 0 ) ) then 
                    szMsg = szMsg:gsub( word, "****" ); 
                    szMsg = string.format( "%s: %s", getPlayerName( source ), szMsg ); 
      
                    cancelEvent(); 
                    outputChatBox( szMsg, root, 255, 255, 255, true ); 
                end 
            end 
        end 
    ) 
    

    Not tested but should work.

    Why do you use idiotic variable names and whatsup with the ";"?

  8. Theres nothing server side that will make an NPC non kill-able? What if i remove collision ?

    There is but I would not recommend using it. You could add a timer to set the ped's health to 100 every second but running a timer that many times would probably fuck up the server

  9. Remove it using removeEventHandler or you can use a variable, like when you trigger the login you set the variable to true, and then when rendering the text you can check if the variable is true, if it is then return end. However, I recommend using removeEventHandler (see below)

    client

     function drawLoginText() 
        dxDrawText("Welcome to ...", 131, 29, 846, 76, tocolor(255, 0, 0, 255), 1, "bankgothic", "left", "top", false, false, true, false, false) 
            dxDrawText("Please Login Below", 490, 349, 724, 366, tocolor(255, 255, 255, 255), 1, "default", "left", "top", false, false, true, false, false) 
    end 
    addEventHandler("onClientRender", root, drawLoginText) 
      
    function removeDXOnLogin() 
        removeEventHandler("onClientRender", root, drawLoginText) 
    end 
    addEvent("removeDXOnLogin", true) 
    addEventHandler("removeDXOnLogin", root, removeDXOnLogin) 
    

    server

    function removeOnLogin() 
        triggerClientEvent(source, "removeDXOnLogin", source) -- this line could just be copied into your event which you trigger from client (assuming you actually login the player)  
    end 
    addEventHandler("onPlayerLogin", root, removeOnLogin) 
    

×
×
  • Create New...