Jump to content

xXMADEXx

Members
  • Posts

    2,718
  • Joined

  • Last visited

Posts posted by xXMADEXx

  1. Try putting the toJSON in single quotes.

    local database = dbConnect("sqlite", "parchement.db") 
    dbExec(database, "CREATE TABLE IF NOT EXISTS parchement (account_name TEXT, parchement TEXT DEFAULT '"..toJSON({}).."')") 
    

    I'm honestly not sure if this will fix the problem though.

  2. As Noki said, each language is like a toolbox with its own purpose. However, I would chose Java over C++ just for the simple reason that it is a fairly easy language to learn and write in, especially compared to C++, and because Java is cross platform compatible.

  3. The vehicles actually don't have a "list." The script just uses a loop to get all the vehicle models. Go into admin\client\gui\admin_main.lua. There's a for loop, should be lines ~126-130:

                                for i = 400, 611 do 
                                    if ( getVehicleNameFromModel ( i ) ~= "" ) then 
                                        table.insert( vehicleNames, { model = i, name = getVehicleNameFromModel ( i ) } ) 
                                    end 
                                end 
    

    You can write if statements to check the vehicle model and tell the script if it should add it or not.

  4. Ok, so you're looking for something like this, however it's not going to work unless you have the following variables defined somewhere else in the script:

    - on

    - Ativo

    - off

    - Garagem

    function guiPart() 
        f1 = guiCreateButton(logX-recX/2+(recX-cancelX-okX+375), logY+fAltUser*2+sep*3-47,okX-70, recY-375, "", false) 
        f2 = guiCreateButton(logX-recX/2+(recX-cancelX-okX+375), logY+fAltUser*2+sep*3-2,okX-70, recY-375, "F2", false) 
        f3 = guiCreateButton(logX-recX/2+(recX-cancelX-okX+375), logY+fAltUser*2+sep*3+43,okX-70, recY-375, "F2", false) 
        guiSetAlpha ( f1, 0 ) 
        guiSetAlpha ( f2, 0 ) 
        guiSetAlpha ( f3, 0 ) 
    end 
      
    function MouseClick ( button, state )  
        if ( button == "left" ) then  
            if ( source == f1 ) then 
                triggerServerEvent("Ativo", getLocalPlayer(), getLocalPlayer(), Ativo); 
                ori9 = on; 
            else 
                triggerServerEvent("Garagem", getLocalPlayer(), getLocalPlayer(), Garagem); 
                ori9 = off; 
            end 
        end  
    end  
    addEventHandler ( "onClientGUIClick", root, MouseClick ); 
    

  5. What exactly are you trying to do? It's kinda hard to tell from this script. Also, be sure to check debugscript for errors by using /debugscript 3

    And if you could, please post the whole script.

  6. Try using this:

    Amount = { }; 
    Amount.RED = { 255, 0, 0 }; 
    Amount.BLUE = { 1, 1, 1 }; 
    Amount.PINK = { 2, 2, 2 }; 
    Amount.BLACK = { 0, 0, 0 }; 
      
    function clr (player,command,color) 
        local vehicle = getPedOccupiedVehicle(player) 
        if color and vehicle then 
            if ( not Amount [ tostring ( color ):upper ( ) ] ) then  
                return false; 
            end  
             
            local r, g, b = unpack ( Amount [ tostring ( color ):upper() ] ); 
            setVehicleColor(vehicle, r, g, b ); 
        end 
    end 
    addCommandHandler("color", clr) 
    

    Please make sure to check debugscript before posting. (/debugscript 3)

×
×
  • Create New...