Jump to content

Lock command.


[Ska]Vladmo

Recommended Posts

Hey I was just wondering if you can just give me a lock command resource or function with the addcommand. One that when you /lock it locks and when you type /lock again your vehicle unlocks, thanks if you can give me a download or a function, don't tell me that this isn't possible... it's on every server I play...

Link to comment
Not tested...
  
function lockVehicle(theVehicle) 
   local lockedParam = getElementData(theVehicle, "lockedParam") 
   setVehicleLocked(theVehicle, lockedParam) 
   setElementData(theVehicle, "lockedParam", (not lockedParam)) 
end 
  

What does it do..?? Nothing! If you havn't tested it then why post it, it's good to show your work but it does nothing all it does is says a function that does nothing.
Link to comment
Not tested...
  
function lockVehicle(theVehicle) 
   local lockedParam = getElementData(theVehicle, "lockedParam") 
   setVehicleLocked(theVehicle, lockedParam) 
   setElementData(theVehicle, "lockedParam", (not lockedParam)) 
end 
  

What does it do..?? Nothing! If you havn't tested it then why post it, it's good to show your work but it does nothing all it does is says a function that does nothing.

You really have to work on your attitude. I am trying to help here. This isn't a restaurant where you can just walk in and expect us to serve you like that. Instead you could ask me kindly what this function does and how it works. So ask NICELY!

Link to comment
Not tested...
  
function lockVehicle(theVehicle) 
   local lockedParam = getElementData(theVehicle, "lockedParam") 
   setVehicleLocked(theVehicle, lockedParam) 
   setElementData(theVehicle, "lockedParam", (not lockedParam)) 
end 
  

What does it do..?? Nothing! If you havn't tested it then why post it, it's good to show your work but it does nothing all it does is says a function that does nothing.

You really have to work on your attitude. I am trying to help here. This isn't a restaurant where you can just walk in and expect us to serve you like that. Instead you could ask me kindly what this function does and how it works. So ask NICELY!

Sorry, does that solve it? And also I didn't just come(not walk it's a computer) and expect you to serve me like that it's just if you know it doesn't work... then why post it?

Link to comment
function lockcar(thePlayer) 
    playervehicle=getPlayerOccupiedVehicle(thePlayer); 
    if(playervehicle) then 
        if(isVehicleLocked(playervehicle)) then 
            setVehicleLocked(playervehicle,false); 
            outputChatBox("Vehicle Unlocked",thePlayer,255,0,0); 
        else 
            setVehicleLocked(playervehicle,true); 
            outputChatBox("Vehicle Locked",thePlayer,255,0,0); 
        end 
    end 
end 
  
function exit(player,seat,jacked) 
    if(isVehicleLocked(source)) then 
        setVehicleLocked(source,false); 
        outputChatBox("Vehicle Unlocked",player,255,0,0); 
    end 
end 
  
addCommandHandler("lock",lockcar); 
addEventHandler("onVehicleExit",getRootElement(),exit); 

Link to comment
function lockcar(thePlayer) 
    playervehicle=getPlayerOccupiedVehicle(thePlayer); 
    if(playervehicle) then 
        if(isVehicleLocked(playervehicle)) then 
            setVehicleLocked(playervehicle,false); 
            outputChatBox("Vehicle Unlocked",thePlayer,255,0,0); 
        else 
            setVehicleLocked(playervehicle,true); 
            outputChatBox("Vehicle Locked",thePlayer,255,0,0); 
        end 
    end 
end 
  
function exit(player,seat,jacked) 
    if(isVehicleLocked(source)) then 
        setVehicleLocked(source,false); 
        outputChatBox("Vehicle Unlocked",player,255,0,0); 
    end 
end 
  
addCommandHandler("lock",lockcar); 
addEventHandler("onVehicleExit",getRootElement(),exit); 

Thanks

Link to comment

Sorry, does that solve it? And also I didn't just come(not walk it's a computer) and expect you to serve me like that it's just if you know it doesn't work... then why post it?

If you expect everything they tell you on this forum to work then I suggest you gtf out of ehre and make your own scripts, everyone is learning here, so instead of acting like an a** you could try appreciate the help you're getting.

Link to comment

Sorry, does that solve it? And also I didn't just come(not walk it's a computer) and expect you to serve me like that it's just if you know it doesn't work... then why post it?

If you expect everything they tell you on this forum to work then I suggest you gtf out of ehre and make your own scripts, everyone is learning here, so instead of acting like an a** you could try appreciate the help you're getting.

If expect to talk to other people like that on a caring forum then I suggest you gtfo of here and go to a mad mad place.

Link to comment

Sorry, does that solve it? And also I didn't just come(not walk it's a computer) and expect you to serve me like that it's just if you know it doesn't work... then why post it?

If you expect everything they tell you on this forum to work then I suggest you gtf out of here and make your own scripts, everyone is learning here, so instead of acting like an a** you could try appreciate the help you're getting.

If expect to talk to other people like that on a caring forum then I suggest you gtfo of here and go to a mad mad place.

Is that supposed to make sense?

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...