Jump to content

If it's an infernus, do not show the GUI?


Bluebay

Recommended Posts

Hey guys! I have a command: /cveh, which is open the hood of a car.

But i would like to do, if it's an infernus, they will can't, and they get a message: It's an INFERNUS!

(Sorry for bad english)

CLIENT side of the script: cveh_c.lua

------------------------------------ 
-- QUANTUMZ - QUANTUMZ - QUANTUMZ -- 
------------------------------------ 
--         2011 - Romania         --         
------------------------------------ 
-- You can modify this file but   -- 
-- don't change the credits.      -- 
------------------------------------ 
------------------------------------ 
--  VEHICLECONTROL v1.0 for MTA   -- 
------------------------------------ 
  
GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Label = {} 
GUIEditor_Scrollbar = {} 
  
  
  
GUIEditor_Window[1] = guiCreateWindow(709,236,272,288,"Vehicle Control",false) 
GUIEditor_Scrollbar[1] = guiCreateScrollBar(24,49,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[1] = guiCreateLabel(86,30,135,15,"1",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[1],"default-bold-small") 
GUIEditor_Label[2] = guiCreateLabel(74,72,135,15,"2",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[2],"default-bold-small") 
GUIEditor_Scrollbar[2] = guiCreateScrollBar(24,91,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[3] = guiCreateLabel(68,112,135,15,"3",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[3],"default-bold-small") 
GUIEditor_Scrollbar[3] = guiCreateScrollBar(24,130,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[4] = guiCreateLabel(71,151,135,15,"4",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[4],"default-bold-small") 
GUIEditor_Scrollbar[4] = guiCreateScrollBar(24,168,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[5] = guiCreateLabel(68,189,135,15,"5",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[5],"default-bold-small") 
GUIEditor_Scrollbar[5] = guiCreateScrollBar(24,206,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[6] = guiCreateLabel(83,226,135,15,"6",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[6],"default-bold-small") 
GUIEditor_Scrollbar[6] = guiCreateScrollBar(24,243,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Button[1] = guiCreateButton(23,265,230,14,"Close",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[1],"default-small") 
guiWindowSetSizable ( GUIEditor_Window[1], false ) 
setElementData(GUIEditor_Scrollbar[1], "Type", 0) 
setElementData(GUIEditor_Scrollbar[2], "Type", 2) 
setElementData(GUIEditor_Scrollbar[3], "Type", 3) 
setElementData(GUIEditor_Scrollbar[4], "Type", 4) 
setElementData(GUIEditor_Scrollbar[5], "Type", 5) 
setElementData(GUIEditor_Scrollbar[6], "Type", 1) 
guiSetVisible(GUIEditor_Window[1], false) 
showCursor(false) 
  
  
  
function enableVehicleControl() 
    if isPedInVehicle( localPlayer ) then 
        if guiGetVisible(GUIEditor_Window[1]) == false then 
            guiSetVisible(GUIEditor_Window[1], true) 
            showCursor(true) 
        else 
            guiSetVisible(GUIEditor_Window[1], false) 
            showCursor(false) 
        end 
    end  
end 
addCommandHandler("cveh", enableVehicleControl) 
  
function closeButton() 
        guiSetVisible(GUIEditor_Window[1], false) 
        showCursor(false) 
end 
addEventHandler ( "onClientGUIClick", GUIEditor_Button[1], closeButton, false ) 
  
function updateRatio(Scrolled) 
    local position = guiScrollBarGetScrollPosition(Scrolled) 
    local door = getElementData(Scrolled, "Type") 
    triggerServerEvent("moveThisShit", getLocalPlayer(), door, position) 
end 
addEventHandler("onClientGUIScroll", getRootElement(), updateRatio) 
  
  
  
  
  
     

SERVER side: cveh_s.lua

function openDoor(door, position) 
    local vehicle = getPedOccupiedVehicle(source) 
    if getPedOccupiedVehicleSeat(source) == 0 then 
        if door == 0 then 
            if position==0 then 
                setVehicleDoorOpenRatio(vehicle, 0, 0, 0.5) 
            end 
            if position==100 then 
                setVehicleDoorOpenRatio(vehicle, 0, 1, 0.5) 
            end 
            if position>0 and position<100 then 
                setVehicleDoorOpenRatio(vehicle, 0, position/100, 0.5) 
            end 
        end 
        if door == 1 then 
            if position==0 then 
                setVehicleDoorOpenRatio(vehicle, 1, 0, 0.5) 
            end 
            if position==100 then 
                setVehicleDoorOpenRatio(vehicle, 1, 1, 0.5) 
            end 
            if position>0 and position<100 then 
                setVehicleDoorOpenRatio(vehicle, 1, position/100, 0.5) 
            end 
        end 
    end 
end      
addEvent("moveThisShit", true) 
addEventHandler("moveThisShit", getRootElement(), openDoor) 
  

How can i do this?

Thank you guys, for the help.

Edited by Guest
Link to comment

LoooooL

-- Server 
  
function openDoor(door, position) 
    local vehicle = getPedOccupiedVehicle(source) 
    local Type = getElementModel( vehicle ) 
    local ID = 411 
    if ( Type == ID ) then 
        outputChatBox( "It's a BUS !", source, 255, 0, 0, true ) 
    else 
        if getPedOccupiedVehicleSeat(source) == 0 then 
            if door == 0 then 
                if position==0 then 
                    setVehicleDoorOpenRatio(vehicle, 0, 0, 0.5) 
                end 
                if position==100 then 
                    setVehicleDoorOpenRatio(vehicle, 0, 1, 0.5) 
                end 
                if position>0 and position<100 then 
                    setVehicleDoorOpenRatio(vehicle, 0, position/100, 0.5) 
                end 
            end 
            if door == 1 then 
                if position==0 then 
                    setVehicleDoorOpenRatio(vehicle, 1, 0, 0.5) 
                end 
                if position==100 then 
                    setVehicleDoorOpenRatio(vehicle, 1, 1, 0.5) 
                end 
                if position>0 and position<100 then 
                    setVehicleDoorOpenRatio(vehicle, 1, position/100, 0.5) 
                end 
            end 
        end 
    end 
end 
addEvent(":~", true) 
addEventHandler(":~", getRootElement(), openDoor) 
  
  
  
function enableVehicleControl() 
    if isPedInVehicle( localPlayer ) then 
        if guiGetVisible(GUIEditor_Window[1]) == false then 
            guiSetVisible(GUIEditor_Window[1], true) 
            showCursor(true) 
        else 
            guiSetVisible(GUIEditor_Window[1], false) 
            showCursor(false) 
        end 
    end 
end 
addCommandHandler("cveh", enableVehicleControl) 
  
function closeButton() 
        guiSetVisible(GUIEditor_Window[1], false) 
        showCursor(false) 
end 
addEventHandler ( "onClientGUIClick", GUIEditor_Button[1], closeButton, false ) 
  
function updateRatio(Scrolled) 
    local position = guiScrollBarGetScrollPosition(Scrolled) 
    local door = getElementData(Scrolled, "Type") 
    triggerServerEvent(":~", getLocalPlayer(), door, position) 
end 
addEventHandler("onClientGUIScroll", getRootElement(), updateRatio) 

Will fix it there as well =) + Thank you Prestege ^_^

Link to comment

=== cveh_c.lua ===

------------------------------------ 
-- QUANTUMZ - QUANTUMZ - QUANTUMZ -- 
------------------------------------ 
--         2011 - Romania         --         
------------------------------------ 
-- You can modify this file but   -- 
-- don't change the credits.      -- 
------------------------------------ 
------------------------------------ 
--  VEHICLECONTROL v1.0 for MTA   -- 
------------------------------------ 
  
GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Label = {} 
GUIEditor_Scrollbar = {} 
  
  
  
GUIEditor_Window[1] = guiCreateWindow(709,236,272,288,"Vehicle Control",false) 
GUIEditor_Scrollbar[1] = guiCreateScrollBar(24,49,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[1] = guiCreateLabel(86,30,135,15,"1",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[1],"default-bold-small") 
GUIEditor_Label[2] = guiCreateLabel(74,72,135,15,"2",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[2],"default-bold-small") 
GUIEditor_Scrollbar[2] = guiCreateScrollBar(24,91,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[3] = guiCreateLabel(68,112,135,15,"3",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[3],"default-bold-small") 
GUIEditor_Scrollbar[3] = guiCreateScrollBar(24,130,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[4] = guiCreateLabel(71,151,135,15,"4",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[4],"default-bold-small") 
GUIEditor_Scrollbar[4] = guiCreateScrollBar(24,168,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[5] = guiCreateLabel(68,189,135,15,"5",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[5],"default-bold-small") 
GUIEditor_Scrollbar[5] = guiCreateScrollBar(24,206,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[6] = guiCreateLabel(83,226,135,15,"6",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[6],"default-bold-small") 
GUIEditor_Scrollbar[6] = guiCreateScrollBar(24,243,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Button[1] = guiCreateButton(23,265,230,14,"Close",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[1],"default-small") 
guiWindowSetSizable ( GUIEditor_Window[1], false ) 
setElementData(GUIEditor_Scrollbar[1], "Type", 0) 
setElementData(GUIEditor_Scrollbar[2], "Type", 2) 
setElementData(GUIEditor_Scrollbar[3], "Type", 3) 
setElementData(GUIEditor_Scrollbar[4], "Type", 4) 
setElementData(GUIEditor_Scrollbar[5], "Type", 5) 
setElementData(GUIEditor_Scrollbar[6], "Type", 1) 
guiSetVisible(GUIEditor_Window[1], false) 
showCursor(false) 
  
  
  
function enableVehicleControl() 
    local vehicle = getPedOccupiedVehicle(localPlayer)  
if ( vehicle ) and ( getElementModel( vehicle ) == 429 ) then 
        if guiGetVisible(GUIEditor_Window[1]) == false then 
            guiSetVisible(GUIEditor_Window[1], true) 
            showCursor(true) 
        else 
            guiSetVisible(GUIEditor_Window[1], false) 
            showCursor(false) 
        end 
    end  
end 
addCommandHandler("cveh", enableVehicleControl) 
  
function closeButton() 
        guiSetVisible(GUIEditor_Window[1], false) 
        showCursor(false) 
end 
addEventHandler ( "onClientGUIClick", GUIEditor_Button[1], closeButton, false ) 
  
function updateRatio(Scrolled) 
    local position = guiScrollBarGetScrollPosition(Scrolled) 
    local door = getElementData(Scrolled, "Type") 
    triggerServerEvent(":~", getLocalPlayer(), door, position) 
end 
addEventHandler("onClientGUIScroll", getRootElement(), updateRatio) 
  
  
  
  
  
     
Link to comment
=== cveh_c.lua ===

------------------------------------ 
-- QUANTUMZ - QUANTUMZ - QUANTUMZ -- 
------------------------------------ 
--         2011 - Romania         --         
------------------------------------ 
-- You can modify this file but   -- 
-- don't change the credits.      -- 
------------------------------------ 
------------------------------------ 
--  VEHICLECONTROL v1.0 for MTA   -- 
------------------------------------ 
  
GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Label = {} 
GUIEditor_Scrollbar = {} 
  
  
  
GUIEditor_Window[1] = guiCreateWindow(709,236,272,288,"Vehicle Control",false) 
GUIEditor_Scrollbar[1] = guiCreateScrollBar(24,49,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[1] = guiCreateLabel(86,30,135,15,"1",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[1],"default-bold-small") 
GUIEditor_Label[2] = guiCreateLabel(74,72,135,15,"2",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[2],"default-bold-small") 
GUIEditor_Scrollbar[2] = guiCreateScrollBar(24,91,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[3] = guiCreateLabel(68,112,135,15,"3",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[3],"default-bold-small") 
GUIEditor_Scrollbar[3] = guiCreateScrollBar(24,130,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[4] = guiCreateLabel(71,151,135,15,"4",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[4],"default-bold-small") 
GUIEditor_Scrollbar[4] = guiCreateScrollBar(24,168,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[5] = guiCreateLabel(68,189,135,15,"5",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[5],"default-bold-small") 
GUIEditor_Scrollbar[5] = guiCreateScrollBar(24,206,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[6] = guiCreateLabel(83,226,135,15,"6",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[6],"default-bold-small") 
GUIEditor_Scrollbar[6] = guiCreateScrollBar(24,243,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Button[1] = guiCreateButton(23,265,230,14,"Close",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[1],"default-small") 
guiWindowSetSizable ( GUIEditor_Window[1], false ) 
setElementData(GUIEditor_Scrollbar[1], "Type", 0) 
setElementData(GUIEditor_Scrollbar[2], "Type", 2) 
setElementData(GUIEditor_Scrollbar[3], "Type", 3) 
setElementData(GUIEditor_Scrollbar[4], "Type", 4) 
setElementData(GUIEditor_Scrollbar[5], "Type", 5) 
setElementData(GUIEditor_Scrollbar[6], "Type", 1) 
guiSetVisible(GUIEditor_Window[1], false) 
showCursor(false) 
  
  
  
function enableVehicleControl() 
    local vehicle = getPedOccupiedVehicle(localPlayer)  
if ( vehicle ) and ( getElementModel( vehicle ) == 429 ) then 
        if guiGetVisible(GUIEditor_Window[1]) == false then 
            guiSetVisible(GUIEditor_Window[1], true) 
            showCursor(true) 
        else 
            guiSetVisible(GUIEditor_Window[1], false) 
            showCursor(false) 
        end 
    end  
end 
addCommandHandler("cveh", enableVehicleControl) 
  
function closeButton() 
        guiSetVisible(GUIEditor_Window[1], false) 
        showCursor(false) 
end 
addEventHandler ( "onClientGUIClick", GUIEditor_Button[1], closeButton, false ) 
  
function updateRatio(Scrolled) 
    local position = guiScrollBarGetScrollPosition(Scrolled) 
    local door = getElementData(Scrolled, "Type") 
    triggerServerEvent(":~", getLocalPlayer(), door, position) 
end 
addEventHandler("onClientGUIScroll", getRootElement(), updateRatio) 
  
  
  
  
  
     

Yes, it is. And I need the cveh_s.lua, what will check that is this an infernus, or not?!

Link to comment

=== cveh_c.lua ===

------------------------------------ 
-- QUANTUMZ - QUANTUMZ - QUANTUMZ -- 
------------------------------------ 
--         2011 - Romania         --         
------------------------------------ 
-- You can modify this file but   -- 
-- don't change the credits.      -- 
------------------------------------ 
------------------------------------ 
--  VEHICLECONTROL v1.0 for MTA   -- 
------------------------------------ 
  
GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Label = {} 
GUIEditor_Scrollbar = {} 
  
  
  
GUIEditor_Window[1] = guiCreateWindow(709,236,272,288,"Vehicle Control",false) 
GUIEditor_Scrollbar[1] = guiCreateScrollBar(24,49,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[1] = guiCreateLabel(86,30,135,15,"1",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[1],"default-bold-small") 
GUIEditor_Label[2] = guiCreateLabel(74,72,135,15,"2",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[2],"default-bold-small") 
GUIEditor_Scrollbar[2] = guiCreateScrollBar(24,91,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[3] = guiCreateLabel(68,112,135,15,"3",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[3],"default-bold-small") 
GUIEditor_Scrollbar[3] = guiCreateScrollBar(24,130,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[4] = guiCreateLabel(71,151,135,15,"4",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[4],"default-bold-small") 
GUIEditor_Scrollbar[4] = guiCreateScrollBar(24,168,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[5] = guiCreateLabel(68,189,135,15,"5",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[5],"default-bold-small") 
GUIEditor_Scrollbar[5] = guiCreateScrollBar(24,206,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[6] = guiCreateLabel(83,226,135,15,"6",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[6],"default-bold-small") 
GUIEditor_Scrollbar[6] = guiCreateScrollBar(24,243,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Button[1] = guiCreateButton(23,265,230,14,"Close",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[1],"default-small") 
guiWindowSetSizable ( GUIEditor_Window[1], false ) 
setElementData(GUIEditor_Scrollbar[1], "Type", 0) 
setElementData(GUIEditor_Scrollbar[2], "Type", 2) 
setElementData(GUIEditor_Scrollbar[3], "Type", 3) 
setElementData(GUIEditor_Scrollbar[4], "Type", 4) 
setElementData(GUIEditor_Scrollbar[5], "Type", 5) 
setElementData(GUIEditor_Scrollbar[6], "Type", 1) 
guiSetVisible(GUIEditor_Window[1], false) 
showCursor(false) 
  
  
  
function enableVehicleControl() 
    local vehicle = getPedOccupiedVehicle(localPlayer)  
if ( vehicle ) and ( getElementModel( vehicle ) == 411 ) then 
        if guiGetVisible(GUIEditor_Window[1]) == false then 
            guiSetVisible(GUIEditor_Window[1], true) 
            showCursor(true) 
        else 
            guiSetVisible(GUIEditor_Window[1], false) 
            showCursor(false) 
        end 
    end  
end 
addCommandHandler("cveh", enableVehicleControl) 
  
function closeButton() 
        guiSetVisible(GUIEditor_Window[1], false) 
        showCursor(false) 
end 
addEventHandler ( "onClientGUIClick", GUIEditor_Button[1], closeButton, false ) 
  
function updateRatio(Scrolled) 
    local position = guiScrollBarGetScrollPosition(Scrolled) 
    local door = getElementData(Scrolled, "Type") 
    triggerServerEvent(":~", getLocalPlayer(), door, position) 
end 
addEventHandler("onClientGUIScroll", getRootElement(), updateRatio) 
  
  
  
  
  
     
Link to comment
LoooooL
-- Server 
  
function openDoor(door, position) 
    local vehicle = getPedOccupiedVehicle(source) 
    local Type = getElementModel( vehicle ) 
    local ID = 411 
    if ( Type == ID ) then 
        outputChatBox( "It's a BUS !", source, 255, 0, 0, true ) 
    else 
        if getPedOccupiedVehicleSeat(source) == 0 then 
            if door == 0 then 
                if position==0 then 
                    setVehicleDoorOpenRatio(vehicle, 0, 0, 0.5) 
                end 
                if position==100 then 
                    setVehicleDoorOpenRatio(vehicle, 0, 1, 0.5) 
                end 
                if position>0 and position<100 then 
                    setVehicleDoorOpenRatio(vehicle, 0, position/100, 0.5) 
                end 
            end 
            if door == 1 then 
                if position==0 then 
                    setVehicleDoorOpenRatio(vehicle, 1, 0, 0.5) 
                end 
                if position==100 then 
                    setVehicleDoorOpenRatio(vehicle, 1, 1, 0.5) 
                end 
                if position>0 and position<100 then 
                    setVehicleDoorOpenRatio(vehicle, 1, position/100, 0.5) 
                end 
            end 
        end 
    end 
end 
addEvent(":~", true) 
addEventHandler(":~", getRootElement(), openDoor) 
  
  
  
function enableVehicleControl() 
    if isPedInVehicle( localPlayer ) then 
        if guiGetVisible(GUIEditor_Window[1]) == false then 
            guiSetVisible(GUIEditor_Window[1], true) 
            showCursor(true) 
        else 
            guiSetVisible(GUIEditor_Window[1], false) 
            showCursor(false) 
        end 
    end 
end 
addCommandHandler("cveh", enableVehicleControl) 
  
function closeButton() 
        guiSetVisible(GUIEditor_Window[1], false) 
        showCursor(false) 
end 
addEventHandler ( "onClientGUIClick", GUIEditor_Button[1], closeButton, false ) 
  
function updateRatio(Scrolled) 
    local position = guiScrollBarGetScrollPosition(Scrolled) 
    local door = getElementData(Scrolled, "Type") 
    triggerServerEvent(":~", getLocalPlayer(), door, position) 
end 
addEventHandler("onClientGUIScroll", getRootElement(), updateRatio) 

Will fix it there as well =) + Thank you Prestege ^_^

:roll:

Link to comment

Okay so, now:

===cveh_c.lua===

------------------------------------ 
-- QUANTUMZ - QUANTUMZ - QUANTUMZ -- 
------------------------------------ 
--         2011 - Romania         --         
------------------------------------ 
-- You can modify this file but   -- 
-- don't change the credits.      -- 
------------------------------------ 
------------------------------------ 
--  VEHICLECONTROL v1.0 for MTA   -- 
------------------------------------ 
  
GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Label = {} 
GUIEditor_Scrollbar = {} 
  
  
  
GUIEditor_Window[1] = guiCreateWindow(709,236,272,288,"Jármû vezérlés",false) 
GUIEditor_Scrollbar[1] = guiCreateScrollBar(24,49,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[1] = guiCreateLabel(86,30,135,15,"Motorháztetõ",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[1],"default-bold-small") 
GUIEditor_Label[2] = guiCreateLabel(74,72,135,15,"Sofõr felöli ajtó",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[2],"default-bold-small") 
GUIEditor_Scrollbar[2] = guiCreateScrollBar(24,91,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[3] = guiCreateLabel(68,112,135,15,"Anyósülés felöli ajtó",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[3],"default-bold-small") 
GUIEditor_Scrollbar[3] = guiCreateScrollBar(24,130,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[4] = guiCreateLabel(71,151,135,15,"Sofõr mögötti hátsó ajtó",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[4],"default-bold-small") 
GUIEditor_Scrollbar[4] = guiCreateScrollBar(24,168,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[5] = guiCreateLabel(68,189,135,15,"Anyósülés mögötti hátsó ajtó",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[5],"default-bold-small") 
GUIEditor_Scrollbar[5] = guiCreateScrollBar(24,206,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[6] = guiCreateLabel(83,226,135,15,"Csomagtartó",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[6],"default-bold-small") 
GUIEditor_Scrollbar[6] = guiCreateScrollBar(24,243,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Button[1] = guiCreateButton(23,265,230,14,"Ablak bezárása",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[1],"default-small") 
guiWindowSetSizable ( GUIEditor_Window[1], false ) 
setElementData(GUIEditor_Scrollbar[1], "Type", 0) 
setElementData(GUIEditor_Scrollbar[2], "Type", 2) 
setElementData(GUIEditor_Scrollbar[3], "Type", 3) 
setElementData(GUIEditor_Scrollbar[4], "Type", 4) 
setElementData(GUIEditor_Scrollbar[5], "Type", 5) 
setElementData(GUIEditor_Scrollbar[6], "Type", 1) 
guiSetVisible(GUIEditor_Window[1], false) 
showCursor(false) 
  
  
  
function enableVehicleControl() 
    if isPedInVehicle( localPlayer ) then 
        if guiGetVisible(GUIEditor_Window[1]) == false then 
            guiSetVisible(GUIEditor_Window[1], true) 
            showCursor(true) 
        else 
            guiSetVisible(GUIEditor_Window[1], false) 
            showCursor(false) 
        end 
    end  
end 
addCommandHandler("cveh", enableVehicleControl) 
  
function closeButton() 
        guiSetVisible(GUIEditor_Window[1], false) 
        showCursor(false) 
end 
addEventHandler ( "onClientGUIClick", GUIEditor_Button[1], closeButton, false ) 
  
function updateRatio(Scrolled) 
    local position = guiScrollBarGetScrollPosition(Scrolled) 
    local door = getElementData(Scrolled, "Type") 
    triggerServerEvent("moveThisShit", getLocalPlayer(), door, position) 
end 
addEventHandler("onClientGUIScroll", getRootElement(), updateRatio) 

===cveh_s.lua===

    -- Server 
      
    function openDoor(door, position) 
        local vehicle = getPedOccupiedVehicle(source) 
        local Type = getElementModel( vehicle ) 
        local ID = 411 
        if ( Type == ID ) then 
            outputChatBox( "It's a BUS !", source, 255, 0, 0, true ) 
        else 
            if getPedOccupiedVehicleSeat(source) == 0 then 
                if door == 0 then 
                    if position==0 then 
                        setVehicleDoorOpenRatio(vehicle, 0, 0, 0.5) 
                    end 
                    if position==100 then 
                        setVehicleDoorOpenRatio(vehicle, 0, 1, 0.5) 
                    end 
                    if position>0 and position<100 then 
                        setVehicleDoorOpenRatio(vehicle, 0, position/100, 0.5) 
                    end 
                end 
                if door == 1 then 
                    if position==0 then 
                        setVehicleDoorOpenRatio(vehicle, 1, 0, 0.5) 
                    end 
                    if position==100 then 
                        setVehicleDoorOpenRatio(vehicle, 1, 1, 0.5) 
                    end 
                    if position>0 and position<100 then 
                        setVehicleDoorOpenRatio(vehicle, 1, position/100, 0.5) 
                    end 
                end 
            end 
        end 
    end 
    addEvent(":~", true) 
    addEventHandler(":~", getRootElement(), openDoor) 
      
      
      
    function enableVehicleControl() 
        if isPedInVehicle( localPlayer ) then 
            if guiGetVisible(GUIEditor_Window[1]) == false then 
                guiSetVisible(GUIEditor_Window[1], true) 
                showCursor(true) 
            else 
                guiSetVisible(GUIEditor_Window[1], false) 
                showCursor(false) 
            end 
        end 
    end 
    addCommandHandler("cveh", enableVehicleControl) 
      
    function closeButton() 
            guiSetVisible(GUIEditor_Window[1], false) 
            showCursor(false) 
    end 
    addEventHandler ( "onClientGUIClick", GUIEditor_Button[1], closeButton, false ) 
      
    function updateRatio(Scrolled) 
        local position = guiScrollBarGetScrollPosition(Scrolled) 
        local door = getElementData(Scrolled, "Type") 
        triggerServerEvent(":~", getLocalPlayer(), door, position) 
    end 
    addEventHandler("onClientGUIScroll", getRootElement(), updateRatio) 

When i type /cveh in the infernus, nothing happens, just a warning to the console:

Warning: resource/cveh/cveh_s.lua:42: Bad argument @ 'isPedInVehicle'

Link to comment

^^

No!

===cveh_c.lua===

------------------------------------ 
-- QUANTUMZ - QUANTUMZ - QUANTUMZ -- 
------------------------------------ 
--         2011 - Romania         --         
------------------------------------ 
-- You can modify this file but   -- 
-- don't change the credits.      -- 
------------------------------------ 
------------------------------------ 
--  VEHICLECONTROL v1.0 for MTA   -- 
------------------------------------ 
  
GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Label = {} 
GUIEditor_Scrollbar = {} 
  
  
  
GUIEditor_Window[1] = guiCreateWindow(709,236,272,288,"Vehicle Control",false) 
GUIEditor_Scrollbar[1] = guiCreateScrollBar(24,49,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[1] = guiCreateLabel(86,30,135,15,"1",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[1],"default-bold-small") 
GUIEditor_Label[2] = guiCreateLabel(74,72,135,15,"2",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[2],"default-bold-small") 
GUIEditor_Scrollbar[2] = guiCreateScrollBar(24,91,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[3] = guiCreateLabel(68,112,135,15,"3",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[3],"default-bold-small") 
GUIEditor_Scrollbar[3] = guiCreateScrollBar(24,130,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[4] = guiCreateLabel(71,151,135,15,"4",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[4],"default-bold-small") 
GUIEditor_Scrollbar[4] = guiCreateScrollBar(24,168,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[5] = guiCreateLabel(68,189,135,15,"5",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[5],"default-bold-small") 
GUIEditor_Scrollbar[5] = guiCreateScrollBar(24,206,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[6] = guiCreateLabel(83,226,135,15,"6",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[6],"default-bold-small") 
GUIEditor_Scrollbar[6] = guiCreateScrollBar(24,243,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Button[1] = guiCreateButton(23,265,230,14,"Close",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[1],"default-small") 
guiWindowSetSizable ( GUIEditor_Window[1], false ) 
setElementData(GUIEditor_Scrollbar[1], "Type", 0) 
setElementData(GUIEditor_Scrollbar[2], "Type", 2) 
setElementData(GUIEditor_Scrollbar[3], "Type", 3) 
setElementData(GUIEditor_Scrollbar[4], "Type", 4) 
setElementData(GUIEditor_Scrollbar[5], "Type", 5) 
setElementData(GUIEditor_Scrollbar[6], "Type", 1) 
guiSetVisible(GUIEditor_Window[1], false) 
showCursor(false) 
  
  
  
function enableVehicleControl() 
    local vehicle = getPedOccupiedVehicle(localPlayer)  
if ( vehicle ) and ( getElementModel( vehicle ) == 429 ) then 
        if guiGetVisible(GUIEditor_Window[1]) == false then 
            guiSetVisible(GUIEditor_Window[1], true) 
            showCursor(true) 
        else 
            guiSetVisible(GUIEditor_Window[1], false) 
            showCursor(false) 
        end 
    end  
end 
addCommandHandler("cveh", enableVehicleControl) 
  
function closeButton() 
        guiSetVisible(GUIEditor_Window[1], false) 
        showCursor(false) 
end 
addEventHandler ( "onClientGUIClick", GUIEditor_Button[1], closeButton, false ) 
  
function updateRatio(Scrolled) 
    local position = guiScrollBarGetScrollPosition(Scrolled) 
    local door = getElementData(Scrolled, "Type") 
    triggerServerEvent(":~", getLocalPlayer(), door, position) 
end 
addEventHandler("onClientGUIScroll", getRootElement(), updateRatio) 
  
  
  
  
  
     

===cveh_s.lua===

function openDoor(door, position) 
    local vehicle = getPedOccupiedVehicle(source) 
    if getPedOccupiedVehicleSeat(source) == 0 then 
        if door == 0 then 
            if position==0 then 
                setVehicleDoorOpenRatio(vehicle, 0, 0, 0.5) 
            end 
            if position==100 then 
                setVehicleDoorOpenRatio(vehicle, 0, 1, 0.5) 
            end 
            if position>0 and position<100 then 
                setVehicleDoorOpenRatio(vehicle, 0, position/100, 0.5) 
            end 
        end 
        if door == 1 then 
            if position==0 then 
                setVehicleDoorOpenRatio(vehicle, 1, 0, 0.5) 
            end 
            if position==100 then 
                setVehicleDoorOpenRatio(vehicle, 1, 1, 0.5) 
            end 
            if position>0 and position<100 then 
                setVehicleDoorOpenRatio(vehicle, 1, position/100, 0.5) 
            end 
        end 
    end 
end      
addEvent(":~", true) 
addEventHandler(":~", getRootElement(), openDoor) 
  
Link to comment
No it works with me! are you sure your vehicle id = 411 ? :? and show your meta please!

Sry, now it works! But just in Banshee (line 55 cveh_c.lua)

    if ( vehicle ) and ( getElementModel( vehicle ) == 429 ) then 

I think because this. But i need, that this command work in every car, except Infernus.

And i really need the message too, that: It's an infernus!

Link to comment

Client

------------------------------------ 
-- QUANTUMZ - QUANTUMZ - QUANTUMZ -- 
------------------------------------ 
--         2011 - Romania         --         
------------------------------------ 
-- You can modify this file but   -- 
-- don't change the credits.      -- 
------------------------------------ 
------------------------------------ 
--  VEHICLECONTROL v1.0 for MTA   -- 
------------------------------------ 
  
------------------------------------ 
-- QUANTUMZ - QUANTUMZ - QUANTUMZ -- 
------------------------------------ 
--         2011 - Romania         --         
------------------------------------ 
-- You can modify this file but   -- 
-- don't change the credits.      -- 
------------------------------------ 
------------------------------------ 
--  VEHICLECONTROL v1.0 for MTA   -- 
------------------------------------ 
  
GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Label = {} 
GUIEditor_Scrollbar = {} 
  
  
  
GUIEditor_Window[1] = guiCreateWindow(709,236,272,288,"Vehicle Control",false) 
GUIEditor_Scrollbar[1] = guiCreateScrollBar(24,49,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[1] = guiCreateLabel(86,30,135,15,"1",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[1],"default-bold-small") 
GUIEditor_Label[2] = guiCreateLabel(74,72,135,15,"2",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[2],"default-bold-small") 
GUIEditor_Scrollbar[2] = guiCreateScrollBar(24,91,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[3] = guiCreateLabel(68,112,135,15,"3",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[3],"default-bold-small") 
GUIEditor_Scrollbar[3] = guiCreateScrollBar(24,130,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[4] = guiCreateLabel(71,151,135,15,"4",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[4],"default-bold-small") 
GUIEditor_Scrollbar[4] = guiCreateScrollBar(24,168,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[5] = guiCreateLabel(68,189,135,15,"5",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[5],"default-bold-small") 
GUIEditor_Scrollbar[5] = guiCreateScrollBar(24,206,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[6] = guiCreateLabel(83,226,135,15,"6",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[6],"default-bold-small") 
GUIEditor_Scrollbar[6] = guiCreateScrollBar(24,243,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Button[1] = guiCreateButton(23,265,230,14,"Close",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[1],"default-small") 
guiWindowSetSizable ( GUIEditor_Window[1], false ) 
setElementData(GUIEditor_Scrollbar[1], "Type", 0) 
setElementData(GUIEditor_Scrollbar[2], "Type", 2) 
setElementData(GUIEditor_Scrollbar[3], "Type", 3) 
setElementData(GUIEditor_Scrollbar[4], "Type", 4) 
setElementData(GUIEditor_Scrollbar[5], "Type", 5) 
setElementData(GUIEditor_Scrollbar[6], "Type", 1) 
guiSetVisible(GUIEditor_Window[1], false) 
showCursor(false) 
  
  
  
function enableVehicleControl() 
    if isPedInVehicle( localPlayer ) then 
        local vehicle = getPedOccupiedVehicle ( localPlayer ) 
        local id = getElementModel ( vehicle ) 
        if ( id == 411 ) then 
            return outputChatBox ( "IT'S INFERNUS" ) 
        end 
        if guiGetVisible(GUIEditor_Window[1]) == false then 
            guiSetVisible(GUIEditor_Window[1], true) 
            showCursor(true) 
        else 
            guiSetVisible(GUIEditor_Window[1], false) 
            showCursor(false) 
        end 
    end 
end 
addCommandHandler("cveh", enableVehicleControl) 
  
function closeButton() 
        guiSetVisible(GUIEditor_Window[1], false) 
        showCursor(false) 
end 
addEventHandler ( "onClientGUIClick", GUIEditor_Button[1], closeButton, false ) 
  
function updateRatio(Scrolled) 
    local position = guiScrollBarGetScrollPosition(Scrolled) 
    local door = getElementData(Scrolled, "Type") 
    triggerServerEvent(":~", getLocalPlayer(), door, position) 
end 
addEventHandler("onClientGUIScroll", getRootElement(), updateRatio) 

Link to comment

===cveh_c.lua===

------------------------------------ 
-- QUANTUMZ - QUANTUMZ - QUANTUMZ -- 
------------------------------------ 
--         2011 - Romania         --         
------------------------------------ 
-- You can modify this file but   -- 
-- don't change the credits.      -- 
------------------------------------ 
------------------------------------ 
--  VEHICLECONTROL v1.0 for MTA   -- 
------------------------------------ 
  
GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Label = {} 
GUIEditor_Scrollbar = {} 
  
  
  
GUIEditor_Window[1] = guiCreateWindow(709,236,272,288,"Vehicle Control",false) 
GUIEditor_Scrollbar[1] = guiCreateScrollBar(24,49,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[1] = guiCreateLabel(86,30,135,15,"1",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[1],"default-bold-small") 
GUIEditor_Label[2] = guiCreateLabel(74,72,135,15,"2",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[2],"default-bold-small") 
GUIEditor_Scrollbar[2] = guiCreateScrollBar(24,91,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[3] = guiCreateLabel(68,112,135,15,"3",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[3],"default-bold-small") 
GUIEditor_Scrollbar[3] = guiCreateScrollBar(24,130,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[4] = guiCreateLabel(71,151,135,15,"4",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[4],"default-bold-small") 
GUIEditor_Scrollbar[4] = guiCreateScrollBar(24,168,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[5] = guiCreateLabel(68,189,135,15,"5",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[5],"default-bold-small") 
GUIEditor_Scrollbar[5] = guiCreateScrollBar(24,206,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[6] = guiCreateLabel(83,226,135,15,"6",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[6],"default-bold-small") 
GUIEditor_Scrollbar[6] = guiCreateScrollBar(24,243,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Button[1] = guiCreateButton(23,265,230,14,"Close",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[1],"default-small") 
guiWindowSetSizable ( GUIEditor_Window[1], false ) 
setElementData(GUIEditor_Scrollbar[1], "Type", 0) 
setElementData(GUIEditor_Scrollbar[2], "Type", 2) 
setElementData(GUIEditor_Scrollbar[3], "Type", 3) 
setElementData(GUIEditor_Scrollbar[4], "Type", 4) 
setElementData(GUIEditor_Scrollbar[5], "Type", 5) 
setElementData(GUIEditor_Scrollbar[6], "Type", 1) 
guiSetVisible(GUIEditor_Window[1], false) 
showCursor(false) 
  
  
  
function enableVehicleControl() 
    local vehicle = getPedOccupiedVehicle(localPlayer)  
if ( vehicle ) and ( getElementModel( vehicle ) ~= 411 ) then 
        if guiGetVisible(GUIEditor_Window[1]) == false then 
            guiSetVisible(GUIEditor_Window[1], true) 
            showCursor(true) 
        else 
            guiSetVisible(GUIEditor_Window[1], false) 
            showCursor(false) 
        end 
    end  
end 
addCommandHandler("cveh", enableVehicleControl) 
  
function closeButton() 
        guiSetVisible(GUIEditor_Window[1], false) 
        showCursor(false) 
end 
addEventHandler ( "onClientGUIClick", GUIEditor_Button[1], closeButton, false ) 
  
function updateRatio(Scrolled) 
    local position = guiScrollBarGetScrollPosition(Scrolled) 
    local door = getElementData(Scrolled, "Type") 
    triggerServerEvent(":~", getLocalPlayer(), door, position) 
end 
addEventHandler("onClientGUIScroll", getRootElement(), updateRatio) 
  
  
  
  
  
     

===cveh_s.lua===

function openDoor(door, position) 
    local vehicle = getPedOccupiedVehicle(source) 
    if getPedOccupiedVehicleSeat(source) == 0 then 
        if door == 0 then 
            if position==0 then 
                setVehicleDoorOpenRatio(vehicle, 0, 0, 0.5) 
            end 
            if position==100 then 
                setVehicleDoorOpenRatio(vehicle, 0, 1, 0.5) 
            end 
            if position>0 and position<100 then 
                setVehicleDoorOpenRatio(vehicle, 0, position/100, 0.5) 
            end 
        end 
        if door == 1 then 
            if position==0 then 
                setVehicleDoorOpenRatio(vehicle, 1, 0, 0.5) 
            end 
            if position==100 then 
                setVehicleDoorOpenRatio(vehicle, 1, 1, 0.5) 
            end 
            if position>0 and position<100 then 
                setVehicleDoorOpenRatio(vehicle, 1, position/100, 0.5) 
            end 
        end 
    end 
end      
addEvent(":~", true) 
addEventHandler(":~", getRootElement(), openDoor) 
  
Link to comment
Client
------------------------------------ 
-- QUANTUMZ - QUANTUMZ - QUANTUMZ -- 
------------------------------------ 
--         2011 - Romania         --         
------------------------------------ 
-- You can modify this file but   -- 
-- don't change the credits.      -- 
------------------------------------ 
------------------------------------ 
--  VEHICLECONTROL v1.0 for MTA   -- 
------------------------------------ 
  
------------------------------------ 
-- QUANTUMZ - QUANTUMZ - QUANTUMZ -- 
------------------------------------ 
--         2011 - Romania         --         
------------------------------------ 
-- You can modify this file but   -- 
-- don't change the credits.      -- 
------------------------------------ 
------------------------------------ 
--  VEHICLECONTROL v1.0 for MTA   -- 
------------------------------------ 
  
GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Label = {} 
GUIEditor_Scrollbar = {} 
  
  
  
GUIEditor_Window[1] = guiCreateWindow(709,236,272,288,"Vehicle Control",false) 
GUIEditor_Scrollbar[1] = guiCreateScrollBar(24,49,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[1] = guiCreateLabel(86,30,135,15,"1",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[1],"default-bold-small") 
GUIEditor_Label[2] = guiCreateLabel(74,72,135,15,"2",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[2],"default-bold-small") 
GUIEditor_Scrollbar[2] = guiCreateScrollBar(24,91,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[3] = guiCreateLabel(68,112,135,15,"3",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[3],"default-bold-small") 
GUIEditor_Scrollbar[3] = guiCreateScrollBar(24,130,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[4] = guiCreateLabel(71,151,135,15,"4",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[4],"default-bold-small") 
GUIEditor_Scrollbar[4] = guiCreateScrollBar(24,168,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[5] = guiCreateLabel(68,189,135,15,"5",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[5],"default-bold-small") 
GUIEditor_Scrollbar[5] = guiCreateScrollBar(24,206,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[6] = guiCreateLabel(83,226,135,15,"6",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[6],"default-bold-small") 
GUIEditor_Scrollbar[6] = guiCreateScrollBar(24,243,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Button[1] = guiCreateButton(23,265,230,14,"Close",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[1],"default-small") 
guiWindowSetSizable ( GUIEditor_Window[1], false ) 
setElementData(GUIEditor_Scrollbar[1], "Type", 0) 
setElementData(GUIEditor_Scrollbar[2], "Type", 2) 
setElementData(GUIEditor_Scrollbar[3], "Type", 3) 
setElementData(GUIEditor_Scrollbar[4], "Type", 4) 
setElementData(GUIEditor_Scrollbar[5], "Type", 5) 
setElementData(GUIEditor_Scrollbar[6], "Type", 1) 
guiSetVisible(GUIEditor_Window[1], false) 
showCursor(false) 
  
  
  
function enableVehicleControl() 
    if isPedInVehicle( localPlayer ) then 
        local vehicle = getPedOccupiedVehicle ( localPlayer ) 
        local id = getElementModel ( vehicle ) 
        if ( id == 411 ) then 
            return outputChatBox ( "IT'S INFERNUS" ) 
        end 
        if guiGetVisible(GUIEditor_Window[1]) == false then 
            guiSetVisible(GUIEditor_Window[1], true) 
            showCursor(true) 
        else 
            guiSetVisible(GUIEditor_Window[1], false) 
            showCursor(false) 
        end 
    end 
end 
addCommandHandler("cveh", enableVehicleControl) 
  
function closeButton() 
        guiSetVisible(GUIEditor_Window[1], false) 
        showCursor(false) 
end 
addEventHandler ( "onClientGUIClick", GUIEditor_Button[1], closeButton, false ) 
  
function updateRatio(Scrolled) 
    local position = guiScrollBarGetScrollPosition(Scrolled) 
    local door = getElementData(Scrolled, "Type") 
    triggerServerEvent(":~", getLocalPlayer(), door, position) 
end 
addEventHandler("onClientGUIScroll", getRootElement(), updateRatio) 

Now, that's what i need! Thank you!

===cveh_c.lua===

------------------------------------ 
-- QUANTUMZ - QUANTUMZ - QUANTUMZ -- 
------------------------------------ 
--         2011 - Romania         --         
------------------------------------ 
-- You can modify this file but   -- 
-- don't change the credits.      -- 
------------------------------------ 
------------------------------------ 
--  VEHICLECONTROL v1.0 for MTA   -- 
------------------------------------ 
  
GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Label = {} 
GUIEditor_Scrollbar = {} 
  
  
  
GUIEditor_Window[1] = guiCreateWindow(709,236,272,288,"Vehicle Control",false) 
GUIEditor_Scrollbar[1] = guiCreateScrollBar(24,49,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[1] = guiCreateLabel(86,30,135,15,"1",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[1],"default-bold-small") 
GUIEditor_Label[2] = guiCreateLabel(74,72,135,15,"2",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[2],"default-bold-small") 
GUIEditor_Scrollbar[2] = guiCreateScrollBar(24,91,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[3] = guiCreateLabel(68,112,135,15,"3",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[3],"default-bold-small") 
GUIEditor_Scrollbar[3] = guiCreateScrollBar(24,130,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[4] = guiCreateLabel(71,151,135,15,"4",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[4],"default-bold-small") 
GUIEditor_Scrollbar[4] = guiCreateScrollBar(24,168,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[5] = guiCreateLabel(68,189,135,15,"5",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[5],"default-bold-small") 
GUIEditor_Scrollbar[5] = guiCreateScrollBar(24,206,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Label[6] = guiCreateLabel(83,226,135,15,"6",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[6],"default-bold-small") 
GUIEditor_Scrollbar[6] = guiCreateScrollBar(24,243,225,17,true,false,GUIEditor_Window[1]) 
GUIEditor_Button[1] = guiCreateButton(23,265,230,14,"Close",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[1],"default-small") 
guiWindowSetSizable ( GUIEditor_Window[1], false ) 
setElementData(GUIEditor_Scrollbar[1], "Type", 0) 
setElementData(GUIEditor_Scrollbar[2], "Type", 2) 
setElementData(GUIEditor_Scrollbar[3], "Type", 3) 
setElementData(GUIEditor_Scrollbar[4], "Type", 4) 
setElementData(GUIEditor_Scrollbar[5], "Type", 5) 
setElementData(GUIEditor_Scrollbar[6], "Type", 1) 
guiSetVisible(GUIEditor_Window[1], false) 
showCursor(false) 
  
  
  
function enableVehicleControl() 
    local vehicle = getPedOccupiedVehicle(localPlayer)  
if ( vehicle ) and ( getElementModel( vehicle ) ~= 411 ) then 
        if guiGetVisible(GUIEditor_Window[1]) == false then 
            guiSetVisible(GUIEditor_Window[1], true) 
            showCursor(true) 
        else 
            guiSetVisible(GUIEditor_Window[1], false) 
            showCursor(false) 
        end 
    end  
end 
addCommandHandler("cveh", enableVehicleControl) 
  
function closeButton() 
        guiSetVisible(GUIEditor_Window[1], false) 
        showCursor(false) 
end 
addEventHandler ( "onClientGUIClick", GUIEditor_Button[1], closeButton, false ) 
  
function updateRatio(Scrolled) 
    local position = guiScrollBarGetScrollPosition(Scrolled) 
    local door = getElementData(Scrolled, "Type") 
    triggerServerEvent(":~", getLocalPlayer(), door, position) 
end 
addEventHandler("onClientGUIScroll", getRootElement(), updateRatio) 
  
  
  
  
  
     

===cveh_s.lua===

function openDoor(door, position) 
    local vehicle = getPedOccupiedVehicle(source) 
    if getPedOccupiedVehicleSeat(source) == 0 then 
        if door == 0 then 
            if position==0 then 
                setVehicleDoorOpenRatio(vehicle, 0, 0, 0.5) 
            end 
            if position==100 then 
                setVehicleDoorOpenRatio(vehicle, 0, 1, 0.5) 
            end 
            if position>0 and position<100 then 
                setVehicleDoorOpenRatio(vehicle, 0, position/100, 0.5) 
            end 
        end 
        if door == 1 then 
            if position==0 then 
                setVehicleDoorOpenRatio(vehicle, 1, 0, 0.5) 
            end 
            if position==100 then 
                setVehicleDoorOpenRatio(vehicle, 1, 1, 0.5) 
            end 
            if position>0 and position<100 then 
                setVehicleDoorOpenRatio(vehicle, 1, position/100, 0.5) 
            end 
        end 
    end 
end      
addEvent(":~", true) 
addEventHandler(":~", getRootElement(), openDoor) 
  

It's good, just the message is missing. Thank you for your lots of help too. :)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...