Jump to content

[REL] Private cars


WhoAmI

Recommended Posts

Hello.

Today i'm releasing a resource which I made today called 'Private cars'.

It's private cars system which saves car to player's account.

Features:

- saving last position, color and upgrades before script is restarted

- save to SQL/MySQL

- fully configurable

- creation panel if you hit 'Z' key or type /privatecars

Thre are some exported functions:

createPrivateVehicle ( int model, int x, int y, int z, int rotX, int rotY, int rotZ, table color, table upgrades, string accName ) 

table color should looks like { r, g, b, r1, g1, b1, r2, g2, b2, r3, g3, b3, r4, g4, b4 }

Returns vehicle element if succesfully, false otherwise.

isCarPrivate ( element vehicle ) 

Returns true if car is private, false otherwise.

getPrivateCarOwner ( element vehicle ) 

Returns owner's account name, false otherwise.

All functions are serverside.

There are some built-in commands:

/carinfo

There are some screenshots:

http://imgur.com/sMiYSLj,UpFjofz,mu5wL58

sMiYSLj.jpg

UpFjofz.jpg

mu5wL58.jpg

Configuration file

--[[ 
    PRIVATE CARS 
    by WhoAmI (aka Jacob) 
    You are able to modify the script, if you don't change author. 
    #config.lua 
]]-- 
  
--[[ change if you wish 
    availible values: 
        - MySQL 
        - SQL 
]]-- 
connectionType = "SQL"; 
  
-- ONLY if you chose MySQL 
MySQLdbhost = "localhost"; -- host 
MySQLdbname = "test"; -- database name 
MySQLdbuser = "root"; -- database user 
MySQLdbpassword = ""; -- user's password 
-- end 
  
-- ONLY if you chose SQL 
SQLfilename = "example.db"; -- choose name for databse file 
--[[ WARNING! without ".db" at the and it won't work. 
     REMEMBER! you have to add following line to meta.xml: 
          <file src="YOUR_NAME.db" /> 
     AND create this file! 
     otherwise, SQL won't work. REMEMBER! 
end ]]-- 
  
  
-- ACL groups allowed to create private car 
aclGroups = { 
    "Admin", 
    "Moderator", 
}; 
-- end 
  
-- ACL groups allowed to see car info 
aclGroupsInfo = { 
    "Everyone", 
}; 
-- end 
  
-- command name for car's information 
carInfoCommandName = "carinfo"; 
-- end 
  
-- time after the vehicle will be fixed after explosion IN SECONDS 
respawnTime = 10; 
-- end 

Download

https://community.multitheftauto.com/index.php?p= ... s&id=11268

I didn't test everything propperly, so there may be some bugs, but report it to me.

Have fun!

Edited by Guest
Link to comment
  • 8 months later...

Very nice script man, good job! But I have a question. Is this possible to remove/destroy private cars? So, for example if you want money you can go to the junkyard and destroy it. Then it will remove the table from SQL and destroys the car. So, a new export function to destroy cars. Or admins can delete cars by vehicle IDs (I mean the element data, because I can see that there is a "private" ID for each cars). It would be nice!

EDIT: I'm edited your code, now it can store the secondary color of the car, and added some features, like if you exit the vehicle then the engine will turn off and if the lights are on then they will turn off as well, and if you enter the vehicle then the engine will turn on, and the lights based on time. So if it's night then they will turn on. Added information for admins if the arguments are wrong of /create command. I want to add one more feature, that the script stores the vehicle's health. Hope that it's not a problem. :)

Rated 5/5

Link to comment
  • 3 months later...

Updated.

https://community.multitheftauto.com/index.php?p= ... s&id=11268

sMiYSLj.jpg

UpFjofz.jpg

mu5wL58.jpg

Configuration file

--[[ 
    PRIVATE CARS 
    by WhoAmI (aka Jacob) 
    You are able to modify the script, if you don't change author. 
    #config.lua 
]]-- 
  
--[[ change if you wish 
    availible values: 
        - MySQL 
        - SQL 
]]-- 
connectionType = "SQL"; 
  
-- ONLY if you chose MySQL 
MySQLdbhost = "localhost"; -- host 
MySQLdbname = "test"; -- database name 
MySQLdbuser = "root"; -- database user 
MySQLdbpassword = ""; -- user's password 
-- end 
  
-- ONLY if you chose SQL 
SQLfilename = "example.db"; -- choose name for databse file 
--[[ WARNING! without ".db" at the and it won't work. 
     REMEMBER! you have to add following line to meta.xml: 
          <file src="YOUR_NAME.db" /> 
     AND create this file! 
     otherwise, SQL won't work. REMEMBER! 
end ]]-- 
  
  
-- ACL groups allowed to create private car 
aclGroups = { 
    "Admin", 
    "Moderator", 
}; 
-- end 
  
-- ACL groups allowed to see car info 
aclGroupsInfo = { 
    "Everyone", 
}; 
-- end 
  
-- command name for car's information 
carInfoCommandName = "carinfo"; 
-- end 
  
-- time after the vehicle will be fixed after explosion IN SECONDS 
respawnTime = 10; 
-- end 

Whole script have been re-written. I tried using as much OOP as I can.

Please report bugs.

Have fun.

Link to comment
  • 4 weeks later...
  • 10 months later...
Hello.

Today i'm releasing a resource which I made today called 'Van Rental New Zealand'.

It's private cars system which saves car to player's account.

Features:

- saving last position, color and upgrades before script is restarted

- save to SQL/MySQL

- fully configurable

- creation panel if you hit 'Z' key or type /privatecars

Thre are some exported functions:

createPrivateVehicle ( int model, int x, int y, int z, int rotX, int rotY, int rotZ, table color, table upgrades, string accName ) 

table color should looks like { r, g, b, r1, g1, b1, r2, g2, b2, r3, g3, b3, r4, g4, b4 }

Returns vehicle element if succesfully, false otherwise.

isCarPrivate ( element vehicle ) 

Returns true if car is private, false otherwise.

getPrivateCarOwner ( element vehicle ) 

Returns owner's account name, false otherwise.

All functions are serverside.

There are some built-in commands:

/carinfo

There are some screenshots:

http://imgur.com/sMiYSLj,UpFjofz,mu5wL58

sMiYSLj.jpg

UpFjofz.jpg

mu5wL58.jpg

Configuration file

--[[ 
    PRIVATE CARS 
    by WhoAmI (aka Jacob) 
    You are able to modify the script, if you don't change author. 
    #config.lua 
]]-- 
  
--[[ change if you wish 
    availible values: 
        - MySQL 
        - SQL 
]]-- 
connectionType = "SQL"; 
  
-- ONLY if you chose MySQL 
MySQLdbhost = "localhost"; -- host 
MySQLdbname = "test"; -- database name 
MySQLdbuser = "root"; -- database user 
MySQLdbpassword = ""; -- user's password 
-- end 
  
-- ONLY if you chose SQL 
SQLfilename = "example.db"; -- choose name for databse file 
--[[ WARNING! without ".db" at the and it won't work. 
     REMEMBER! you have to add following line to meta.xml: 
          <file src="YOUR_NAME.db" /> 
     AND create this file! 
     otherwise, SQL won't work. REMEMBER! 
end ]]-- 
  
  
-- ACL groups allowed to create private car 
aclGroups = { 
    "Admin", 
    "Moderator", 
}; 
-- end 
  
-- ACL groups allowed to see car info 
aclGroupsInfo = { 
    "Everyone", 
}; 
-- end 
  
-- command name for car's information 
carInfoCommandName = "carinfo"; 
-- end 
  
-- time after the vehicle will be fixed after explosion IN SECONDS 
respawnTime = 10; 
-- end 

Download

https://community.multitheftauto.com/index.php?p= ... s&id=11268

I didn't test everything propperly, so there may be some bugs, but report it to me.

Have fun!

Thanks for this script and you done a great job.

Link to comment
  • 3 years later...

Okay, I have a few questions:

- How to remove vehicle?

- How to "respawn" vehicle on a specific place if it is in the water?

- How to add a team vehicle?

- How to freeze it, but players in acl mechanic can get it with towtruck?

- Is there any admin panel to modify, edit or remove vehicles?

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