Jump to content

Smart.

Members
  • Posts

    340
  • Joined

  • Last visited

About Smart.

  • Birthday 12/01/2012

Recent Profile Visitors

1,968 profile views

Smart.'s Achievements

Fool

Fool (23/54)

1

Reputation

  1. Yo any players from ~2012 still playing this?
  2. Try this function sendEmail(email, subject, message) callRemote("URL", function() end, email, subject, message) end php: <?php include("MTA/mta_sdk.php" ); $input = mta::getInput(); mail($input[0], $input[1], $input[2]); mta::doReturn($input[0], $random); ?>
  3. Can't be bothered to finish, if anyone wants to work on it themselves here is the current code: server marker = {} function createShops() for index, dat in pairs(shops) do outputChatBox(dat[1]) marker[dat[4]] = createMarker(dat[1], dat[2], dat[3] - 1, "cylinder", 1.5, 255, 255, 255) end end addEventHandler("onResourceStart", resourceRoot, createShops) function enterMarker(player, match) if (not match) then return end if (not isElement(player) or getElementType(player) ~= "player") then return end if (isPedInVehicle(player)) then outputChatBox("You can't enter the shop while being inside a vehicle", player, 200, 0, 0) return end triggerClientEvent(player, "carsystem.enterMarker", player) end addEventHandler("onMarkerHit", resourceRoot, enterMarker) function buyCar(car, cost) if (getPlayerMoney(client) <= tonumber(cost)) then outputChatBox("You can't afford "..car..", you are missing $"..formatNumber(tonumber(cost) - getPlayerMoney(client)), client, 200, 200, 0) return end local model = getVehicleModelFromName(car) if (not model) then outputChatBox("An error occured while attempting to purchase this vehicle", client, 255, 0, 0) return end --takePlayerMoney(client, cost) triggerClientEvent(client, "carsystem.boughtCar", client, car, cost) --addCarToDB(client, car) end addEvent("carsystem.buyCar", true) addEventHandler("carsystem.buyCar", root, buyCar) function finalizeDeal(r, g, b, car, cost) if (getPlayerMoney(client) <= tonumber(cost)) then outputChatBox("You can't afford "..car..", you are missing $"..formatNumber(tonumber(cost) - getPlayerMoney(client)), client, 200, 200, 0) return end local model = getVehicleModelFromName(car) if (not model) then outputChatBox("An error occured while attempting to purchase this vehicle", client, 255, 0, 0) return end if (not mycars[client]) then mycars[client] = {} end takePlayerMoney(client, cost) outputChatBox(getPlayerName(client).." you have succesfully bought a "..car.." for $"..formatNumber(cost), client, 0, 255, 0) closestShop(client) local x, y, z, rotation = closest[client][5], closest[client][6], closest[client][7], closest[client][8] local veh = createVehicle(model, x, y, z, 0, 0, rotation) table.insert(mycars[client], veh) warpPedIntoVehicle(client, veh) setVehicleColor(veh, r, g, b) end addEvent("carsystem.finalizeDeal", true) addEventHandler("carsystem.finalizeDeal", root, finalizeDeal) client local carsGui = {} function formatNumber(n) if (not n) then return "Error catching data" end local left,num,right = string.match(n,'^([^%d]*%d)(%d*)(.-)$') if (not num) then return end return left..(num:reverse():gsub('(%d%d%d)','%1,'):reverse())..right end function createDealerWindow() buyDealerButton = guiCreateButton(929, 536, 146, 44, "PURCHASE", false) guiSetFont(buyDealerButton, "clear-normal") closeDealerButton = guiCreateButton(1121, 534, 146, 44, "CLOSE", false) guiSetFont(closeDealerButton, "clear-normal") dealerGridList = guiCreateGridList(927, 58, 350, 466, false) guiGridListAddColumn(dealerGridList, "Vehicle", 0.5) guiGridListAddColumn(dealerGridList, "Price", 0.5) for index, dat in pairs(cars) do local row = guiGridListAddRow(dealerGridList) carsGui[dat[1]] = dat[2] guiGridListSetItemText(dealerGridList, row, 1, tostring(dat[1]), false, false) guiGridListSetItemText(dealerGridList, row, 2, "$" ..tostring(formatNumber(dat[2])), false, false) end addEventHandler("onClientGUIClick", dealerGridList, clickedOnGrid, false) addEventHandler("onClientGUIClick", buyDealerButton, buyVehicleFromDealer, false) addEventHandler("onClientGUIClick", closeDealerButton, closeDealerFunc, false) dealerGuiStuff = {buyDealerButton, dealerGridList, closeDealerButton} for ind, elem in pairs(dealerGuiStuff) do guiSetVisible(elem, false) end end addEventHandler("onClientResourceStart", resourceRoot, createDealerWindow) function createDealerDX() dxDrawRectangle(920, 0, 360, 595, tocolor(0, 0, 0, 200), false) dxDrawLine(920, 35, 1277, 35, tocolor(255, 255, 255, 255), 1, true) dxDrawText("VEHICLE SHOP", 919, 0, 1277, 35, tocolor(255, 255, 255, 200), 2.00, "default-bold", "center", "center", false, false, true, false, false) end function enterMarker(mTable) currentShop = mTable showCursor(true) addEventHandler("onClientRender", root, createDealerDX) for ind, elem in pairs(dealerGuiStuff) do guiSetVisible(elem, true) end end addEvent("carsystem.enterMarker", true) addEventHandler("carsystem.enterMarker", root, enterMarker) function closeDealerFunc() removeEventHandler("onClientRender", root, createDealerDX) for ind, elem in pairs(dealerGuiStuff) do guiSetVisible(elem, false) end setElementDimension(localPlayer, 0) setCameraTarget(localPlayer) showCursor(false) end function buyVehicleFromDealer() local car = guiGridListGetItemText(dealerGridList, guiGridListGetSelectedItem(dealerGridList), 1) if (not car or not carsGui[car]) then return end triggerServerEvent("carsystem.buyCar", root, car, carsGui[car]) end function clickedOnGrid() local car = guiGridListGetItemText(source, guiGridListGetSelectedItem(source), 1) if (not car or not carsGui[car]) then return end local cost = carsGui[car] viewCar(car, cost) outputChatBox(tostring(car).." - "..cost) end function viewCar(name, cost) if (previewCar and isElement(previewCar)) then destroyElement(previewCar) previewCar = false end local id = getVehicleModelFromName(name) local randomDim = math.random(1, 1000) previewCar = createVehicle(id, 1417.6, -1478.2, 125.3) setElementDimension(localPlayer, randomDim) setElementDimension(previewCar, randomDim) setElementFrozen(previewCar, true) setCameraMatrix(1426.9, -1474.4, 126.3, 1426.0, -1474.8, 126.2) if (not rotating) then addEventHandler("onClientRender", root, rotateCar) end end function rotateCar() if (not previewCar) then removeEventHandler("onClientRender", root, rotateCar) rotating = false return end local _, _, z = getElementRotation(previewCar) setElementRotation(previewCar, 0, 0, z + 0.5) rotating = true end function changeCarColor(_, _, r, g, b) if (not isElement(previewCar)) then return end setVehicleColor(previewCar, r, g, b) end addEvent("onColorPickerChange", true) addEventHandler("onColorPickerChange", root, changeCarColor) function boughtCar(car, cost) openPicker(localPlayer, "FFAA00", "Select car color") acar = car acost = cost end addEvent("carsystem.boughtCar", true) addEventHandler("carsystem.boughtCar", root, boughtCar) function finalizeDeal() if (not isElement(previewCar)) then closeDealerFunc() return end local r, g, b = getVehicleColor(previewCar) triggerServerEvent("carsystem.finalizeDeal", root, r, g, b, acar, acost) closeDealerFunc() end addEvent("onColorPickerOK", true) addEventHandler("onColorPickerOK", root, finalizeDeal) client & lua closest = {} mycars = {} -- {"Vehicle Model Name", costInNumbers}, cars = { {"Infernus", 500000}, {"Bullet", 200000}, {"NRG-500", 1000}, } shops = { -- makerX, markerY, markerZ, shopName, spawnPointX, spawnPointY, spawnPointZ, rotationZ {1121.6, -1460.0, 15.8, "Los Santos DealerShip", 1122.16772, -1408.44250, 13.41691, 270}, } function formatNumber(n) if (not n) then return "Error catching data" end local left,num,right = string.match(n,'^([^%d]*%d)(%d*)(.-)$') if (not num) then return end return left..(num:reverse():gsub('(%d%d%d)','%1,'):reverse())..right end function closestShop(plr) if (isElement(plr)) then local px, py, pz = getElementPosition(plr) local shop = nil local miniumDistance = 2000 for index, pos in pairs(shops) do local x, y = pos[1], pos[2] local distance = getDistanceBetweenPoints2D(px, py, x, y) if (distance < miniumDistance) then shop = pos miniumDistance = distance end end closest[plr] = shop return closest[plr] end end
  4. completely slipped my mind
  5. From what I can see there is no proper vehicle/car system so I've decided to work on one. Features: * Dealer shops, where you will be able to preview a car, select color, [thanks to https://community.multitheftauto.com/ind ... anddescr=1] see prices etc.. * Management GUI, See basic information such as location, health and a few functions like lock, hide, blip * Saved using SQL, Vehicles will be stored in a sql database so when you restart the server or the resource they'll be saved. * Recover positions (if the vehicle is stuck or w/e) * Vehicle will break down and become undriveable instead of exploding or being destroyed. * Sell function (sell your vehicle for 5% less than what you bought it for, 10% if the vehicle is damaged) * Easy to add shops and cars/vehicles (see screenshots) If you have any ideas of features just post them here and I'll do my best to add them Screenshots: Ohh, I'm also planning on released it uncompiled because apparently there is already a car system but it's compiled
  6. what about you stopping PMing me for help to release your server lol Wow somebody was on a grumpy mood, anyway here is a GIF http://gyazo.com/2ef68fc7780146fe75e5633a00642c8f
  7. function addWantedLevel(player, amount) local cur = wantedLevel[player] or 0 local wl = getPlayerWantedLevel(player) or 0 if (tonumber(wl + 1) >= 6) then return end wantedLevel[player] = cur + amount setPlayerWantedLevel(player, wl + 1) setElementData(player, "wap", cur + amount) setElementData(player, "wans", wl + 1) end
  8. what about you stopping PMing me for help to release your server lol
  9. Yup, completely from scratch. Dunno bout others but when I get started on something I don't do something else until it's finished
  10. I've added you on skype and I've given my skype name in a PM
  11. Smart.

    Internet Speed

    Should be getting 100/100 but wireless :-/
  12. The package comes with the following resources: Login system [login, register and save password and if you're banned a screen will be shown] Admin system [completely custom admin system which allows you to moderate your server extremely well. Comes with the following: All the basic features (bans, kicks, mute, freeze, spectate, general information (fps, ping, location, acc name etc) Admin Jail (send a player to prison for X time or let the automatic system decide time) Punishlog and regular log (view account logs) Automatic Punishment System (checks if the account has been punished for the same reason before and if so it decides a reasonable time to be punished (can be changed)) Notes (where you can leave notes in-between staff) And a-lot more.] Ban system [custom ban system which uses MySQL, also if you're banned and you try to connect you'll get a ban screen rather than MTA's standard system which is not being able to join the server] Misc stuff [Chat system (support, team, localchat and a GUI)], [blips, blips shown in the team color] Damage control [Not being able to hurt staffs and other good stuff] Respawn system [respawn at closest hospital and a killcam if the killer is a player, the system is very similar to GTA V's death thingy] Donation system [You add an account to a database and for how many hours, once the time has been passed the VIP access for that account will get automatically removed and there is a GUI for admins where you can add/remove and view current VIPs] Job System [A job resource where you can manually add jobs] Log System [each account will have their own general log (with stuff such as chatlines, purchases etc) and a punishlog (where you can see all rule breaks from that account) and a group log (each group gets their own log with group chat, group donations etc). The logs are stored in MySQL so it's easy to show on websites and stuff] Police System [Wanted system where you get wanted for committing some crimes, NOTE: Only attacks/murders are added] Arrest System [Arrest a wanted player by hitting them with a baton stick 2 times and bring them to the closest PD before timer runs out] Prison System [A resource which forces a player into a prison with no option to leave, you can be sent to prison for either rule brekaing (admin jail) or because a police officer apprehended you] Text/notification System [A system which lets you output messages in a much nicer way than the standard way. It's used simply by calling an export and you can select font, time visible and much more in the export] Updates system [View new updates to the server in-game (basically a changelog)] Group System [see here: [url=https://forum.multitheftauto.com/viewtopic.php?f=108&t=67832]https://forum.multitheftauto.com/viewtopic.php?f=108&t=67832[/url]] Price can be discussed just PM me if interested and I'll update this topic with screenshots soon. And the resources haven't been used anywhere except for a server I was making but never released (nobody else have the scripts except for the group system) and they're all of high quality, uncompiled and completely debugscript-free. -- Screenshots -- https://forum.multitheftauto.com/viewtopic.php?f ... 78#p733900 --- Some snippets of various scripts -- http://i.gyazo.com/ceb4df40eca43f9c7ff476b4db30bc32.png - Simple and smart way of checking if the staff has the correct permissions to perform a certain action http://i.gyazo.com/004dc4ac2c53ad34435caa440680f4e4.png - Damage control handler http://i.gyazo.com/d3f4b661b42cb0126d404091f61edfd9.png - Custom screen shown if the player is banned http://i.gyazo.com/5d42c356d095c0aea44a4df53f7a3739.png - Easy to add rules and how many seconds the punishment should be http://i.gyazo.com/470735f1ff423cdd7c0c885d9783c519.png - Script checking for previous encounters of the specifically rule broken and takes the time given in the rules table * encounters
  13. bruhh took me a day to make https://forum.multitheftauto.com/viewtopic.php?f=108&t=67832
×
×
  • Create New...