• Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About DerekSP

  • Rank
    I ordered some spaghetti with marinara sauce and I got egg noodles and ketchup. I'm an average nobody.

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hello. I have been following a youtube tutorial about MTA coding, and I got to the point where I want to set up a database of parked cars. I have a /park command that is supposed to write the position and direction of the vehicle a player is in to "vehicles" table in global.db Here's the code: function parkVehicle(player, command, model) local playerVehicle = getPedOccupiedVehicle(player) local db = exports.db:getConnection() if playerVehicle then local x, y, z = getElementPosition(playerVehicle) local d, e, f = getElementRotation(playerVehicle) dbExec(db, 'INSERT INTO vehicles (model, x, y, z, d) VALUES (?, ?, ?, ?, ?)', model, x, y, z, d) outputChatBox("Vehicle parked") else outputChatBox("You are not in a vehicle") end end addCommandHandler('park', parkVehicle, false, false) The youtube tutorial had this done automatically upon spawning of the vehicle, but I wanted to split it into two commands, but seems like I failed somewhere. Please, I need any help. I have been checking the code, comparing it to the tutorial, and everything seems like it should work just fine...