Jump to content

darhal

Members
  • Posts

    582
  • Joined

  • Last visited

Everything posted by darhal

  1. allah y5alik w ythibk 3la chr7k el wafi w asf 3la el english ma3ndi keyboard 3arabi fi el hatf
  2. can some one explain [lua] ipairs [\lua] for me plz in arabic !
  3. I have turf system but I went added to it respawn system that s mean you respawn at your turf when you die can you help with the fucntions that I may use ?? and ty
  4. I made this but it doesn't work local hospitalTable = {} local hospitals = { -- mx, my, mz, tarx, tary, tarz, x, y, z, rot, name [1] = {1218, -1322, 15, 1217, -1322, 15, 1173, -1323, 15, 270, "All Saints Hospital"}, -- All Saints [2] = {2033, -1439, 19, 2033, -1438, 18, 2038, -1411, 17, 130, "Jefferson Hospital."}, --Jefferson [3] = {1254, 352, 21, 1254, 351, 21, 1242, 327, 19, 340, "Red County Hospital."}, -- Red County [4] = {1590, 1862, 12, 1590, 1861, 12, 1609, 1816, 12, 360, "Las Venturas Hospital."}, -- Las Venturas [5] = {-2660, 580, 16, -2660, 581, 16, -2655, 635, 14, 180, "San Fierro Hospital."}, -- San Fierro [6] = {-2181, -2289, 32, -2181, -2290, 32, -2200, -2311, 30, 320, "Angel Pine Hospital."} -- Angel Pine } local playerWeapons = { } addEventHandler ( "onPlayerWasted", root, function ( ) if ( not playerWeapons [ source ] ) then playerWeapons [ source ] = { } end for slot = 0, 12 do local weapon = getPedWeapon ( source, slot ) if ( weapon > 0 ) then local ammo = getPedTotalAmmo ( source, slot ) if ( ammo > 0 ) then playerWeapons [ source ] [ weapon ] = ammo end end end end ) function viewTheHospital() local table = findHospital(source) local theMessage = "You have died and been taken to "..table[11] triggerClientEvent(source, "UIPhospital.addHospitalText", source, theMessage) setCameraMatrix(source, table[1], table[2], table[3], table[4], table[5], table[6]) showPlayerHudComponent(source, "all", false) setTimer(finsihHospitalIntro, 4500, 1, source, getElementModel(source), table[7], table[8], table[9], table[10]) end addEventHandler("onPlayerWasted", root, viewTheHospital) function finsihHospitalIntro(player, model, x, y, z, rotation) if (isElement(player)) then fadeCamera(player, false, 0) setTimer(fadeCamera, 1000, 1, player, true) setCameraTarget(player, player) showPlayerHudComponent(player, "all", true) spawnPlayer(player, x, y, z, rotation, model, 0, 0) hospitalTable[player] = nil end end addEventHandler ( "onSpawnPlayer", root, function ( ) if ( playerWeapons [ source ] ) then for weapon, ammo in pairs ( playerWeapons [ source ] ) do giveWeapon ( source, tonumber ( weapon ), tonumber ( ammo ) ) end end playerWeapons [ source ] = nil end ) function findHospital(plr) if (isElement(plr)) then local theHospital = nil local miniumDistance = 2000 for index, pos in pairs(hospitals) do local px, py, pz = getElementPosition(plr) local x, y = pos[7], pos[8] local distance = getDistanceBetweenPoints2D(px, py, x, y) if (distance < miniumDistance) then theHospital = pos miniumDistance = distance end end hospitalTable[plr] = theHospital return hospitalTable[plr] end end
  5. Hi all I have this Hospital respawn script and My prmoblem was when I respawn I I need to get the guns that i have how to added it plz Need ur help server side local hospitalTable = {} local hospitals = { -- mx, my, mz, tarx, tary, tarz, x, y, z, rot, name [1] = {1218, -1322, 15, 1217, -1322, 15, 1173, -1323, 15, 270, "All Saints Hospital"}, -- All Saints [2] = {2033, -1439, 19, 2033, -1438, 18, 2038, -1411, 17, 130, "Jefferson Hospital."}, --Jefferson [3] = {1254, 352, 21, 1254, 351, 21, 1242, 327, 19, 340, "Red County Hospital."}, -- Red County [4] = {1590, 1862, 12, 1590, 1861, 12, 1609, 1816, 12, 360, "Las Venturas Hospital."}, -- Las Venturas [5] = {-2660, 580, 16, -2660, 581, 16, -2655, 635, 14, 180, "San Fierro Hospital."}, -- San Fierro [6] = {-2181, -2289, 32, -2181, -2290, 32, -2200, -2311, 30, 320, "Angel Pine Hospital."} -- Angel Pine } function viewTheHospital() local table = findHospital(source) local theMessage = "You have died and been taken to "..table[11] triggerClientEvent(source, "hospital.addHospitalText", source, theMessage) setCameraMatrix(source, table[1], table[2], table[3], table[4], table[5], table[6]) showPlayerHudComponent(source, "all", false) setTimer(finsihHospitalIntro, 4500, 1, source, getElementModel(source), table[7], table[8], table[9], table[10]) end addEventHandler("onPlayerWasted", root, viewTheHospital) function finsihHospitalIntro(player, model, x, y, z, rotation) if (isElement(player)) then fadeCamera(player, false, 0) setTimer(fadeCamera, 1000, 1, player, true) setCameraTarget(player, player) showPlayerHudComponent(player, "all", true) spawnPlayer(player, x, y, z, rotation, model, 0, 0) hospitalTable[player] = nil end end function findHospital(plr) if (isElement(plr)) then local theHospital = nil local miniumDistance = 2000 for index, pos in pairs(hospitals) do local px, py, pz = getElementPosition(plr) local x, y = pos[7], pos[8] local distance = getDistanceBetweenPoints2D(px, py, x, y) if (distance < miniumDistance) then theHospital = pos miniumDistance = distance end end hospitalTable[plr] = theHospital return hospitalTable[plr] end end Client local screenWidth, screenHeight = guiGetScreenSize() rectangleAlpha = 170 textAlpha = 255 function addHospitalText(msg) message = msg fadeTimer = setTimer(fadeTheText, 500, 0) addEventHandler("onClientRender", root, drawHospitalText) end addEvent("hospital.addHospitalText", true) addEventHandler("hospital.addHospitalText", root, addHospitalText) function fadeTheText() textAlpha = textAlpha - 8.5 rectangleAlpha = rectangleAlpha - 8.5 if (rectangleAlpha <= 0) then killTimer(fadeTimer) removeEventHandler("onClientRender", root, drawHospitalText) end end function drawHospitalText() dxDrawRectangle((screenWidth / 1920) * 426.0, (screenHeight / 1080) * 810.0, (screenWidth / 1920) * 1086.0, (screenHeight / 1080) * 45.0, tocolor(0, 0, 0, rectangleAlpha), false) dxDrawText(message, (screenWidth / 1920) * 380.0, (screenHeight / 1080) * 819.0, (screenWidth / 1920) * 1554.0, (screenHeight / 1080) * 869.0, tocolor(0, 0, 0, textAlpha), (screenHeight / 1920) * 1.5, "bankgothic", "center", "top", false, false, false) dxDrawText(message, (screenWidth / 1920) * 380.0, (screenHeight / 1080) * 819.0, (screenWidth / 1920) * 1554.0, (screenHeight / 1080) * 865.0, tocolor(255, 255, 255, textAlpha), (screenHeight / 1920) * 1.5, "bankgothic", "center", "top", false, false, false) end
  6. The server work arround 6 hours and be offline I should re-install MTA to get it work again !!! whyy ?
  7. hi all I made a script that open gates for SWATTeam group only but the gate dont open for me when i was in a vehicel this code server side only col50 = createColTube(778.02728271484, -1325.1665039063, 13.546875, 10, 10) local gate50 = createObject(980,777.1341796875,-1329.7197265625,14.546875, 0, 0 , 178.50030517578 ) function openGate50(player) if (player and isElement(player) and getElementType(player)) == "player" then local group = exports.UIPgroups:getPlayerGroup(player) if (group and group == "SWATTeam" or exports.UIPteams:isPlayerInTeams(player, "Staff")) then moveObject(gate50,1000,777.1845703125,-1329.7197265625,14.546875+6, 0, 0, 0 ) end end end addEventHandler("onColShapeHit", col50, openGate50) function closeGate50(player) if (player and isElement(player) and getElementType(player)) == "player" then local group = exports.UIPgroups:getPlayerGroup(player) if (group and group == "SWATTeam" or exports.UIPteams:isPlayerInTeams(player, "Staff")) then moveObject(gate50, 980,777.1845703125,-1329.7197265625,14.546875, 0, 0, 0) end end end addEventHandler("onColShapeLeave", col50, closeGate50)
  8. I open port s adn server work in local but don t work in WAN i need help plz see this plz help me http://imageshack.us/photo/my-images/28/8rsp.jpg/
  9. ah ty and this line ? pizzasLeft = guiCreateLabel (590, 182, 195, 55, "PIZZAS LEFT: " .. getElementData (source, "pizzajob.pizzas"), false)
  10. yes yes it is !!! and if i fix this line another error appear in this line pizzasLeft = guiCreateLabel (590, 254, 195, 55 "PIZZAS LEFT: 0", false)
  11. I have a problem in pizza job in Client side here is the code function () local pizzadriver = getVehicleController (source) if pizzaVehicles [getElementModel (source)] and pizzaSkins [getElementModel (pizzadriver)] then GUIEditor = { gridlist = {}, label = {} } GUIEditor.gridlist[1] = guiCreateGridList(586, 161, 204, 172, false) pizzasLeft = guiCreateLabel (590, 182, 195, 55, "PIZZAS LEFT: " .. getElementData (source, "pizzajob.pizzas"), false) elseif not getElementData (source, "pizzajob.pizzas") then pizzasLeft = guiCreateLabel (590, 254, 195, 55 "PIZZAS LEFT: 0", false) end if not pizzadriver then return end outputChatBox (" Deliver Pizzas to marked areas on your radar!", 255, 255, 0, true) guiSetFont (pizzasLeft, "default-bold-small") guiLabelSetColor (pizzasLeft, 255, 100, 0) bindKey ("mouse1", "down", throwPizza, pizzadriver) refillPizza = createMarker (2096.6, -1807, 12.5, "cylinder", 3.5, 255, 255, 50, 90, pizzadriver) if isElement (pizzaHouse) and isElement (pizzaHouseBlip) then return triggerEvent ("startPizzaboy", pizzadriver) end end ) the fellowing message appear in debugscript 3 attempt to concatenate a boolean value at line 9 and another error at line 11 plz help
  12. ty very much it s work now but the close button dont work ?? how to fix it ?
  13. here is the full script : https://community.multitheftauto.com/in ... ls&id=7847
  14. the fllowing error appear in debugscript 1 WARNING:loading script failed: PD-s.lua:13:') expected (toclose '('atline 2) near 'end'
  15. here is the meta file "darhal" name="police job" version="5.0" type="script"/> "jail.map" />
  16. When the gui open , I select a vehicle THEN I CLICK SPAWN but the car dont spawn i dk why ???? and the ERROR appear
  17. yes i thik there is a problem in server side line 2 or 13 mear end ...
  18. ty castilo u are the best !!! it s work now but see this shown at debugscript 1 Error : Client (darhal) triggered serverside event cars , but event is not added serverside help plz !
×
×
  • Create New...