Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- event onLoad(){
- database.execute("CREATE TABLE garage(
- id VARCHAR(17) PRIMARY KEY,
- Garage1 INT NOT NULL DEFAULT 0,
- Garage2 INT NOT NULL DEFAULT 0
- );");
- }
- event onPlayerJoined(player){
- x = database.execute("SELECT * FROM garage WHERE id = '" + player.id + "';");
- if(x.count == 0){
- database.execute("INSERT INTO garage (id, Garage1, Garage2) VALUES ('" + player.id + "', 0, 0);");
- }
- }
- command garage1() {
- permission = "test";
- execute(){
- c = database.execute("SELECT * FROM garage WHERE Garage1 = '" + player.id + "';");
- vehicle = player.look.getVehicle();
- if(c.count == 0){
- x = vehicle.id;
- database.execute(str.format("UPDATE garage SET Garage1 = '" + x + "' WHERE id = '{0}';", player.id));
- player.message("Guardaste correctamente tu vehiculo en el Garage 1.");
- vehicle.destroy;
- }else{
- player.message("Ya tienes un vehiculo guardado en este garage.");
- }
- }
- }
- command glist(){
- permission = "garage";
- execute() {
- y = database.execute(str.format("Select * FROM garage WHERE id = '{0}';", player.id));
- y = y[0];
- Garage1 = y[1];
- Garage2 = y[2];
- player.message("En el garage 1 tienes el vehiculo: " + Garage1 + " Y en el garage 2 tienes el vehiculo: " + Garage2);
- }
- }
- command gretrieve1() {
- permission = "test";
- execute() {
- pos = player.position;
- pos.y = pos.y + 10;
- y = database.execute(str.format("Select * FROM garage WHERE id = '{0}';", player.id));
- y = y[0];
- Garage1 = y[1];
- Garage2 = y[2];
- vehicleManager.spawnVehicle(Garage1, pos, 0);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement