Jump to content

Walid

Members
  • Posts

    1,491
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Walid

  1. spd_w it's not defined in your code.
  2. MTA team can't do nothing because he didn't upload them here , he is using his own website
  3. Done try to use this: ------------------------------------------------------ -- Scripting By Sasuke* -- Por Favor, no remuevas los creditos. -- Copyright © 2013 - Todos los derechos reservados. ------------------------------------------------------ local turfPos = { { 2133.1950683594, 633.66455078125, 0, 197.5, 92, 90 }, { 2486.5935058594, 678.20172119141, 0, 245, 133, 30 }, { 1856.2864990234, 627.07629394531, 0, 138.25, 152.75, 90 }, { 1576.8956298828, 662.84362792969, 0, 181, 120.5, 90 }, { 1577.6783447266, 943.66607666016, 0, 190, 190, 90 }, { 1383.4364013672, 909.61499023438, 0, 142, 230, 90 }, { 956.94744873047, 1011.635925293, 0, 220, 140, 90 }, { 1017.7476196289, 1203.4068603516, 0, 180, 165, 90 }, { 1017.623046875, 1383.4741210938, 0, 190, 290, 90 }, { 917.99707031253, 1623.6003417969, 0, 80, 220, 90 }, { 1017.7178955078, 1862.6740722656, 0, 140, 180, 90 }, { 912.50573730469, 1958.6761474609, 0, 90, 230, 90 }, { 1017.3455200195, 2063.38671875, 0, 150, 300, 90 }, { 1300.7644042969, 2095.5100097656, 0, 200, 140, 90 }, { 1398.1997070313, 2323.5505371094, 0, 160, 65, 90 }, { 1578.1955566406, 2284.0825195313, 0, 180, 110, 90 }, { 1237.6285400391, 2581.4663085938, 0, 450, 130, 90 }, { 1780.478515625, 2567.2121582031, 0, 130, 130, 90 }, { 1698.2750244141, 2724.494140625, 0, 200, 150, 90 }, { 2237.9494628906, 2723.7814941406, 0, 180, 110, 90 }, { 2498.6853027344, 2704.6188964844, 0, 300, 140, 90 }, { 2798.1267089844, 2303.9643554688, 0, 120, 300, 90 }, { 2557.5688476563, 2243.4963378906, 0, 100, 230, 90 }, { 2532.5830078125, 2063.4118652344, 0, 100, 150, 90 }, { 2558.1779785156, 1624.0816650391, 0, 100, 300, 90 }, { 2437.685546875, 1483.7209472656, 0, 160, 120, 90 }, { 2077.7106933594, 1203.5559082031, 0, 340, 170, 90 }, { 2082.3193359375, 979.23583984375, 0, 270, 210, 90 } } local areaPos = { { 2130, 630, 200, 100 }, { 2488.8793945313, 680.78289794922, 250, 130 }, { 1858, 623, 140, 165 }, { 1577, 663, 180, 130 }, { 1577, 943, 185, 190 }, { 1383, 909, 120, 230 }, { 956, 1011, 220, 140 }, { 1017, 1203, 180, 165 }, { 1017, 1383, 190, 290 }, { 917, 1623, 80, 220 }, { 1017, 1862, 140, 180 }, { 912, 1958, 90, 240 }, { 1017, 2063, 150, 300 }, { 1300, 2092, 200, 140 }, { 1398, 2323, 160, 65 }, { 1578, 2284, 180, 110 }, { 1237, 2581, 450, 130 }, { 1780, 2567, 130, 130 }, { 1698, 2724, 200, 150 }, { 2237, 2723, 180, 110 }, { 2498, 2704, 300, 140 }, { 2798, 2303, 120, 300 }, { 2557, 2243, 100, 230 }, { 2532, 2063, 100, 150 }, { 2558, 1624, 100, 300 }, { 2437, 1483, 160, 120 }, { 2077, 1203, 340, 170}, { 2082, 979, 270, 210 } } local turfElement = {} local turfTimer = {} checkComplete = false language = "Spanish" -- Pon "Spanish" para español -- Put "English" for english text addEventHandler("onResourceStart", resourceRoot, function() executeSQLQuery("CREATE TABLE IF NOT EXISTS Turf_System ( Turfs TEXT, GangOwner TEXT, r INT, g INT, b INT)") local check = executeSQLQuery("SELECT * FROM Turf_System" ) if #check == 0 then for i=1,#turfPos do executeSQLQuery("INSERT INTO Turf_System(Turfs,GangOwner,r,g,b) VALUES(?,?,?,?,?)", "Turf["..tostring(i).."]", "Nadie", 0, 255, 0) end end for i,v in ipairs(turfPos) do local sqlData = executeSQLQuery("SELECT * FROM Turf_System WHERE Turfs=?", "Turf["..tostring(i).."]") local turfCol = createColCuboid(unpack(v)) setElementData(turfCol, "getTurfGang", sqlData[1].GangOwner) local arg1,arg2,arg3,arg4 = unpack(areaPos[i]) local turfArea = createRadarArea(arg1, arg2, arg3, arg4, sqlData[1].r, sqlData[1].g, sqlData[1].b, 175) turfElement[turfCol] = {turfCol, turfArea, i} end if language == "Spanish" then outputDebugString("Sistema de turf by Sasuke* ha iniciado correctamente!") else outputDebugString("Turf System by Sasuke* was started correctly!") end end ) function radar ( player ) local theTable = turfElement[source] if (theTable) then local turf,area,id = turfElement[source][1] , turfElement[source][2] , turfElement[source][3] if turf and area and source == turf then local playerGang = getElementData ( player, "gang" ) local turfGang = executeSQLQuery("SELECT GangOwner FROM Turf_System WHERE Turfs=?", "Turf["..tostring(id).."]" ) if ( turfGang[1].GangOwner == playerGang ) then if language == "Spanish" then outputChatBox("Este territorio ya pertenece a "..turfGang[1].GangOwner or "Nadie", player, 0, 255, 0, false) else outputChatBox("This territory already belongs to "..turfGang[1].GangOwner or "None", player, 0, 255, 0, false) end else if not getPlayerTeam(player) then return end local team = getPlayerTeam ( player ) if ( getTeamName( team ) == "Alianza" ) or ( getTeamName( team ) == "Anarquía" ) then local playerGang = getElementData ( player, "gang" ) if ( isTimer ( turfTimer[source] ) ) then return end if ( playerGang ) then local r, g, b = unpack ( exports [ "gang_system" ]:getGangColor ( playerGang ) ) setRadarAreaFlashing ( area, true ) if turfGang[1].GangOwner ~= "Nadie" then if language == "Spanish" then outputChatBox("Entraste en la zona de "..turfGang[1].GangOwner..". Espera 2 minutos y la conquistarás.", player, 0, 255, 0, false) else outputChatBox("You enter into de "..turfGang[1].GangOwner.."'s turf zone. Wait 2 minutes to capture the turf and win 4k", player, 0, 255, 0, false) end else if language == "Spanish" then outputChatBox("¡Esta zona no pertenece a nadie, quédate aquí y conquistarás esta zona para el clan!", player, 0, 255, 0, false) else outputChatBox("This turf do not belong to anyone. Wait 2 minutes to capture the turf and win 4k", player, 0, 255, 0, false) end end turfTimer[source] = setTimer ( function ( ) local beachTurfCplayers = getElementColShape ( turf ) local players = getElementsWithinColShape ( turf, "player" ) setRadarAreaColor ( area, tonumber(r), tonumber(g), tonumber(b), 175 ) for _, player in ipairs ( players ) do if getElementData(player, "gang") == playerGang then if language == "Spanish" then outputChatBox("¡Tu clan ha conquistado la base!", player, 0, 255, 0, false) else outputChatBox("Congratulations. You capture the turf. +4K!", player, 0, 255, 0, false) end triggerClientEvent("onTakeTurf", player) executeSQLQuery("UPDATE Turf_System SET GangOwner=?,r=?,g=?,b=? WHERE Turfs=?", playerGang, tonumber(r), tonumber(g), tonumber(b), "Turf["..tostring(id).."]" ) -- setElementData ( turf, "getTurfGang", playerGang ) end end setRadarAreaFlashing ( area, false ) end ,120000, 1) -- 120000 end end end end end end addEventHandler ( "onColShapeHit", root, radar )
  4. Walid

    quetion

    bro creating a marker server side , or client side it's the same it will be visible for all . just it's depending on you how to create it.
  5. Guys i already helped him via PM . @raysmta next time try to write resolved ; fixed something like that.
  6. You need to use i think you are trying to use setElementPosition() spawnPlayer ( )
  7. lol i'm not spamming the topic , and i know what i'm talking about just because it's the first time that i saw something like this Adding sqlite db to the meta file. Anyways nvm.
  8. Lol are you serious he can use dbExec and he don't need to add the sqlite db to the meta file.
  9. Why he need to add Sqlite db to meta file ???
  10. There is no table called 'g_Players' more than that g_Me it's not defined. You must add something like this in your code g_Players = getElementsByType('player') g_Me = getLocalPlayer()
  11. Try this : nametag = {} local nametags = {} local g_screenX,g_screenY = guiGetScreenSize() local bHideNametags = false local NAMETAG_SCALE = 0.3 local NAMETAG_ALPHA_DISTANCE = 50 local NAMETAG_DISTANCE = 120 local NAMETAG_ALPHA = 120 local NAMETAG_TEXT_BAR_SPACE = 2 local NAMETAG_WIDTH = 50 local NAMETAG_HEIGHT = 5 local NAMETAG_TEXTSIZE = 0.3 local NAMETAG_OUTLINE_THICKNESS = 1.2 -- local NAMETAG_ALPHA_DIFF = NAMETAG_DISTANCE - NAMETAG_ALPHA_DISTANCE NAMETAG_SCALE = 1/NAMETAG_SCALE * 800 / g_screenY local maxScaleCurve = { {0, 0}, {3, 3}, {13, 5} } local textScaleCurve = { {0, 0.8}, {0.8, 1.2}, {99, 99} } local textAlphaCurve = { {0, 0}, {25, 100}, {120, 190}, {255, 190} } function nametag.create ( player ) nametags[player] = true end function nametag.destroy ( player ) nametags[player] = nil end function renderNametagsForPlayers() for i,player in ipairs(g_Players) do if player ~= g_Me then setPlayerNametagShowing ( player, false ) if not nametags[player] then nametag.create ( player ) end end end if bHideNametags then return end local x,y,z = getCameraMatrix() if getElementData(localPlayer,"loginState") then return end for player in pairs(nametags) do while true do if not isPedInVehicle(player) or isPlayerDead(player) then break end local vehicle = getPedOccupiedVehicle(player) local px,py,pz = getElementPosition ( vehicle ) local pdistance = getDistanceBetweenPoints3D ( x,y,z,px,py,pz ) if pdistance <= NAMETAG_DISTANCE then local sx,sy = getScreenFromWorldPosition ( px, py, pz+0.95, 0.06 ) if not sx or not sy then break end local scale = 1/(NAMETAG_SCALE * (pdistance / NAMETAG_DISTANCE)) local alpha = ((pdistance - NAMETAG_ALPHA_DISTANCE) / NAMETAG_ALPHA_DIFF) alpha = (alpha < 0) and NAMETAG_ALPHA or NAMETAG_ALPHA-(alpha*NAMETAG_ALPHA) scale = math.evalCurve(maxScaleCurve,scale) local textscale = math.evalCurve(textScaleCurve,scale) local textalpha = math.evalCurve(textAlphaCurve,alpha) local outlineThickness = NAMETAG_OUTLINE_THICKNESS*(scale) local r,g,b = 255,255,255 local team = getPlayerTeam(player) local tm = getTeamName(team) if team then r,g,b = getTeamColor(team) dxDrawText (tm.."\n"..getPlayerNametagText(player), sx, sy - offset, sx, sy - offset, tocolor(r,g,b,textalpha), textscale*NAMETAG_TEXTSIZE, raceInterface.font, "center", "bottom", false, false, false, true ) else dxDrawText ( getPlayerNametagText(player), sx, sy - offset, sx, sy - offset, tocolor(r,g,b,textalpha), textscale*NAMETAG_TEXTSIZE, raceInterface.font, "center", "bottom", false, false, false, true ) end local offset = (scale) * NAMETAG_TEXT_BAR_SPACE/2 local drawX = sx - NAMETAG_WIDTH*scale/2 drawY = sy + offset local width,height = NAMETAG_WIDTH*scale, NAMETAG_HEIGHT*scale local health = getElementHealth(vehicle) health = math.max(health - 250, 0)/750 local p = -510*(health^2) local r,g = math.max(math.min(p + 255*health + 255, 255), 0), math.max(math.min(p + 765*health, 255), 0) end break end end end addEventHandler('onClientResourceStart', g_ResRoot, function() for i,player in ipairs(getElementsByType"player") do if player ~= g_Me then nametag.create ( player ) end end end ) addEventHandler ( "onClientPlayerJoin", g_Root, function() if source == g_Me then return end setPlayerNametagShowing ( source, false ) nametag.create ( source ) end ) addEventHandler ( "onClientPlayerQuit", g_Root, function() nametag.destroy ( source ) end ) addEvent ( "onClientScreenFadedOut", true ) addEventHandler ( "onClientScreenFadedOut", g_Root, function() bHideNametags = true end ) addEvent ( "onClientScreenFadedIn", true ) addEventHandler ( "onClientScreenFadedIn", g_Root, function() bHideNametags = false end ) this : it must be like this :
  12. Walid

    Help GUI!

    show me your code.
  13. your code is wrong it must be like this : function nextMapSet(confirm, mapname) if confirm == true then g_dxGUI.mapdisplay:position(2, sH - fontX*1.5, false) fps:position(2, sH-fontX*3.5, false) spectators:position(2, sH-fontX*2.5, false) g_dxGUI.nextmapdisplay:visible(true) g_dxGUI.nextmapdisplay:text("#FF0000Next Map: #ffffff" ..mapname) else g_dxGUI.nextmapdisplay:visible(false) g_dxGUI.mapdisplay:position(2, sH - fontX/2, false) fps:position(2, sH-fontX*2.5, false) spectators:position(2, sH-fontX*1.5, false) end end addEvent("onNextMap", true) addEventHandler("onNextMap", getRootElement(), nextMapSet) Post your nametags.lua here
  14. Walid

    Help GUI!

    i think there is something wrong with your (dimension;interior)
  15. Walid

    Help GUI!

    try this if it dosen't work , try triggerClientEvent from server side (onPlayerWasted) function onDeath () if source == localPlayer then spawnSystem() triggerServerEvent ( "on.death", localPlayer ) end end addEventHandler("onClientPlayerWasted", getRootElement(), onDeath)
  16. Walid

    Help GUI!

    the function must be in the same resource (client side)
  17. Change source with localPlayer setElementInterior ( localPlayer, 0 ) Ex: function clickGrid() local row,col = guiGridListGetSelectedItem(mainGridlist) if (row and col and row ~= -1 and col ~= -1) then setElementModel ( dummyPed, 29 ) triggerServerEvent ( "zombie.hunters", localPlayer) guiSetVisible ( spawnMenu, false ) showCursor ( false ) destroyElement ( dummyPed ) setElementInterior ( localPlayer, 0 ) setElementDimension (localPlayer, 0 ) end end
×
×
  • Create New...