Jump to content

MedKhiti

Members
  • Posts

    24
  • Joined

  • Last visited

Everything posted by MedKhiti

  1. im gonna translate to tunisian language
  2. can u create the full code for me ? and thanx
  3. function createMarkers() for i, med in ipairs(locations) do local marker = createMarker(med[2], med[3], med[4], "cylinder", 1.5, 55, 37, 30) createBlipAttachedTo(marker, 9) markers[marker] = med addEventHandler("onMarkerHit", marker, destMarker) end end addEventHandler("onResourceStart", resourceRoot, createMarkers) How To DrawText For Markers .? help please with Code ;=)
  4. addEventHandler("onResourceStart", resourceRoot, function() for i = 1, #jobs do local players = getElementsByType("player") local marker = createMarker(0,0,0,"cylinder",1.5,153,0,153,255) local marker1 = createMarker(0,0,0,"arrow",1.5,96,96,96,255) local star = createObject(1247,0,0,0) ped = createPed(jobs[i][2], jobs[i][3], jobs[i][4], jobs[i][5]) setElementRotation(ped, 0, 0, jobs[i][6]) setElementFrozen(ped, true) setElementData(ped, "job.ped", true) setElementData(ped, "job.title", jobs[i][1]) setElementData(ped, "job.team", jobs[i][7]) setElementData(ped, "job.info", jobs[i][9]) setElementData(ped, "job.r", jobs[i][10]) setElementData(ped, "job.g", jobs[i][11]) addPedClothes ( source, "moto", "moto", 16 ) setElementData(ped, "job.b", jobs[i][12]) setElementData(ped, "job.skin", jobs[i][2]) setElementData(ped, "job.skinRequired", jobs[i][8]) setElementData(ped, "job.enabled", jobs[i][13]) blip = createBlip(jobs[i][3], jobs[i][4], jobs[i][5], 56, 2, 255, 255, 255, 255, 0, 350.0, root) blip5 = exports.customblips:createCustomBlip(jobs[i][2], jobs[i][3], jobs[i][4], jobs[i][5], 20, 20, "job.png", 20,) attachElements(marker,ped,0,0,-1) attachElements(marker1,ped,0,0,3) attachElements(star,ped,0,0,1.6) end end) [01:18:24] ERROR: 33\s:77: call: failed to call 'customblips:createCustomBlip' [01:18:24] ERROR: 33\s:77: call: failed to call 'customblips:createCustomBlip' [01:18:24] ERROR: 33\s:77: call: failed to call 'customblips:createCustomBlip' [01:18:24] ERROR: 33\s:77: call: failed to call 'customblips:createCustomBlip' [01:18:24] ERROR: 33\s:77: call: failed to call 'customblips:createCustomBlip' [01:18:24] ERROR: 33\s:77: call: failed to call 'customblips:createCustomBlip' [01:18:24] ERROR: 33\s:77: call: failed to call 'customblips:createCustomBlip' [01:18:24] ERROR: 33\s:77: call: failed to call 'customblips:createCustomBlip' [01:18:24] ERROR: 33\s:77: call: failed to call 'customblips:createCustomBlip' [01:18:24] ERROR: 33\s:77: call: failed to call 'customblips:createCustomBlip' [01:18:24] ERROR: 33\s:77: call: failed to call 'customblips:createCustomBlip' [01:18:24] ERROR: 33\s:77: call: failed to call 'customblips:createCustomBlip' [01:18:24] ERROR: 33\s:77: call: failed to call 'customblips:createCustomBlip' [01:18:24] ERROR: 33\s:77: call: failed to call 'customblips:createCustomBlip' [01:18:24] ERROR: 33\s:77: call: failed to call 'customblips:createCustomBlip' [01:18:24] ERROR: 33\s:77: call: failed to call 'customblips:createCustomBlip' [01:18:24] ERROR: 33\s:77: call: failed to call 'customblips:createCustomBlip' [01:18:24] ERROR: 33\s:77: call: failed to call 'customblips:createCustomBlip' [01:18:24] ERROR: 33\s:77: call: failed to call 'customblips:createCustomBlip' [01:18:24] ERROR: 33\s:77: call: failed to call 'customblips:createCustomBlip' [01:18:24] ERROR: 33\s:77: call: failed to call 'customblips:createCustomBlip' [01:18:24] 33 restarted successfully Any Help i want the Custom blip attach to all The jobs
  5. can u simple it to me ? with a simple code ?.
  6. can any one tell me how to create object 1247 star/wanted object on the head of player when a player is wanted and it removes when a player get unwanted ?
  7. NO debug no Panel Showing really
  8. ana esmi TusCan w chrit des Servers MTA avc paypal and my server gonna open soon, proof : https://www.facebook.com/photo.php?fbid ... =1&theater
  9. no debugs but when i enter marker nothing is happen
  10. no debugs but when i enter marker nothing is happen
  11. thank you so much really but can u help me in a last thing the job panel shows when i press 'M' and Click on ped i want to change it when a player hit the marker addEventHandler("onClientClick", root, function(button, state, aX, aY, wX, wY, wZ, clickedElement) local pX, pY, pZ = getElementPosition(localPlayer) if clickedElement and button == "right" and state == "up" and (getElementType(clickedElement) == "ped") and (getDistanceBetweenPoints3D(pX, pY, pZ, wX, wY, wZ) <= 2) then if (getElementData(clickedElement, "job.ped") == true) then job = getElementData(clickedElement, "job.title") team = getElementData(clickedElement, "job.team") info = getElementData(clickedElement, "job.info") cR = getElementData(clickedElement, "job.r") cG = getElementData(clickedElement, "job.g") cB = getElementData(clickedElement, "job.b") skinID = getElementData(clickedElement, "job.skin") skinRequired = getElementData(clickedElement, "job.skinRequired") enabled = getElementData(clickedElement, "job.enabled") arrests = getElementData(localPlayer, "Arrests") showJobWindow(true) end end end) jobWnd = guiCreateWindow(503,255,327,267,"test",false) guiWindowSetSizable(jobWnd,false) jobLabel = guiCreateLabel(11,24,303,186,"DESCRIPTION",false,jobWnd) guiSetFont(jobLabel,"clear-normal") takeButt = guiCreateButton(11,219,141,36,"Take Job",false,jobWnd) closeButt = guiCreateButton(173,219,141,36,"Close",false,jobWnd) addEventHandler("onClientGUIClick", closeButt, function() showJobWindow(false) end, false) guiSetVisible(jobWnd, false) addEventHandler("onClientGUIClick", takeButt, function() if enabled then if job == "Detective" and arrests < 150 then outputChatBox("You need "..150-arrests.." arrests before you can get this job!", 255, 0, 0) return end if job == "Traffic Officer" and arrests < 75 outputChatBox("You need "..75-arrests.." arrests before you can get this job!", 255, 0, 0) return end outputChatBox("You are now employed as a "..job.." !", 0, 255, 0) guiSetVisible(jobWnd, false) triggerServerEvent("givePlayerJob", localPlayer, job, team, cR, cG, cB, skinID, skinRequired) else outputChatBox("This job is not available yet!", 255, 0, 0) end end, false) function showJobWindow(state) if state == true then guiSetVisible(jobWnd, true) guiSetText(jobLabel, tostring(info)) guiSetText(jobWnd, tostring(job)) else guiSetVisible(jobWnd, false) end end addEventHandler("onClientPedDamage", root, function() if (getElementData(source, "job.ped") == true) then cancelEvent() end end) bindKey("m", "down", function() showCursor(not isCursorShowing()) end)
  12. Thanx it works marker created but in the head of ped i want it circled the ped i mean i want the ped inside the marker if u can bro ur really helpful <3 thank you
  13. please can u create it and attach it bro i really need help and im not good in scripting
  14. for i = 1, #teams do team = createTeam(teams[i][1], teams[i][2], teams[i][3], teams[i][4]) end addEventHandler("onResourceStart", resourceRoot, function() for i = 1, #jobs do local players = getElementsByType("player") ped = createPed(jobs[i][2], jobs[i][3], jobs[i][4], jobs[i][5]) setElementRotation(ped, 0, 0, jobs[i][6]) setElementFrozen(ped, true) setElementData(ped, "job.ped", true) setElementData(ped, "job.title", jobs[i][1]) setElementData(ped, "job.team", jobs[i][7]) setElementData(ped, "job.info", jobs[i][9]) setElementData(ped, "job.r", jobs[i][10]) setElementData(ped, "job.g", jobs[i][11]) setElementData(ped, "job.b", jobs[i][12]) setElementData(ped, "job.skin", jobs[i][2]) setElementData(ped, "job.skinRequired", jobs[i][8]) setElementData(ped, "job.enabled", jobs[i][13]) blip = createBlip(jobs[i][3], jobs[i][4], jobs[i][5], 56, 2, 255, 255, 255, 255, 0, 350.0, root) end end) addEvent("givePlayerJob", true) addEventHandler("givePlayerJob", root, function(job, team, r, g, b, skinID, skinRequired) local pTeam = getTeamFromName(team) setPlayerTeam(source, pTeam) setElementData(source, "Role", job) setPlayerNametagColor(source, r, g, b) if skinRequired then setElementModel(source, skinID) end if job == "Paramedic" then giveWeapon(source, 41, 9999, true) elseif job == "Police Officer" or job == "Detective" or job == "Traffic Officer" then giveWeapon(source, 3, 1, true) end end) function getJobsTable(client,bool) if bool then triggerClientEvent(client,"returnJobsTable",client,jobTable) end return jobTable end addEvent("getJobTable",true) addEventHandler("getJobTable",root,getJobsTable) addEventHandler("onResourceStop", resourceRoot, function () for i,v in pairs(getElementsByType("player")) do if (getPlayerTeam(v)) then local team = getTeamName(getPlayerTeam(v)) setElementData(v,"tempTeam",tostring(team)) end triggerClientEvent(v,"returnJobsTable",v,jobTable) end end) addEventHandler("onResourceStart", resourceRoot, function () for index, team in pairs(teamTable) do createTeam(tostring(team[1]), tonumber(team[2]), tonumber(team[3]), tonumber(team[4])) end for i,v in pairs(jobTable) do local ped = createPed(tonumber(v.skin), tostring(v.x), tostring(v.y), tostring(v.z)+1) if ped then setPedRotation(ped, tonumber(v.rot)) jobPeds[ped] = {v.team, v.role, v.weapons, v.desc, v.skin, v.wl, v.hours, v.arrests} setElementData(ped,"jobPed",true) setElementData(ped,"jobName",v.role) setElementData(ped,"jobColor",{v.r, v.g, v.b}) setElementFrozen(ped, true) if v.int then setElementInterior(ped, tonumber(v.int)) end end end for i,v in pairs(getElementsByType("player")) do local accData = getElementData(v,"tempTeam") if accData then setTimer(setPlayerTeam,2000,1,v,getTeamFromName(accData)) end local r, g, b = getPlayerNametagColor(v) plrBlips[v] = createBlipAttachedTo(v,0,2,r,g,b,255,0,1500) end for commandName,_ in pairs(callCommands) do addCommandHandler(tostring(commandName),onJobCommandCalled) end end) this is code i just want a marker attached to all jobs/peds and thank you
  15. Warning jobs/s:74:Bad arguiment]@ 'attachElements'[Expected element at arument 1 , got nil] Warning jobs/s:73:Bad arguiment]@ 'createBlipAttachedTo
  16. im not good in scripting can u please add the code in what i post?
  17. for i = 1, #teams do team = createTeam(teams[i][1], teams[i][2], teams[i][3], teams[i][4]) end addEventHandler("onResourceStart", resourceRoot, function() for i = 1, #jobs do local players = getElementsByType("player") ped = createPed(jobs[i][2], jobs[i][3], jobs[i][4], jobs[i][5]) setElementRotation(ped, 0, 0, jobs[i][6]) setElementFrozen(ped, true) setElementData(ped, "job.ped", true) setElementData(ped, "job.title", jobs[i][1]) setElementData(ped, "job.team", jobs[i][7]) setElementData(ped, "job.info", jobs[i][9]) setElementData(ped, "job.r", jobs[i][10]) setElementData(ped, "job.g", jobs[i][11]) setElementData(ped, "job.b", jobs[i][12]) setElementData(ped, "job.skin", jobs[i][2]) setElementData(ped, "job.skinRequired", jobs[i][8]) setElementData(ped, "job.enabled", jobs[i][13]) blip = createBlip(jobs[i][3], jobs[i][4], jobs[i][5], 56, 2, 255, 255, 255, 255, 0, 350.0, root) end end) i just want to create marker Attached to ped/jobs and ty im not a good Scripter
  18. local mbag = { {2422.3,-2261.6,16}, {1758.9,-2767.9,1.7}, {2493.3,-951.8,82.25}, {815.7,-1108.2,25.8}, {390.9,-2054.3,13.8}, {-719.05,-1938.8,8.35}, {-625.7,-2249.5,23.05}, {-1812.3,-168.5,18.2}, {-2659.5,1528.05,54.79}, {-1733.76,194.75,3.6}, {-2535.5,40.15,8.5}, {-1804.85,558.45,35.15}, {-752.6,-131.6,65.8}, } function createBag() local random = math.random ( #mbag ) local x, y, z = mbag[random][1], mbag[random][2], mbag[random][3] bag = createPickup( x, y, z, 3, 1550 ) setElementCollisionsEnabled( bag, false ) bl = createBlipAttachedTo(bag,37) outputChatBox("A Mystery Bag Has Been Appeard On Your Map Get It First And Get Some Nice Prizes In It!", root, 0, 255, 0) end addEventHandler("onResourceStart", resourceRoot,createBag) addEventHandler("onPickupHit",root, function ( player ) if ( source ~= bag ) then return end if ( isPedInVehicle( player ) ) then return end if ( getElementData( player, "Role" ) == "Staff" ) then else if ( getElementData( player, "Role" ) == "Government" ) then else if ( getElementData( player, "Role" ) == "SWAT" ) then else if ( getElementData( player, "Role" ) == "Emergency" ) then else if ( getElementData( player, "Role" ) == "Police" ) then else if ( getElementData( player, "Role" ) == "Civilian" ) then else if ( getElementData( player, "Role" ) == "Criminal" ) then else if ( getElementData( player, "Role" ) == "Unemployed" ) then else if ( getElementData( player, "Role" ) == "Off-duty Workers" ) then return outputChatBox("First Go Criminal", localPlayer, 0, 255, 0) end destroyElement( bag ) destroyElement( bl ) randomMoney = math.random ( 1000, 20000 ) randomArmor = math.random( 15, 30 ) givePlayerMoney(player,randomMoney) setPedArmor ( player, getPedArmor(player) + randomArmor ) outputChatBox("You found $" .. tostring(randomMoney) .." and ".. tostring(randomArmor) .."% Armor", player, 0, 250, 0) setTimer( createBag, 90000, 1 ) end end end end end end end end end end end end ) DEBUG SCRIPT 3: MSG ERROR:Loading script failed:med-mysterbag/client.lua:72:') expected(to close'('at line 27)near'end'
  19. - - Connection functions local connection = nil local function connect( ) connection = dbConnect( "mysql", "dbname=mtadev;host=127.0.0.1;port=3306;unix_socket=/var/run/mysqld/mysqld.sock", "mtadev", "t9CPZJbJTe8FtnwC", "share=1" ) if connection then outputConsole ( "Server is now connected with the MySQL database!", 1 ) return true else outputConsole ( "Connection with the MySQL database failed!", 1 ) return false end end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), connect ) -- Exported functions function query( ... ) if connection then local qh = dbQuery( connection, ... ) local result = dbPoll( qh, -1 ) return result else return false end end -- Get a single row from the database function querySingle( str, ... ) if connection then local result = query( str, ... ) if type(result) == 'table' then return result[1] end return result else return false end end -- DB exec as used function exec( str, ... ) if connection then local qh = dbExec( connection, str, ... ) return qh else return false end end i want help please i want to connect to data base h whats The soloution for local server i mean not hosted help please Meta XML <meta> <info author="1337" version="1.0.0" type="script" name="1337mysql" description="MySQL config resource" /> <script src="mysql.lua"/> <!-- The Exports --> <export function="query"/> <export function="querySingle"/> <export function="exec"/> <export function="free"/> </meta>
×
×
  • Create New...