Jump to content

Dimos7

Members
  • Posts

    1,546
  • Joined

  • Last visited

Everything posted by Dimos7

  1. That is text dxDrawText
  2. make a table and put orginal name of car and the name you want have as for adding i didn't understand what you mean
  3. Dimos7

    Help please

    yes try chage the roPlayer with thePlayer and thePlayer with toPlayer
  4. Dimos7

    Help please

    local mycrpmpartner = {} function thePM(thePlayer,commandName,sendToName,...) local pmWords = { ... } local pmMessage = table.concat( pmWords, " " ) if sendToName then if getPlayerFromNamePart2(sendToName) then local toPlayer = getPlayerFromNamePart2(sendToName) if not (toPlayer == thePlayer) then --that () needed if getElementData(toPlayer, "Player:PMState") == true then outputChatBox("This player has block his private messages", thePlayer, 255, 0, 0) end if not (pmMessage == "") then outputChatBox("#757575[PM] Message to #ff00ff" .. getPlayerName(toPlayer) .. ":#ffffff " .. pmMessage, thePlayer, 255, 255, 255, true) outputChatBox("#FF0000[PM] Message from #ffFFff" .. getPlayerName(thePlayer) .. ":#ffff00 " .. pmMessage, toPlayer, 255, 255, 255, true) mycrpmpartner[thePlayer]=toPlayer mycrpmpartner[toPlayer]=thePlayer else outputChatBox("#FF0000[PM]Use:#ff9900 /pm [part of name] [message]", thePlayer, 255, 255, 255, true) end else outputChatBox("#FF000[PM] You cannot PM yourself #ff9900!", thePlayer, 255, 255, 255, true) end else outputChatBox("#FF0000[PM] Player not found! #FFFF00[#ff9900"..sendToName.."#FFFF00]", thePlayer, 255, 255, 255, true) end else outputChatBox("#FF0000[PM]Use:#ff9900 /pm [part of name] [message]", thePlayer, 255, 255, 255, true) end end addCommandHandler("pm", thePM) function getPlayerFromNamePart2 ( name ) if ( name ) then for _, player in ipairs ( getElementsByType ( "player" ) ) do local name_ = getPlayerName ( player ):gsub ( "#%x%x%x%x%x%x", "" ):lower ( ) if name_:find ( tostring ( name ):lower ( ), 1, true ) then return player end end end end addCommandHandler("blockpm", function(thePlayer, command) local toPlayer = getPlayerFromNamePart2(thePlayer) local PMState = getElementData(toPlayer, "Player:PMState") if toPlayer ~= thePlayer then if (PMState == false) then setElementData(toPlayer, "Player:PMState", thePlayer, true) else setElementData(toPlayer, "Player:PMState", thePlayer, false) end else outputChatBox("You can't block yourself!", thePlayer, 255, 0, 0) end end) try this
  5. why you put it spawn sam location when resource start login and when it dead?
  6. Wrong section
  7. Post the code the errors or warnings
  8. simple check if number is equal and higher than 0 and small equal to 255 also you need add the cosutm event for that work
  9. For get records from database you need dbQuery dbPoll
  10. If that is blip resource then simple not put localPlayer to blip
  11. addEvent("SellMyVehicle", true) addEventHandler("SellMyVehicle", root, function(id) local vehicle = getVehicleByID(id) local data = dbPoll(dbQuery(db, "SELECT * FROM VehicleList WHERE Account = ? AND ID = ?", getAccountName(getPlayerAccount(source)), id), -1) if type(data) == "tablSe" and #data ~= 0 then local Money = math.ceil((data[1]["Cost"]*.9)*math.floor(data[1]["HP"])/100/10) givePlayerMoney (source, Money) if isElement(vehicle) then destroyElement(vehicle) end dbExec(db, "DELETE FROM VehicleList WHERE Account = ? AND ID = ?", getAccountName(getPlayerAccount(source)), id) updateVehicleInfo(source) outputChatBox("#FF0000|AL| #00ff00Usted vende su vehiculo por #00FF00$"..Money, source, 38, 122, 216, true) end end)
  12. the script is client or server side?
  13. We not give help to leaked scripts also there not triggerEvent int that code
  14. GUIEditor = { gridlist = {}, button = {} } addEventHandler("onClientResourceStart", resourceRoot, function() mission = guiCreateWindow(596, 264, 204, 247, "Zombie Mission", false) guiWindowSetSizable(mission, true) GUIEditor.button[1] = guiCreateButton(10, 22, 184, 15, "\"MISSIONS\"", false, mission) GUIEditor.button[2] = guiCreateButton(-1, 154, 31, 33, "", false, GUIEditor.button[1]) GUIEditor.button[3] = guiCreateButton(9, 214, 92, 18, "TAKE", false, mission) GUIEditor.button[4] = guiCreateButton(106, 214, 88, 18, "EXIT", false, mission) GUIEditor.gridlist[1] = guiCreateGridList(230, 206, 0, 15, false, mission) GUIEditor.gridlist[2] = guiCreateGridList(10, 39, 184, 168, false, mission) guiGridListAddColumn(GUIEditor.gridlist[2], "Mission", 0.9) for i = 1, 9 do guiGridListAddRow(GUIEditor.gridlist[2]) end guiGridListSetItemText(GUIEditor.gridlist[2], 0, 1, "Kill 1 boss RED", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 1, 1, "Kill 1 boss yellow", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 2, 1, "Kill 2 boss RED", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 3, 1, "Kill 2 boss yellow", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 4, 1, "Kill 3 boss RED", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 5, 1, "Kill 3 boss yellow", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 6, 1, "Kill 300 zombies", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 7, 1, "Kill 600 zombies", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 8, 1, "Kill 900 zombies", false, false) end ) addEventHandler("onClientRender", root,function() guiSetVisible(mission,false) bindKey ("U","down",function() guiSetVisible(mission), not guiSetVisible(mission)) showCurson(guiGetVisible(mission[1])) end )
  15. Can you post the errors or warnings here
  16. make a loop for all player and when a player joins add him to scoreboard make it a line and bind it so when its active and pres down go down etc
  17. dxDrawRectangle dxDrawLine dxDrawText
  18. i script it also i see a video on youtube why?
  19. local connection = exports["mysql"]:getConnection() function createPremVehicle(thePlayer, command, ...) local argus = {...} if (#argus < 3) then return outputChatBox("SYNTAX: /"..command.." [id] [color1] [color2]", thePlayer, 255, 0, 0) end local vehicleID = tonumber(argus[1]) local col1 = tonumber(argus[2]) local col2 = tonumber(argus[3]) local interior = getElementInterior(thePlayer) local dimension = getElementDimension(thePlayer) local x, y, z = getElementPosition(thePlayer) local r = getPedRotation(thePlayer) local owner = getPlayerName(thePlayer) x = x + ((math.cos(math.rad(r)))*5) y = y + ((math.sin(math.rad(r)))*5) local later1 = string.char(math.random(65,90)) local later2 = string.char(math.random(65,90)) local plate = later1..later2..math.random(0,9).." "..math.random(1000, 9999) local veh = createVehicle(vehicleID, x, y, z, 0, 0, r, plate) setElementInterior(veh, interior) setElementDimension(veh, dimension) setElementData(veh, "owner", owner) setElementData(thePlayer, "vehicle", veh) setVehicleColor(veh, col1, col2, col1, col2) local col = {getVehicleColor(veh, true)} local color1 = toJSON({col[1], col[2], col[3]}) local color2 = toJSON({col[4], col[5], col[6]}) local color3 = toJSON({col[8], col[8], col[9]}) local color4 = toJSON({col[10], col[11], col[12]}) dbExec(connection, "INSERT INTO vehicles (model, x, y, z, rotx, roty, rotz, currx, curry, currz, currrx, currry, currrz, color1, color2, color3, color4, plate, owner, dimension, interior, currdimension, currinterior) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",tostring(vehicleID), tostring(x), tostring(y), tostring(z), "0", "0", tostring(r), tostring(x), tostring(y), tostring(z), "0", "0", tostring(r), tostring(color1), tostring(color2), tostring(color3), tostring(color4), tostring(plate), owner, tostring(dimension), tostring(interior), tostring(dimension), tostring(interior)) dbQuery(function(queryHandler) local results = dbPoll(queryHandler, 0) local vehicle = results[1] setElementData(veh, "id", vehicle.id) end, connection, "SELECT id FROM vehicles ORDER BY id DESC LIMIT 1") end addCommandHandler("makeveh", createPremVehicle, false, false) function loadAllVehicle(queryHandler) local results = dbPoll(queryHandler, 0) for index, vehicle in ipairs(results) do local veh = createVehicle(vehicle.model, vehicle.currx, vehicle.curry, vehicle.currz, vehicle.currrx, vehicle.currry, vehicle.currrz, vehicle.plate) setElementData(veh, "id", vehicle.id) setElementData(veh, "engine", vehicle.engine) setElementInterior(veh, vehicle.currinterior) setElementDimension(veh, vehicle.currdimension) setElementHealth(veh, vehicle.hp) local color1 = fromJSON(vehicle.color1) local color2 = fromJSON(vehicle.color2) local color3 = fromJSON(vehicle.color3) local color4 = fromJSON(vehicle.color4) setVehicleColor(veh, color1[1], color1[2], color1[3], color2[1], color2[2], color2[3], color3[1], color3[2], color3[3], color4[1], color4[2], color4[3]) setVehicleOverrideLights(veh, vehicle.lights) setVehicleLocked(veh, vehicle.owner and vehicle.locked) setVehicleSirensOn(veh, vehicle.sirens) local headColors = fromJSON(vehicle.headlights) setVehicleHeadLightColor(veh,headColors[1], headColors[2], headColors[3]) if vehicle.paintjob ~= 0 then setVehiclePaintjob(veh, vehicle.paintjob) end local upgrades = fromJSON(vehicle.upgrades) for upgrade, slot in ipairs(upgrades) do if tonumber(upgrade) and upgrade > 0 then addVehicleUpgrade(veh, upgrade) end end local panelStates = fromJSON(vehicle.panelStates) for panel, state in ipairs(panelStates) do setVehiclePanelState(veh, panel-1, tonumber(state) or 0) end local doorStates = fromJSON(vehicle.doorStates) for door, state in ipairs(doorStates) do setVehicleDoorState(veh, door-1, tonumber(state) or 0) end local wheelStates = fromJSON(vehicle.wheelStates) for wheel, state in ipairs(wheelStates) do setVehicleWheelStates(veh, wheel-1, tonumber(state) or 0) end end end addEventHandler("onResourceStart", resourceRoot, function() dbQuery(loadAllVehicle, connection, "SELECT * FROM vehicles") end) addEventHandler("onResourceStop", resourceRoot, function() local vehicles = getElementsByType("vehicle") for index, vehicle in ipairs(vehicles) do local id = getElementData(vehicle, "id") print("the id is "..id) local x, y, z = getElementPosition(vehicle) print("the x,y,z is "..x..","..y..","..z) local rx, ry, rz = getElementRotation(vehicle) print("the rotx,roty,rotz is "..rx..","..ry..","..rz) local dimension = getElementDimension(vehicle) print("the dimension is "..dimension) local interior = getElementInterior(vehicle) print("the interior is "..interior) local engine = getElementData(vehicle, "engine") print("the engine is "..engine) local locked = isVehicleLocked(vehicle) and 1 or 0 print("the locked is "..locked) local lights = getVehicleOverrideLights(vehicle) print("the lights is "..lights) local sirens = getVehicleSirensOn(vehicle) and 1 or 0 print("the sirens is "..sirens) local paintJob = getVehiclePaintjob(vehicle) print("the paintjob is "..paintJob) local hp = getElementHealth(vehicle) print("the health is "..hp) local col = {getVehicleColor(vehicle, true)} local color1 = toJSON({col[1], col[2], col[3]}) local color2 = toJSON({col[4], col[5], col[6]}) local color3 = toJSON({col[8], col[8], col[9]}) local color4 = toJSON({col[10], col[11], col[12]}) print("the color1 is "..color1) print("the color2 is "..color2) print("the color3 is "..color3) print("the color4 is "..color4) local wheel1, wheel2, wheel3, wheel4 = getVehicleWheelStates(vehicle) local upgrade0 = getVehicleUpgradeOnSlot(vehicle, 0) local upgrade1 = getVehicleUpgradeOnSlot(vehicle, 1) local upgrade2 = getVehicleUpgradeOnSlot(vehicle, 2) local upgrade3 = getVehicleUpgradeOnSlot(vehicle, 3) local upgrade4 = getVehicleUpgradeOnSlot(vehicle, 4) local upgrade5 = getVehicleUpgradeOnSlot(vehicle, 5) local upgrade6 = getVehicleUpgradeOnSlot(vehicle, 6) local upgrade7 = getVehicleUpgradeOnSlot(vehicle, 7) local upgrade8 = getVehicleUpgradeOnSlot(vehicle, 8) local upgrade9 = getVehicleUpgradeOnSlot(vehicle, 9) local upgrade10 = getVehicleUpgradeOnSlot(vehicle, 10) local upgrade11 = getVehicleUpgradeOnSlot(vehicle, 11) local upgrade12 = getVehicleUpgradeOnSlot(vehicle, 12) local upgrade13 = getVehicleUpgradeOnSlot(vehicle, 13) local upgrade14 = getVehicleUpgradeOnSlot(vehicle, 14) local upgrade15 = getVehicleUpgradeOnSlot(vehicle, 15) local upgrade16 = getVehicleUpgradeOnSlot(vehicle, 16) local panel0 = getVehiclePanelState(vehicle, 0) local panel1 = getVehiclePanelState(vehicle, 1) local panel2 = getVehiclePanelState(vehicle, 2) local panel3 = getVehiclePanelState(vehicle, 3) local panel4 = getVehiclePanelState(vehicle, 4) local panel5 = getVehiclePanelState(vehicle, 5) local panel6 = getVehiclePanelState(vehicle, 6) local door0 = getVehicleDoorState(vehicle, 0) local door1 = getVehicleDoorState(vehicle, 1) local door2 = getVehicleDoorState(vehicle, 2) local door3 = getVehicleDoorState(vehicle, 3) local door4 = getVehicleDoorState(vehicle, 4) local door5 = getVehicleDoorState(vehicle, 5) local headligh1, headligh2, headligh3 = getVehicleHeadLightColor(vehicle) local upgrades = toJSON({upgrade0, upgrade1, upgrade2, upgrade3, upgrade4, upgrade5, upgrade6, upgrade8, upgrade9, upgrade10, upgrade11, upgrade12, upgrade13, upgrade14, upgrade15, upgrade16}) local wheelStates = toJSON({wheel1, wheel2, wheel3, wheel4}) local panelStates = toJSON({panel0, panel1, panel2, panel3, panel4, panel5, panel6}) local doorStates = toJSON({door0, door1, door2, door3, door4, door5}) local headlights = toJSON({headligh1, headligh2, headligh3}) print("the upgrades is "..upgrades) print("the wheelStates is "..wheelStates) print("the panelStates is "..panelStates) print("the doorStates is "..doorStates) print("the headlights is "..headlights) local bool = dbExec(connection, "UPDATE vehicles SET currx=?, curry=?, currz=?, currrx=?, currry=?, currrz=?, engine=?, locked=?, lights=?, sirens=?, paintjob=?, hp=?,color1=?, color2=?, color3=?, color4=?, currdimension=?, currinterior=?, upgrades=?, wheelStates=?, panelStates=?, doorStates=?, headlights=? WHERE id=?", tostring(x), tostring(y), tostring(z),tostring(rx), tostring(ry), tostring(rz), engine, tostring(locked), tostring(sirens), tostring(paintJob), tostring(hp), tostring(color1), tostring(color2), tostring(color3), tostring(color4), tostring(dimension), tostring(interior), tostring(upgrades), tostring(wheelStates), tostring(panelStates), tostring(doorStates), tostring(headlights), id) print("the result is "..bool) end end) addEventHandler("onVehicleExit", root, function() local id = getElementData(source, "id") print("the id is "..id) local x, y, z = getElementPosition(source) print("the x,y,z is "..x..","..y..","..z) local rx, ry, rz = getElementRotation(source) print("the rotx,roty,rotz is "..rx..","..ry..","..rz) local dimension = getElementDimension(source) print("the dimension is "..dimension) local interior = getElementInterior(source) print("the interior is "..interior) local engine = getElementData(source, "engine") print("the engine is "..engine) local locked = isVehicleLocked(source) and 1 or 0 print("the locked is "..locked) local lights = getVehicleOverrideLights(source) print("the lights is "..lights) local sirens = getVehicleSirensOn(source) and 1 or 0 print("the sirens is "..sirens) local paintJob = getVehiclePaintjob(source) print("the paintjob is "..paintJob) local hp = getElementHealth(source) print("the health is "..hp) local col = {getVehicleColor(source, true)} local color1 = toJSON({col[1], col[2], col[3]}) local color2 = toJSON({col[4], col[5], col[6]}) local color3 = toJSON({col[8], col[8], col[9]}) local color4 = toJSON({col[10], col[11], col[12]}) print("the color1 is "..color1) print("the color2 is "..color2) print("the color3 is "..color3) print("the color4 is "..color4) local wheel1, wheel2, wheel3, wheel4 = getVehicleWheelStates(source) local upgrade0 = getVehicleUpgradeOnSlot(source, 0) local upgrade1 = getVehicleUpgradeOnSlot(source, 1) local upgrade2 = getVehicleUpgradeOnSlot(source, 2) local upgrade3 = getVehicleUpgradeOnSlot(source, 3) local upgrade4 = getVehicleUpgradeOnSlot(source, 4) local upgrade5 = getVehicleUpgradeOnSlot(source, 5) local upgrade6 = getVehicleUpgradeOnSlot(source, 6) local upgrade7 = getVehicleUpgradeOnSlot(source, 7) local upgrade8 = getVehicleUpgradeOnSlot(source, 8) local upgrade9 = getVehicleUpgradeOnSlot(source, 9) local upgrade10 = getVehicleUpgradeOnSlot(source, 10) local upgrade11 = getVehicleUpgradeOnSlot(source, 11) local upgrade12 = getVehicleUpgradeOnSlot(source, 12) local upgrade13 = getVehicleUpgradeOnSlot(source, 13) local upgrade14 = getVehicleUpgradeOnSlot(source, 14) local upgrade15 = getVehicleUpgradeOnSlot(source, 15) local upgrade16 = getVehicleUpgradeOnSlot(source, 16) local panel0 = getVehiclePanelState(source, 0) local panel1 = getVehiclePanelState(source, 1) local panel2 = getVehiclePanelState(source, 2) local panel3 = getVehiclePanelState(source, 3) local panel4 = getVehiclePanelState(source, 4) local panel5 = getVehiclePanelState(source, 5) local panel6 = getVehiclePanelState(source, 6) local door0 = getVehicleDoorState(source, 0) local door1 = getVehicleDoorState(source, 1) local door2 = getVehicleDoorState(source, 2) local door3 = getVehicleDoorState(source, 3) local door4 = getVehicleDoorState(source, 4) local door5 = getVehicleDoorState(source, 5) local headligh1, headligh2, headligh3 = getVehicleHeadLightColor(source) local upgrades = toJSON({upgrade0, upgrade1, upgrade2, upgrade3, upgrade4, upgrade5, upgrade6, upgrade8, upgrade9, upgrade10, upgrade11, upgrade12, upgrade13, upgrade14, upgrade15, upgrade16}) local wheelStates = toJSON({wheel1, wheel2, wheel3, wheel4}) local panelStates = toJSON({panel0, panel1, panel2, panel3, panel4, panel5, panel6}) local doorStates = toJSON({door0, door1, door2, door3, door4, door5}) local headlights = toJSON({headligh1, headligh2, headligh3}) print("the upgrades is "..upgrades) print("the wheelStates is "..wheelStates) print("the panelStates is "..panelStates) print("the doorStates is "..doorStates) print("the headlights is "..headlights) local bool = dbExec(connection, "UPDATE vehicles SET currx=?, curry=?, currz=?, currrx=?, currry=?, currrz=?, engine=?, locked=?, lights=?, sirens=?, paintjob=?, hp=?,color1=?, color2=?, color3=?, color4=?, currdimension=?, currinterior=?, upgrades=?, wheelStates=?, panelStates=?, doorStates=?, headlights=? WHERE id=?", tostring(x), tostring(y), tostring(z),tostring(rx), tostring(ry), tostring(rz), engine, tostring(locked), tostring(sirens), tostring(paintJob), tostring(hp), tostring(color1), tostring(color2), tostring(color3), tostring(color4), tostring(dimension), tostring(interior), tostring(upgrades), tostring(wheelStates), tostring(panelStates), tostring(doorStates), tostring(headlights), id) print("the result is "..bool) end) function toggleEngine(thePlayer) if isPedInVehicle(thePlayer) then local veh = getPedOccupiedVehicle(thePlayer) if getPedOccupiedVehicleSeat(thePlayer) == 0 then local owner = getElementData(veh, "owner") if owner == getPlayerName(thePlayer) then if getVehicleEngineState(veh) == false then setVehicleEngineState(veh, true) setElementData(veh, "engine", "1") else setVehicleEngineState(veh, false) setElementData(veh, "engine", "0") end else outputChatBox("You are not the owner!", thePlayer, 255, 0, 0) end else outputChatBox("You are not in driver seat!", thePlayer, 255, 0, 0) end else outputChatBox("You are not in a vehicle!", thePlayer, 255, 0 , 0) end end addCommandHandler("engine", toggleEngine, false, false) function toggleLights(thePlayer) if isPedInVehicle(thePlayer) then local veh = getPedOccupiedVehicle(thePlayer) if getPedOccupiedVehicleSeat(thePlayer) == 0 then if getVehicleOverrideLights(veh) ~= 2 then setVehicleOverrideLights(veh, 2) else setVehicleOverrideLights(veh, 1) end else outputChatBox("You are not in driver seat!", thePlayer, 255, 0, 0) end else outputChatBox("You are not in a vehicle!", thePlayer, 255, 0 , 0) end end addCommandHandler("lights", toggleLights, false, false) function toggleLock(thePlayer) if isPedInVehicle(thePlayer) then local veh = getPedOccupiedVehicle(thePlayer) local owner = getElementData(veh, "owner") if getPedOccupiedVehicleSeat(thePlayer) == 0 then if owner == getPlayerName(thePlayer) then if not isVehicleLocked(veh) then setVehicleLocked(veh, true) else setVehicleLocked(veh, false) end else outputChatBox("You are not the owner!", thePlayer, 255, 0 , 0) end else outputChatBox("You are not in driver seat!", thePlayer, 255, 0, 0) end else outputChatBox("You are not in a vehicle!", thePlayer, 255, 0, 0) end end addCommandHandler("carlock", toggleLock, false, false) addEventHandler("onVehicleEnter", root, function() if getElementData(source, "engine") == 1 then setVehicleEngineState(source, true) else setVehicleEngineState(source, false) end end) addEventHandler("onVehicleStartEnter", root, function(thePlayer) local owner = getElementData(source, "owner") if isVehicleLocked(source)and not owner == getPlayerName(thePlayer) then cancelEvent() end end) error 92 attempt to conculate id (boolen value) warning 56 setVehicleLocked (arugment 2 expect boolen got number 0) warning 57 setVehicleSirensOn(argument 2 expect boolen got number 0) when i restart the resource and enter the car try to turn on the enine say i a m not the owner but i am
  20. Dimos7

    Help

    No we not give you code read because we are here to help you with a code you have and has errors or warnings
  21. You need check which one is for Police with element data and add siren set there places if you want have object siren like orginal Police car you need createObject
  22. addVehicleSirens setVehicleSirens
  23. You need the image of skin you want change and use dxCreateShader dxCreateTexture
×
×
  • Create New...