Jump to content

xeon17

Members
  • Posts

    1,903
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by xeon17

  1. You should edit the script where is the superman command , it need to have the three argument as true. later add "command.superman" access="true"> In admin acl. not defualt
  2. You can make a command accessible only for admins if you do the following; addCommandHandler("admincommand",adminfunction,true) https://wiki.multitheftauto.com/wiki/AddCommandHandler
  3. https://wiki.multitheftauto.com/wiki/ACL
  4. xeon17

    [PLEASE] Script

    i want to Samp /dann not MTA What?
  5. I would like to recommend you the tutorial of xXMADEXx which contain everything what you need to know about tables and also great examples https://forum.multitheftauto.com/viewtopic.php?f=148&t=75501
  6. xeon17

    Logging in

    The resource doesn't need any acl rights..
  7. Can you add screenshots please? the gamemode idea is pretty cool.
  8. Without this , it would give a error and the dxRecetangle won't appear.
  9. Eu tenho que avisá-lo, este é o fórum Português onde todas as mensagens precisam estar em Português
  10. Hello there I'm trying to do dxRectangle, work with the server side SetTimer, as follows, where every 1 second it adds +1 dxRectangle size, and when the dxrectangle reach 250 size it disappears and starts the attack on the territory. Actually the problem is , when i get in the area , the dxRectangle apper and stay on 0 , it doesn't start. Server local _setElementData = setElementData function setElementData ( element, group, value ) return _setElementData ( element, group, value, true ) end local turf = { } function createArea( x, y, w, h, owner, forcedId ) local owner = tostring( owner ) or "server" 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 = 255, 255, 255 end local radar = createRadarArea ( x, y, w, h, r, g, b, 200 ) local col = createColRectangle ( x, y, w, h ) if ( not forcedId or turf[ id ] ) then id = 0 while ( turf[id] ) do id = id + 1000 end else id = forcedId end turf[id] = { } turf[id].col = col turf[id].area = radar turf[id].owner = owner or "server" turf[id].attackers = nil turf[id].seg = 0 setElementData ( turf[id].col, "turfId", id ) setElementData ( turf[id].col, "TurffingTable", turf[id] ) addEventHandler ( "onColShapeHit", turf[id].col, onColShapeHit ) addEventHandler ( "onColShapeLeave", turf[id].col, onColShapeLeave ) return turf[id] end function onColShapeHit (player) if ( player and isElement( player ) and getElementType ( player ) == "player" and not isPedInVehicle( player ) ) then local gang = getPlayerTeam ( player ) if ( not gang ) then return outputChatBox ( "você não está em uma gang. Não pode dominar", player, 255, 255, 0 ) end local id = tonumber ( getElementData ( source, "turfId") ) if ( turf[id].owner == gang ) then return end if ( turf[id].attackers and turf[id].attackers ~= gang ) then return outputChatBox ( " A gang "..getTeamName( turf[id].attackers).." ja está dominando este territorio", player, 255, 0, 0 ) end if ( not turf[id].attackers ) then if ( not turf[id].owner == "server" ) then outputChatBox ( "você está preparando - se para dominar esse territorio!", player, 255, 255, 0 ) local x, y, z = getElementPosition( source ) for i, v in pairs ( getPlayersInTeam(getPlayerTeam(player))) do if ( player ~= v ) then outputChatBox( getPlayerName( player ).. " está dominando o territorio "..getZoneName(x, y, z).." !", v, 255, 255, 0 ) end end else outputChatBox ( "Você está preparando uma guerra no territorio. Se esconda, chame reforço e espere começar o ataque!", player, 255, 255, 0 ) local x, y, z = getElementPosition ( source ) for i, v in ipairs (getPlayersInTeam(getPlayerTeam(player))) do if ( player ~= v ) then outputChatBox ( getPlayerName( player ).." está preparando um ataque no territorio "..getZoneName(x,y,z)..", "..getZoneName(x,y,z,true).."! venham ajudar, o ataque começa em 2 minutos!", v, 255, 255, 0 ) end end end end end end function onColShapeLeave( player ) if ( player and getElementType ( player ) == "player" ) then triggerClientEvent ( player, "dominar_stop", player, turf[id] ) end end setTimer( function ( ) for id, data in pairs ( turf ) 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 ( isGangInTurf ) then if ( turf[id].owner == "server" ) then turf[id].seg = turf[id].seg + 1 if ( turf[id].seg >= 250 ) then outputChatBox( "A gang "..getTeamName(turf[id].attackers).." dominou o territorio "..getZoneName( x, y, z).."!.", root, 0, 255, 0) setTurfOwner( id, turf[id].attackers ) end end end for i, v in pairs ( players ) do for k, p in pairs ( v ) do end end end end end, 1000, 0) addEvent( "onTurfProgress", true) 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 = turf[id] local x, y, z = getElementPosition ( d.col ) if ( d.owner == "server" ) then return end outputChatBox ( "A gang "..getTeamName(d.attackers).." está atacando o territorio "..getZoneName ( x, y, z).." da gang "..getTeamName(d.owner).."!.", root, 255, 255, 0) setRadarAreaColor ( d.radar, 255, 0, 0, 100 ) setRadarAreaFlashing( d.radar, true) end function setTurfOwner ( id, owner ) setRadarAreaFlashing ( turf[id].radar, false ) turf[id].owner = owner turf[id].attackers = nil turf[id].attackProg = 0 local r, g, b = getTeamColor ( owner ) setRadarAreaColor ( turf[id].radar, r, g, b, 180 ) saveTurfs ( ) end function getTurfs ( ) return turf end function saveTurfs ( ) for id, data in pairs ( turf ) do exports.NGSQL:db_exec ( "UPDATE areas 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 areas ( id INT, owner VARCHAR(50), x FLOAT, y FLOAT, z FLOAT, width INT, height INT )" ) local query = exports.NGSQL:db_query ( "SELECT * FROM areas" ) outputChatBox( tostring( query) ) if #query == 0 then outputChatBox('soherre') local query = { } local data = { { 232.160, -153.421, 400, 400 } } for i, v in pairs ( data ) do query[i] = { ['x'] = v[1], ['y'] = v[2], ['width'] = v[3], ['height'] = v[4], ['owner'] = "server" } local v = query[ i ] local owner, x, y, width, height = v['owner'], tonumber ( v['x'] ), tonumber ( v['y'] ), tonumber ( v['width'] ), tonumber ( v['height'] ) outputChatBox( tostring(owner) ) local turf = createArea ( x, y, width, height, owner ) outputChatBox( tostring( turf ) ) outputChatBox( 'tap' ) end else outputChatBox('atap2') for i=1, #query do local v = query[ i ] outputChatBox(" kya ") local id, owner, x, y, z, width, height = tonumber ( v['id'] ), v['owner'], tonumber ( v['x'] ), tonumber ( v['y'] ), tonumber ( v['width'] ), tonumber ( v['height'] ) outputChatBox( tostring(owner) ) createArea ( x, y, width, height, owner, id ) end end end ) Client function dominar_start ( ) addEventHandler ( "onClientRender", root, dominar_render ) end addEvent ( "dominar_start", true ) addEventHandler ( "dominar_start", root, dominar_start ) function dominar_stop ( ) removeEventHandler ( "onClientRender", root, dominar_render ) end addEvent ( "dominar_stop", true ) addEventHandler ( "dominar_stop", root, dominar_stop ) function dominar_render () local seg = 0 dxDrawRectangle(55, 478, seg, 20, tocolor(255, 100, 0, 255), false) dxDrawLine(54, 478, 304, 478, tocolor(255, 255, 255, 255), 1, false) dxDrawLine(304, 478, 304, 498, tocolor(255, 255, 255, 255), 1, false) dxDrawLine(54, 498, 304, 498, tocolor(255, 255, 255, 255), 1, false) dxDrawLine(54, 478, 54, 498, tocolor(255, 255, 255, 255), 1, false) dxDrawText("atacando territorio!", 53, 478, 304, 498, tocolor(255, 255, 255, 255), 0.65, "bankgothic", "center", "center", false, false, false, false, false) end
  11. xeon17

    Crouching

    setGlitchEnabled ( "crouchbug", false ) ?
  12. DNL291, essa sua atitude foi inaceitável para um Moderador Global. Você apenas apagou os comentários porque o #RooTs fico inventando história pra você acreditar no skype. Parabéns pelo profissionalismo, seus dias no fórum estão contados. Apaga esse comentário, e verá os resultados.
  13. I didn't understood so good what you said , but i'm pretty sure this is what you want.. https://community.multitheftauto.com/in ... ils&id=233
  14. Typo on line 3 , should be ; if (playerteam) then
  15. function RepairMarker(hitElement) if (getElementType(hitElement) == "vehicle") then if (getElementHealth(hitElement) < 1000) then if (getVehicleOccupant(hitElement)) then local driver = getVehicleOccupant(hitElement) local charge = math.floor(1000-getElementHealth(hitElement)) if (getPlayerMoney(driver) >= charge) then outputChatBox("Your vehicle has been repaired for $"..charge..".",driver,255,255,0) fixVehicle(hitElement) takePlayerMoney(driver,charge) end end end end end addEventHandler("onMarkerHit",marker,RepairMarker)
  16. What if he don't like the suggestion? by the way , you can't do a so easy thing?
  17. local marker = createMarker(2064.46924,-1831.39221,12.6, "cylinder",4,255,255,0) addEventHandler("onMarkerHit",marker, function(thePlayer) if getElementType(thePlayer) =="player" and isPedInVehicle( thePlayer ) then local veh = getPedOccupiedVehicle(thePlayer) if (veh) then money = getPlayerMoney(thePlayer) if money >= 1000 then fixVehicle(veh) takePlayerMoney(thePlayer, 1000) outputChatBox("Your "..getVehicleName(veh).." was repaired" ) end end end end) I rewrote some things in your code , because i didn't understand what you want at all . And VehH = math(1000 -getElementHealth(veh) doesn't make sense.
  18. xeon17

    [help]Drugs

    The function which show the GUI doesn't have any event or command , you should fix it.
  19. xeon17

    [help]Drugs

    1. In which team are you , when you tried to hit the marker 2. check /debugscript 3 , when hiting the marker or the resource restart.
  20. addEventHandler("onMarkerHit",marker, function(thePlayer) if getElementType( thePlayer ) == "player" and isPedInVehicle( thePlayer ) then local veh = getPedOccupiedVehicle(thePlayer) if (veh) then fixVehicle(veh) end end end)
×
×
  • Create New...