Jump to content

xeon17

Members
  • Posts

    1,903
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by xeon17

  1. Good job , you always impress me with your knowledge. But you should know , if i restart my router, the IP will be changed.
  2. Why you're posting in a so old topic, haven't you nothing better to do in your boring life? And i never said my english is the best , but i think you shouldn't say that my english is bad , since you're using google translate and all know how good your english is , even your native language is bad. By the way , an moderator please lock this topic.
  3. xeon17

    [help]Drugs

    If I do it for you , what you'll learn from it?
  4. xeon17

    [help]Drugs

    Then pay a scripter viewforum.php?f=177
  5. xeon17

    [help]Drugs

    You're in the wrong board homie , here we help peoples with scripting problems/bugs. getPlayerTeam
  6. xeon17

    fixed

    True , i don't know what was with me today Fixed it.
  7. In brazilians servers , the minimum download is 400MB
  8. xeon17

    PlaySound3D

    Can you tell us , what are you trying to do. Instead of using a trigger , you could play the music on client side for everybody when the resource start or with a command.
  9. xeon17

    Lag in MTA

    I think it's solved , thank you Grafu!
  10. xeon17

    fixed

    addEventHandler ( "onResourceStart", resourceRoot, function () for _, player in ipairs(getElementsByType("player")) do spawnPlayer (player, 3242.27734375, -1901.7502441406, 24.918750762939) end end) addEventHandler("onPlayerSpawn", getRootElement(), function () giveWeapon(source, 31, 200) end)
  11. xeon17

    PlaySound3D

    Copy my code again.
  12. xeon17

    PlaySound3D

    Server drop = createObject(2903, xpvq,ypvq,zpvq, 0, 0, 0) addEventHandler("onResourceStart",resourceRoot, function() for _, player in ipairs(getElementsByType("player")) do triggerClientEvent(player,"airdropSound",player) end) Client: addEvent("airdropSound", true) addEventHandler("airdropSound", root function ( ) x,y,z = getElementPosition( source ) local sound = playSound3D("drop.mp3", x,y,z) setSoundMaxDistance(sound, 200) end ) @Edit, This should also work addCommandHandler("music", function () x,y,z = getElementPosition( localPlayer ) local sound = playSound3D("drop.mp3", x,y,z) setSoundMaxDistance(sound, 200) end )
  13. xeon17

    resolved.

    local _setElementData = setElementData function setElementData ( element, group, value ) return _setElementData ( element, group, value, true ) end local turfLocs = { } function createTurf ( x, y, z, width, height, owner, forcedId ) local owner = tostring( owner ) or nil local r, g, b = getTeamColor ( owner ) if not r then r = 255 end if not g then g = 255 end if not b then b = 255 end if ( owner == "server" ) then r, g, b = 0, 255, 255 end local rad = createRadarArea ( x, y, width, height, r, g, b, 170 ) local col = createColCuboid ( x, y, z-5, width, height, 35) if ( not forcedId or turfLocs [ id ] ) then id = 0 while ( turfLocs [ id ] ) do id = id + 1 end else id = forcedId end turfLocs[id] = { } turfLocs[id].col = col turfLocs[id].radar = rad turfLocs[id].owner = owner or nil turfLocs[id].attackers = nil turfLocs[id].attackProg = 0 turfLocs[id].prepProg = 0 setElementData ( turfLocs[id].col, "NGTurf:TurfId", id ) setElementData ( turfLocs[id].col, "NGTurf:TurffingTable", turfLocs [ id ] ) addEventHandler ( "onColShapeHit", turfLocs[id].col, onColShapeHit ) addEventHandler ( "onColShapeLeave", turfLocs[id].col, onColShapeLeave ) return turfLocs[id]; end function updateTurfGroupColor ( group ) local r, g, b = getTeamColor ( group ) for i, v in pairs ( turfLocs ) do if ( v.owner == group ) then setRadarAreaColor ( v.radar, r, g, b, 120 ) end end end function onColShapeHit ( player ) if ( player and isElement ( player ) and getElementType ( player ) == "player" and not isPedInVehicle ( player ) ) then local gang = getPlayerTeam ( player ) triggerClientEvent ( player, "NGTurfs:onClientEnterTurfArea", player, turfLocs [ id ] ) if ( not gang ) then return outputChatBox ( "You're not in a gang, you cannot turf.", player, 255, 255, 0 ) end local id = tonumber ( getElementData ( source, "NGTurf:TurfId" ) ) if ( turfLocs[id].owner == gang ) then return end if ( turfLocs[id].attackers and turfLocs[id].attackers ~= gang ) then return outputChatBox ( "A gang "..tostring(turfLocs[id].attackers).." já está conquistando esse territorio. Tente mais tarde!.", player, 255, 0, 0 ) end if ( not turfLocs[id].attackers ) then outputChatBox ( "You have started to prepare a turf war. Find cover, call backup, and wait for it to begin.", player, 255, 255, 0 ) local x, y, z = getElementPosition ( source ) outputChatBox ( getPlayerName ( player ).." is preparing a turf war with "..tostring(turfLocs[id].owner).." in "..getZoneName(x,y,z)..", "..getZoneName(x,y,z,true).."! Get there to help him, the war will start in 2 minutes!", gang, 255, 255, 0 ) setRadarAreaFlashing ( turfLocs[id].radar, true ) turfLocs[id].attackers = gang turfLocs[id].attackProg = 0 turfLocs[id].prepProg = 0 setElementData ( turfLocs[id].col, "NGTurf:TurffingTable", turfLocs [ id ] ) end end end function onColShapeLeave ( player ) if ( player and getElementType ( player ) == "player" ) then triggerClientEvent ( player, "NGTurfs:onClientExitTurfArea", player, turfLocs [ getElementData ( source, "NGTurf:TurfId" ) ] ) end end setTimer ( function ( ) for id, data in pairs ( turfLocs ) do if ( data.attackers ) then local players = { attackers = { }, owners = { } } local isGangInTurf = false local isOwnerInTurf = false for i, v in pairs ( getElementsWithinColShape ( data.col, "player" ) ) do local g = getPlayerTeam ( v ) if ( g == data.attackers ) then isGangInTurf = true table.insert ( players.attackers, v ) elseif ( g == data.owner ) then isOwnerInTurf = true table.insert ( players.owners, v ) end end local x, y, z = getElementPosition ( data.col ) if ( isOwnerInTurf and isGangInTurf ) then outputChatBox ( "The turf war in "..getZoneName ( x,y,z )..", "..getZoneName ( x,y,z, true ).." is paused due to both gangs in the turf", turfLocs[id].attackers, 255, 255, 255 ) outputChatBox ( "The turf war in "..getZoneName ( x,y,z )..", "..getZoneName ( x,y,z, true ).." is paused due to both gangs in the turf", turfLocs[id].owner, 255, 255, 255 ) else -- Add Points To Attackers if ( isGangInTurf ) then -- Prep the war if ( turfLocs[id].attackProg == 0 ) then turfLocs[id].prepProg = data.prepProg + 2 if ( turfLocs[id].prepProg >= 100 ) then turfLocs[id].prepProg = 0 turfLocs[id].attackProg = 1 beginTurfWarOnTurf ( id ) end -- Attack War else turfLocs[id].attackProg = turfLocs[id].attackProg + 1 if ( turfLocs[id].attackProg == 100 ) then outputChatBox ( "Your gang has captured a turf in "..getZoneName ( x,y,z )..", "..getZoneName ( x,y,z, true ).." from the "..turfLocs[id].owner.." gang! Great job!", turfLocs[id].attackers, 0, 255, 0) outputChatBox ( "Your gang lost a turf in "..getZoneName ( x,y,z )..", "..getZoneName ( x,y,z, true ).." to the "..tostring(turfLocs[id].attackers).." gang.", turfLocs[id].owner, 255, 0, 0) setTurfOwner ( id, turfLocs[id].attackers ) end end -- Take points from attackers else -- Prepare war if ( turfLocs[id].attackProg == 0 ) then turfLocs[id].prepProg = data.prepProg - 2 if ( turfLocs[id].prepProg <= 0 ) then outputChatBox ( "Your gang lost the turf preparation war in "..getZoneName(x,y,z)..", "..getZoneName ( x,y,z, true ).." to the "..turfLocs[id].owner.." gang!", turfLocs[id].attackers, 255, 0, 0 ) outputChatBox ( "Your gang has defended the turf in "..getZoneName(x,y,z)..", "..getZoneName(x,y,z,true).."!", turfLocs[id].owner..", from the "..turfLocs[id].attackers.." gang, when it was being preped for a war", 0, 255, 0 ) setTurfOwner ( id, turfLocs[id].owner ) end -- Attacking war else turfLocs[id].attackProg = data.attackProg - 1 if ( turfLocs[id].attackProg <= 0 ) then outputChatBox ( "Your gang lost the turf war in "..getZoneName(x,y,z)..", "..getZoneName ( x,y,z, true ).." to the "..turfLocs[id].owner.." gang!", turfLocs[id].attackers, 255, 0, 0 ) outputChatBox ( "Your gang has defended the turf in "..getZoneName(x,y,z)..", "..getZoneName(x,y,z,true).." from the "..turfLocs[id].attackers.." gang", turfLocs[id].owner, 0, 255, 0 ) setTurfOwner ( id, turfLocs[id].owner ) end end end end for i, v in pairs ( players ) do for k, p in pairs ( v ) do triggerClientEvent ( p, "NGTurfs:upadateClientInfo", p, turfLocs [ id ] ) end end end end end, 800, 0 ) addEvent ( "NGTurfs:onTurfProgressChange", true ) --[[ addCommandHandler ( "attackprog", function ( p ) local gangAttacks = { } local g = getPlayerTeam ( p ) if ( not g ) then return outputChatBox ( "You're not in a gang", p, 255, 255, 0) end for i, v in pairs ( turfLocs ) do if ( v.attackers and v.attackers == g ) then gangAttacks [ i ] = true end end if ( table.len ( gangAttacks ) == 0 ) then return outputChatBox ( "Your gang isn't involved in any gang wars right now.", p, 255, 255, 0 ) end for id, _ in pairs ( gangAttacks ) do local x ,y, z = getElementPosition ( turfLocs[id].col ) outputChatBox ( "----Turf War Status---", p, 255, 255, 255, false ) outputChatBox ( "Current owner: "..turfLocs[id].owner, p, 255, 255, 255, false ) outputChatBox ( "Attacker: "..turfLocs[id].attackers, p, 255, 255, 255, false ) outputChatBox ( "Prep Progress: "..turfLocs[id].prepProg.."%", p, 255, 255, 255, false ) outputChatBox ( "Attack Progress: "..turfLocs[id].attackProg.."%", p, 255, 255, 255, false ) outputChatBox ( "Turf Location: "..getZoneName ( x, y, z )..", "..getZoneName ( x, y, z, true ), p, 255, 255, 255, false ) outputChatBox ( "Turf Server-ID: "..id, p, 255, 255, 255, false ) end end )]] function table.len ( tb ) local c = 0 for i, v in pairs ( tb ) do c = c + 1 end return c end function beginTurfWarOnTurf ( id ) local d = turfLocs [ id ] local x, y, z = getElementPosition ( d.col ) outputChatBox ( "Your gang has begun a turf war in "..getZoneName ( x, y, z)..", "..getZoneName ( x, y, z, true ).." against the "..d.owner.." gang! Get there an help!", d.attackers, 255, 255, 0 ) outputChatBox ( "One of your turfs in "..getZoneName ( x, y, z)..", "..getZoneName ( x, y, z, true ).." is being attacked by the "..tostring(d.attackers).." gang!", d.owners, 255, 0, 0 ) setRadarAreaColor ( d.radar, 255, 255, 255, 170 ) end function setTurfOwner ( id, owner ) setRadarAreaFlashing ( turfLocs[id].radar, false ) turfLocs[id].owner = owner turfLocs[id].attackers = nil turfLocs[id].attackProg = 0 local r, g, b = getTeamColor ( owner ) setRadarAreaColor ( turfLocs[id].radar, r, g, b, 120 ) saveTurfs ( ) end function getTurfs ( ) return turfLocs end function saveTurfs ( ) for id, data in pairs ( turfLocs ) do exports.NGSQL:db_exec ( "UPDATE turfs SET owner=? WHERE id=?", data.owner, id ) end return true end addEventHandler( "onResourceStart", getResourceRootElement( getThisResource ( ) ), function ( ) exports.NGSQL:db_exec ( "CREATE TABLE IF NOT EXISTS turfs ( id INT, owner VARCHAR(50), x FLOAT, y FLOAT, z FLOAT, width INT, height INT )" ) local query = exports.NGSQL:db_query ( "SELECT * FROM turfs" ) outputChatBox( tostring( query) ) if #query == 0 then outputChatBox('soherre') local query = { } local data = { { -1867.8, -107.43, 15.1, 58, 65 }, { -1866.5, -26.36, 15.29, 49, 200 }, { -1811.33, 743.43, 20, 85, 85 }, { -1991.5, 862.62, 34, 79, 42 }, { -2799.25, -200.6, 7.19, 83, 120 }, { -2136.84, 120.12, 30, 120, 190 }, { -2516.52, 718.16, 27.97, 118, 80 }, { -2516.41, 578.19, 16.62, 117, 120 }, { -2596.49, 818.05, 49.98, 59, 80 }, { -2453.17, 947.58, 45.43, 54, 80 }, { -2740.6, 344.59, 4.41, 68, 61 }, { -2696.24, 227.35, 4.33, 39.5, 50.5 }, { -2397.31, 82.99, 35.3, 133, 160 },
  14. Ok? what this have with scripting?
  15. Ask here whatever you want , i don't have a skype for MTA ( only private )
  16. Of course , it's pretty easy. Accepted = guiCreateButton(100, 385, 133, 22, "ACCEPT", false) -- Creation of the button "Accepted" addEventHandler ("onClientGUIClick", getRootElement(), function() if source == Accepted then -- If the clicked button is Accepted then outputChatBox("Button Clicked") -- It output a message " Button Clicked " end end) This should make you know , how it work. If you have more questions , feel free to say
  17. It's looks hard , but it's so easy just give it a try. Btw , use guieditor which make creation of GUI's so easy as possible. https://community.multitheftauto.com/in ... ils&id=141
  18. I don't know , have you already saw this page. But it's a awesome page , which tell you everything what you need to know to learn scripting GUI's https://wiki.multitheftauto.com/wiki/In ... ng_the_GUI
  19. Use the event ,https://wiki.multitheftauto.com/wiki/OnClientPlayerWasted to show the panel when the player die.
  20. xeon17

    House robbery

    Then ask your friend for help , by the way you shouldn't delete your scripts because they could help other peoples with the same or similar issue.
  21. xeon17

    Config problem?

    I'm not sure , but i think something is wrong with mtaserver.conf.
  22. Wrong board viewforum.php?f=177
  23. xeon17

    resolved.

    The turf system of Nerd Gaming have been released and can be used or edit.
  24. Maps look great on the pictures! i'll sure use them in my mgm server Good job dude
×
×
  • Create New...