Jump to content

Help Scripting!


Recommended Posts

Posted
--Use this 
  
getElementModel 
setVehicleLocked 
isVehicleLocked 
  
Maybe "outputChatbox" or a "DxDraw" 

"If debugging is the process of removing software bugs, then programming must be the process of putting them in."

  • Moderators
Posted

If he does, he is making it for you..... Requests are not allowed here.

You should read wiki mta and make it your self. It is isn't a big deal.

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

Posted

skinid = getElementModel(source)

carid = getElementModel(596)

if skinid==280 or skinid==281 or skinid==282 and carid==596 or carid==598 or carid==597 and isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "police" ) ) then

else

setVehicleLocked ( 596, true )

setVehicleLocked ( 598, true )

setVehicleLocked ( 597, true )

end

is it this?

3231504.png
  • Moderators
Posted

Where is your event? Your function?

Btw:

carid = getElementModel(vehicle) -- not a car id. 
-- and 
if (skinid==280 or skinid==281 or skinid==282 and carid==596 or carid==598 or carid==597) and isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "police" ) ) then 

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

Posted

function vehicle() 
carid = getElementModel(vehicle) -- not a car id. 
-- and 
if (skinid==280 or skinid==281 or skinid==282 and carid==596 or carid==598 or carid==597) and isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "police" ) ) then 
else 
setVehicleLocked ( 596, true ) 
setVehicleLocked ( 598, true ) 
setVehicleLocked ( 597, true ) 
end 
addEventHandler("isVehicleLocked",vehicle) 

So is it like this?

3231504.png
  • Moderators
Posted

no.

use:

https://wiki.multitheftauto.com/wiki/OnVehicleEnter

setVehicleLocked ( 596, true )

a number isn't a vehicle.

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

  • Moderators
Posted

BiiLLY +1

Well onVehicleStartEnter can be canceled, but you can also remove the player from the vehicle by using removePedFromVehicle after onVehicleEnter. It is just what you want.

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

Posted
BiiLLY +1

Well onVehicleStartEnter can be canceled, but you can also remove the player from the vehicle by using removePedFromVehicle after onVehicleEnter. It is just what you want.

This is done on a Reallife Server where I played on... so I'll suggest to use that.

"If debugging is the process of removing software bugs, then programming must be the process of putting them in."

  • Moderators
Posted
So, they aren't different events.

They are but a scripter always have a choose.

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

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