Jump to content

Bloqueo de zona, suspension de armas.


angelberge

Recommended Posts

Posted

Hola me gustaria saber cuales son las funciones que se necesitan para el bloqueo de una zona, osea que en determinada coordenada no se pueda disparar para suspender las armas en esa zona.

Agradezco su colaboracion.

  • Other Languages Moderators
Posted

No esta perfecto, pero es para que tengas una idea..

safecol = createColCuboid ( x, y, z, 255, 255, 255 ) -- pones tu posición 
RadarArea = createRadarArea ( x, y, 100, 100, 255, 0, 0, 10 ) -- pones la misma posición en " x, y, " 
  
function EntrarALaZona(hitPlayer,thePlayer) 
    toggleControl (hitPlayer, "aim_weapon", true) 
    outputChatBox("Aqui tu mensaje de Entrada", hitPlayer, 0, 255, 0) 
       else 
    end 
end 
addEventHandler( "onColShapeHit", safecol, EntrarALaZona ) 
  
function SalirDeLaZona(hitPlayer,thePlayer) 
    toggleControl (hitPlayer, "aim_weapon", false) 
    outputChatBox("Aqui tu mensaje de salida", hitPlayer, 255, 0, 0) 
    end 
end 
addEventHandler( "onColShapeLeave", safecol, SalirDeLaZona ) 

Posted
No esta perfecto, pero es para que tengas una idea..
safecol = createColCuboid ( x, y, z, 255, 255, 255 ) -- pones tu posición 
RadarArea = createRadarArea ( x, y, 100, 100, 255, 0, 0, 10 ) -- pones la misma posición en " x, y, " 
  
function EntrarALaZona(hitPlayer,thePlayer) 
    toggleControl (hitPlayer, "aim_weapon", true) 
    outputChatBox("Aqui tu mensaje de Entrada", hitPlayer, 0, 255, 0) 
       else 
    end 
end 
addEventHandler( "onColShapeHit", safecol, EntrarALaZona ) 
  
function SalirDeLaZona(hitPlayer,thePlayer) 
    toggleControl (hitPlayer, "aim_weapon", false) 
    outputChatBox("Aqui tu mensaje de salida", hitPlayer, 255, 0, 0) 
    end 
end 
addEventHandler( "onColShapeLeave", safecol, SalirDeLaZona ) 

Gracias creo que asi logro comprender mas :D, Ademas para que tenga un tiempo de 1 min para estar en la zona y si no la despeja automaticamente el jugador muere.

Me gustaria saber de donde toman estas posiciones.

safecol = createColCuboid ( x, y, z, 255, 255, 255 ) -- pones tu posición 
RadarArea = createRadarArea ( x, y, 100, 100, 255, 0, 0, 10 ) 

Posted

Gracias creo que asi logro comprender mas :D, Ademas para que tenga un tiempo de 1 min para estar en la zona y si no la despeja automaticamente el jugador muere.

function addTimer(hitElement) 
       if (getElementType(hitElement) ~= "player") then return end 
       addedtimer[hitElement] = setTimer(killPed, 60000, 1, hitElement) 
end 
addEventHandler( "onColShapeHit", safecol, addTimer) 
  
function removeTimer(hitElement) 
       if (isTimer(addedtimer[hitElement])) then 
                killTimer(addedtimer[hitElement]) 
       end 
end 
addEventHandler( "onColShapeLeave", safecol, removeTimer) 

Posted

Gracias creo que asi logro comprender mas :D, Ademas para que tenga un tiempo de 1 min para estar en la zona y si no la despeja automaticamente el jugador muere.

function addTimer(hitElement) 
       if (getElementType(hitElement) ~= "player") then return end 
       addedtimer[hitElement] = setTimer(killPed, 60000, 1, hitElement) 
end 
addEventHandler( "onColShapeHit", safecol, addTimer) 
  
function removeTimer(hitElement) 
       if (isTimer(addedtimer[hitElement])) then 
                killTimer(addedtimer[hitElement]) 
       end 
end 
addEventHandler( "onColShapeLeave", safecol, removeTimer) 

Ehm, te olvidaste de definir la tabla 'addedtimer'.

  • Other Languages Moderators
Posted

Me gustaria saber de donde toman estas posiciones.

safecol = createColCuboid ( x, y, z, 255, 255, 255 ) -- pones tu posición 
RadarArea = createRadarArea ( x, y, 100, 100, 255, 0, 0, 10 ) 

Intenta usar el admin panel o para que se te sea mas facil busca algún script que te muestre las posiciones x y z

y remplazas "x" por el numero que te aya salido al igual que "y" & "z".

Suerte y Bienvenido al Aprendizaje.

  • 1 year later...
Posted

Me sale este error:

CRIPT ERROR: safezone\safezone.lua:7: 'end' expected (to close 'function' at line 4) near 'else'

ERROR: Loading script failed: safezone\safezone.lua:7: 'end' expected (to close 'function' at line 4) near 'else'

No entiendo porque sale eso.

Aca dejo las lineas:

safecol = createColCuboid ( x, y, z, 255, 255, 255 ) -- pones tu posición 
RadarArea = createRadarArea ( x, y, 100, 100, 255, 0, 0, 10 ) -- pones la misma posición en " x, y, " 
  
function EntrarALaZona(hitPlayer,thePlayer) 
    toggleControl (hitPlayer, "aim_weapon", true) 
    outputChatBox("Aqui tu mensaje de Entrada", hitPlayer, 0, 255, 0) 
       else 
    end 
end 
addEventHandler( "onColShapeHit", safecol, EntrarALaZona ) 
  
function SalirDeLaZona(hitPlayer,thePlayer) 
    toggleControl (hitPlayer, "aim_weapon", false) 
    outputChatBox("Aqui tu mensaje de salida", hitPlayer, 255, 0, 0) 
    end 
end 
addEventHandler( "onColShapeLeave", safecol, SalirDeLaZona ) 

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...