Jump to content

PaiN^

Members
  • Posts

    2,258
  • Joined

  • Last visited

Everything posted by PaiN^

  1. الخطأ الأول لأنه ما احتليت اي منطقة, في يحاول يجيب معلومات عن المناظق المحتله و ما يلقى حاجة أما الخطأ الثاني فجرب : ------------------------------------------------------ -- 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 = "English" -- 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 turf,area,id = unpack(turfElement[source]) 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 ) == "NoTeam" ) then local playerGang = getElementData ( player, "gang" ) if ( isTimer ( turfTimer[source] ) ) then return end if ( playerGang ) then local r, g, b = ( exports [ "groups-system" ]:getGangColour ( playerGang ) ) setRadarAreaFlashing ( area, true ) if turfGang[1].GangOwner ~= "Nadie" then if language == "Spanish" then outputChatBox("Entraste En La Zona De Turf de "..turfGang[1].GangOwner..". Espera 2 Minutos Para Poder Conquistar El Turf Y Ganar 4k", 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("Este Turf Aun No Pertenese A Nadie. Espera 2 Minutos Para Poder Conquistar El Turf Y Ganar 4k", 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("Felicidades Conquistaste El Turf +4K!", player, 0, 255, 0, false) else outputChatBox("Congratulations. You capture the turf. +4K!", player, 0, 255, 0, false) end triggerClientEvent("onTakeTurf", player) givePlayerMoney ( player, 4000 ) 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, area, r, g, b ) -- 120000 end end end end end addEventHandler ( "onColShapeHit", root, radar )
  2. addEventHandler( "onClientGUIChanged", root, function( ) if source == Your.Edit then guiGridListClear( Your.Grid ) local col = guiGridListAddColumn( Your.Grid, "Players ..", 5 ) local text = guiGetText( source ) if string.len( string.gsub( text, "%s", "" ) ) > 0 then for _, player in ipairs( getElementsByType( "player" ) ) do local row = guiGridListAddRow( Your.Grid ) local name = getPlayerName( player ) if name:find( text ) then guiGridListSetItemText( Your.Grid, row, col, name, false, false ) end end else for _, player in ipairs( getElementsByType( "player" ) ) do local row = guiGridListAddRow( Your.Grid ) local name = getPlayerName( player ) guiGridListSetItemText( Your.Grid, row, col, name, false, false ) end end end end )
  3. - Client side : -- events "onClientGUIClick" -- functions createMarker guiSetVisible triggerServerEvent - Server side : -- functions addEvent takePlayerMoney setElementData addCommandHandler getElementData destroyElement createVehicle getElementPosition
  4. ------------------------------------------------------ -- 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 = "English" -- 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 turf,area,id = unpack(turfElement[source]) 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 ) == "NoTeam" ) then local playerGang = getElementData ( player, "gang" ) if ( isTimer ( turfTimer[source] ) ) then return end if ( playerGang ) then local r, g, b = ( exports [ "groups-system" ]:getGangColour ( playerGang ) ) setRadarAreaFlashing ( area, true ) if turfGang[1].GangOwner ~= "Nadie" then if language == "Spanish" then outputChatBox("Entraste En La Zona De Turf de "..turfGang[1].GangOwner..". Espera 2 Minutos Para Poder Conquistar El Turf Y Ganar 4k", 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("Este Turf Aun No Pertenese A Nadie. Espera 2 Minutos Para Poder Conquistar El Turf Y Ganar 4k", 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("Felicidades Conquistaste El Turf +4K!", player, 0, 255, 0, false) else outputChatBox("Congratulations. You capture the turf. +4K!", player, 0, 255, 0, false) end triggerClientEvent("onTakeTurf", player) givePlayerMoney ( player, 4000 ) 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, area ) -- 120000 end end end end end addEventHandler ( "onColShapeHit", root, radar )
  5. جرب addEventHandler( "onClientGUIChanged", root, function( ) if source == Your.Edit then guiGridListClear( Your.Grid ) local text = guiGetText( source ) local column = guiGridListAddColumn( Your.Grid, "Players ..", 4 ) for _, v in ipairs( getElementsByType( "player" ) ) do if text ~= "" then local name = getPlayerName( v ) if name:find( v ) then local row = guiGridListAddRow( Your.Grid ) guiGridListSetItemText( Your.Grid, row, column, name, false, false ) end else local row = guiGridListAddRow( Your.Grid ) guiGridListSetItemText( Your.Grid, row, column, name, false, false ) end end end end ) لأسماء الايديت و القريد حقونك Your.Edit, Your.Grid غير
  6. addEvent( "onAdminCall", true ); addEventHandler( "onAdminCall", root, function( newname ) local staff = { }; for _, v in ipairs( getElementsByType( "player" ) ) do if hasObjectPermissionTo( v, "function.setPlayerMuted", true ) then outputChatBox( newname.." need help.Please contact the player", v, 255, 255, 0, true ) end end end )
  7. كودك ماله أي معنى, و الشي اللي طالبه معقد زود خبرتك في البرمجة بعدين حاول فيه
  8. Client side : Events > onClientResourceStart . Functions > triggerServerEvent . Server side : Functions > addEvent - setCameraMatrix - createVehicle - createPed - warpPedIntoVehicle]/wiki] - [wiki]setControlState - fadeCamera - spawnPlayer .
  9. function shout( player, cmd, ... ) local accountname = getAccountName( getPlayerAccount( player ) ) if isObjectInACLGroup( "user." .. accountname, aclGetGroup( "Admin" ) ) then for id, players in ipairs( getElementsByType( "player" ) ) do local message = table.concat( { ... }, " " ) local textDisplay = textCreateDisplay( ) local nombre = getPlayerName( player ) local textItem = textCreateTextItem( message, 0.5, 0.9, 2, 205, 0, 0, 255, 3, "center", "center" ) textDisplayAddText( textDisplay, textItem ) textDisplayAddObserver( textDisplay, players ) setTimer( textDestroyTextItem, 5000, 1, textItem ) setTimer( textDestroyDisplay, 5000, 1, textDisplay ) end else outputChatBox( "You cannot use this command!", player, 255, 12, 15 ) end end addCommandHandler( "shout", shout ) --Credits to SolidSnake14 for help.
  10. أولا ترى الله من علينا بنعمة البصر, مو لازم تكبر أوم الخط ثانيا عناد أعطاك مثال مية مية للتريقر, و بالنسبة للنقاط و مدري وش : setElementData getElementData
  11. * Server side : addEvent( "Team", true ) addEventHandler( "Team", root, function( team ) setPlayerTeam( client, team ) end ) * Client side : addEventHandler( "onClientResourceStart", resourceRoot, function( ) local team = getPlayerTeam( localPlayer ) if team then setElementData( localPlayer, "Team", team ) end end ) addEventHandler( "onClientGUIClick", Button, function( ) local team = getPlayerTeam( localPlayer ) if team then triggerServerEvent( "Team", localPlayer, nil ) else local team = getElementData( localPlayer, "Team" ) if team then triggerServerEvent( "Team", localPlayer, team ) end end end )
  12. That's because you're using absolute coordinates for the screen position . You need to make them relative . Since you're using DX - functions ( which can only have absolute values as coordinates ), I would do something like this : local position_x, position_y = 0.05, 0.05 -- set the position in relative coordinates, then convert the coordinates to absolute . function RelativeToabsolute( x, y ) if type( x ) ~= "number" or type( y ) ~= "number" then return false end local screen = { guiGetScreenSize( ) } x = x * screen[1] y = y * screen[2] return x, y end function dx_draw( ) local x, y = RelativeToabsolute( position_x, position_y ) dxDrawText( "Hello", x, y, ... ) end addEventHandler( "onClientRender", root, dx_draw )
  13. To get the camera's position you'l need to use getCameraMatrix . Then, hide the HUD using showPlayerHudComponent . And take the pic using takePlayerScreenShot .
  14. @ Sasuke : I know that, read what i've said . @ |GMC|LinKin : An example of what ? Use SQLite database saving function ( executeSQLQuery ).
  15. شغل نآيس و تشكر عليه و صدقني ما شفت الموضوع من يوم رجعت الا اللحين ذذ
  16. معليش يا خوي, اشرحلي ايش تبغى مرة ثانية بالله
  17. addEvent > لإضافة حدث ماهو موجود في اللعبة, زي لمن تسوي لوحة تسجيل وتحتاج أحداث زي "onPlayerRegister" فتستخدم هذي الوظيفة لإضافة هذا الحدث addEventHandler > سواء كان حدث انت ضايفه بالوظيفة اللي فوق او كان حدث موجود في اللعبة هذي الوظيفة تستخدم إذا بغيت تسوي شي عند وقوع حدث زي مثلا, لمن يموت لاعب أو لمن لاعب يدخل السيرفر أو لمن مود يشتغل و كذا
  18. وأنا اللي أحسبه معدل على المود ومو عارف يكمل شكلو عشان كذا قاعد يتجاهل ردودي ههههههههههه
  19. Well to make a resource like that, you'll require more knowledge in SQLite data base saving method. And I don't think it's possible to move the data stored by SQLite from one server to another just by moving the resource folder .
  20. In server-side, the player is defined once needed, for e.g. : If you want to define him with a command, it will be like this : addCommandHandler( "cmd", function( thePlayer ) -- end ) Also, a lot of events have the player as a source or an argument .
  21. PaiN^

    Saving colors

    setVehicleColor -- r2, g2, b2 And for the saving, you can use Account Data : setAccountData getAccountData I find it much easier .
×
×
  • Create New...