Blockland Welcome, Guest. Please login or register.
Did you miss your activation email?
July 22, 2017, 02:51:14 PM

Home Help Login Register
+  Blockland Forum
|-+  Blockland Files
| |-+  Add-Ons
| | |-+  Vehicle Locking [v1.2]
Pages: [1] 2
Poll
Question: Should I make a seperate model/color for the car key?
Yes   -20 (90.9%)
No   -2 (9.1%)
Total Voters: 22

Author Topic: Vehicle Locking [v1.2]  (Read 1859 times)
ZombieDude

« June 21, 2016, 04:32:02 PM »

    Vehicle Locking
    Requires Item_Key (default)

    Are you tired of newbies stealing your jeep? Now, you can just use a Car Key or type /togglelock to ensure that nobody can take it. (except for Super Admins..)

    Features
    • You can spawn a Car Key item with a brick to use on planes or cars that you own.
    • To claim ownership of a vehicle, just jump inside of it for the first time. It's that simple. From then on, you can use Car Keys or..
    • /togglelock! Looking at a vehicle you own and typing /togglelock will lock or unlock it (depending on what it was) without the need of a Car Key.
      • There are now two preferences, whether admins are allowed to unlock any car and what level an admin has to be at (Admin/SuperAdmin/Host) to be able to do it.

    Notes
    Unfortunately, the Car Key doesn't work on vehicles like cannons or tank turrets that you can move around just by looking. (Another example are Filipe's Bikes)
    This is because they are technically classified as AIPlayers, meaning if I added functionality for them you would be able to lock and unlock bots, zombies, and other AIPlayers which is sort of weird. If enough people request it I can try to make something work exclusively for those vehicles though.

    Video Demo

    Download! [v1.2] (Dropbox, Justfilehosting is down)

    Old Versions
    v1: download
    v1.1: download[/list]
    « Last Edit: June 23, 2016, 11:22:21 AM by ZombieDude » Logged
    Ad Bot

    « Full members do not see ads »

    Hawt

    « June 21, 2016, 04:35:38 PM »

    this'll be great for CityRPGs...
    Logged
    Insert Name Here²

    « June 21, 2016, 04:36:35 PM »

    Amazing! This will be very useful!

    Is there a pref or something where it allows admins to enter locked cars or not, and select the admin power level of allowance?
    Logged
    ZombieDude

    « June 21, 2016, 04:37:13 PM »

    this'll be great for CityRPGs...
    that's mostly what i made this for yes
    Amazing! This will be very useful!

    Is there a pref or something where it allows admins to enter locked cars or not, and select the admin power level of allowance?
    no, but i can add it.
    by admin power level do you mean like admin/superadmin/host?
    Logged
    Insert Name Here²

    « June 21, 2016, 05:13:57 PM »

    no, but i can add it.
    by admin power level do you mean like admin/superadmin/host?
    Yeah
    Logged
    ZombieDude

    « June 21, 2016, 05:15:38 PM »

    Yeah

    Version 1.1

    • There are now two preferences! (for RTB and Blockland Glass, or editable in server.cs)
    • 1. Admin Allowance: Whether admins are allowed to unlock any car or not
    • 2. Admin Level: What level (Admin/SuperAdmin/Host) an admin must be at to unlock any car
    Download
    « Last Edit: June 21, 2016, 07:33:26 PM by ZombieDude » Logged
    Insert Name Here²

    « June 21, 2016, 05:25:56 PM »

    Awesooooooooooooome
    Logged
    Conan

    « June 21, 2016, 06:07:08 PM »

    for bot vehicles you can check if they're ridable. though locking a horse seems weird, its weird in a quirky blocklandy way so it might be okay

    otherwise you could check if the uiname/datablockname includes the string "bike" or "boat"with strpos
    Logged
    Drydess

    « June 21, 2016, 06:40:57 PM »

    It'd be cool if you could add people to a whitelist for it, and if that's too complicated then just make it so that people with full trust could enter your car
    Logged
    ZombieDude

    « June 21, 2016, 06:42:34 PM »

    It'd be cool if you could add people to a whitelist for it, and if that's too complicated then just make it so that people with full trust could enter your car
    by enter do you mean while its locked or do you mean be able to unlock it and enter?
    i can do both pretty easily but the former i would have to make people able to enter while its locked which isnt that difficult
    for bot vehicles you can check if they're ridable. though locking a horse seems weird, its weird in a quirky blocklandy way so it might be okay

    otherwise you could check if the uiname/datablockname includes the string "bike" or "boat"with strpos
    yeah i was thinking checking if it was ridable or not which would actually work, but i'm not sure how to do that
    « Last Edit: June 21, 2016, 06:44:07 PM by ZombieDude » Logged
    Drydess

    « June 21, 2016, 06:46:16 PM »

    by enter do you mean while its locked or do you mean be able to unlock it and enter?
    i can do both pretty easily but the former i would have to make people able to enter while its locked which isnt that difficultyeah i was thinking checking if it was ridable or not which would actually work, but i'm not sure how to do that
    sorry for not clarifying, the former as you said is what I meant
    Logged
    ZombieDude

    « June 21, 2016, 06:48:46 PM »

    sorry for not clarifying, the former as you said is what I meant
    currently nobody is able to enter it if its locked
    i'd have to change it so the owner of the vehicle could get in which i guess is ok
    Logged
    Conan

    « June 21, 2016, 06:52:39 PM »

    yeah i was thinking checking if it was ridable or not which would actually work, but i'm not sure how to do that
    %obj.getDatablock().canRide

    or maybe even %obj.canRide, if that attribute is passed down to the %obj. I forget.
    Logged
    ZombieDude

    « June 21, 2016, 06:53:51 PM »

    %obj.getDatablock().canRide

    or maybe even %obj.canRide, if that attribute is passed down to the %obj. I forget.
    that's nifty
    im working on v2 which will have that and drydess' request
    Logged
    ZombieDude

    « June 21, 2016, 07:30:01 PM »

    just found a kinda big bug with prefs, please re-download from the link if you downloaded it before
    Logged
    Pages: [1] 2  


    Login with username, password and session length

    Powered by SMF 1.1.20 | SMF © 2013, Simple Machines
    Page created in 0.034 seconds with 20 queries.