Jump to content

Problem with Marker and command


DuFraN

Recommended Posts

Posted
--Rob by DuFraN 
  
function Iniciar_Script() 
Marker_Entrada_Robo_Hamburgueseria = createMarker (811.28,-1616.14,12.54,"cylinder",2,255,255,0,50) 
Marker_Salida_Robo_Hamburgueseria = createMarker (459.91,-88.6,998.5,"cylinder",2,255,255,0,50) 
Blip_Robo_Hamburgueseria = createBlipAttachedTo (Marker_Entrada_Robo_Hamburgueseria,32,2,255,0,0,0,0,200,root) 
Circulo_De_Escape = createColCircle (815,-1616.37,100) 
setElementInterior(Marker_Salida_Robo_Hamburgueseria,4) 
Robo_Hamburgueseria = createElement ("Robo_Hamburgueseria") 
setElementData(Robo_Hamburgueseria,"Robo_Hamburgueseria","Si") 
setElementData(Robo_Hamburgueseria,"Robo_Hamburgueseria_Criminales_Totales",0) 
addEventHandler("onMarkerHit",Marker_Entrada_Robo_Hamburgueseria, Iniciar_Script() 
addEventHandler("onMarkerHit",Marker_Salida_Robo_Hamburgueseria, Iniciar_Script() 
  
Marker_Iniciar_Robo = createMarker (448,-87,998,"cylinder",5,255,0,0,50) 
setElementInterior(Marker_Iniciar_Robo,4) 
end 
addEventHandler("onMarkerHit",getResourceRootElement(getThisResource()),Iniciar_Script) 
  
  
function Marker(Jugador) 
local Team = getPlayerTeam(Jugador) 
local Team_Nombre = getTeamName(Team) 
    if getElementData(Robo_Hamburgueseria,"Robo_Hamburgueseria") == "Si" and (getElementData(Robo_Hamburgueseria,"Robo_Hamburgueseria_Criminales_Totales") <= 4) and Team_Nombre == "Criminales" then 
        setElementData(Robo_Hamburgueseria,"Robo_Hamburgueseria_Criminales_Totales",getElementData(Robo_Hamburgueseria,"Robo_Hamburgueseria_Criminales_Totales")+1) 
        setElementInterior(Jugador,4) 
        setElementData(Jugador,"Robo_Hamburgueseria","Si") 
        setElementPosition(Jugador,457.18,-88.40,999.5) 
        outputChatBox("Has entrado al lugar del robo, para robar usa #FFFFFF/robarhamburgueseria",Jugador,200,0,0,true) 
    end 
end 
  
  
function Marker_Salida(Jugador) 
        setElementData(Jugador,"Robo_Hamburgueseria","No") 
        setElementInterior(Jugador,0) 
        setElementPosition(Jugador,814.7,-1616.7,13.6) 
        setElementData(Robo_Hamburgueseria,"Robo_Hamburgueseria_Criminales_Totales",getElementData(Robo_Hamburgueseria,"Robo_Hamburgueseria_Criminales_Totales")-1) 
end 
  
function comprobar() 
local Criminales = getElementsByType ( "player" ) 
for theKey,thePlayer in ipairs(Criminales) do 
local Team = getPlayerTeam(thePlayer) 
local Team_Nombre = getTeamName(Team) 
    if isElementWithinMarker (thePlayer,Marker_Iniciar_Robo) and getElementData(Robo_Hamburgueseria,"Robo_Hamburgueseria") == "Si" and (getElementData(Robo_Hamburgueseria,"Robo_Hamburgueseria_Criminales_Totales") >= 2) and Team_Nombre == "Criminales" then 
            outputChatBox("Estas robando esta hamburgueseria, cuando robes sal corriendo lo mas rapido posible!",thePlayer,255,255,255,true)    
            setElementData(Robo_Hamburgueseria,"Robo_Hamburgueseria","No") 
            setElementInterior(Marker_Salida_Robo_Hamburgueseria,0) 
            setTimer(setElementInterior,120000,1,Marker_Salida_Robo_Hamburgueseria,4) 
            setTimer(setPlayerWantedLevel,120000,1,thePlayer,getPlayerWantedLevel(thePlayer)+3) 
            setTimer(outputChatBox,120000,1,"Has robado el dinero al empleado, sal corriendo!",thePlayer,200,0,0,true) 
            setTimer(setElementData,120000,1,thePlayer,"Robo_Hamburgueseria_Escape","Si") 
            setTimer(setElementData,900000,1,Robo_Hamburgueseria,"Robo_Hamburgueseria","Si") 
            setTimer(outputChatBox,900000,1,"Una hamburgueseria en santa maria beach se puede robar!",thePlayer,255,0,0,true) 
            
            local Policias = getElementsByType ("player") 
            for theKey,thePlayer in ipairs(Policias) do 
        
                local Team_del_Policia = getPlayerTeam(thePlayer) 
                local Nombre_Del_Team_Del_Policia = getTeamName (Team_del_Policia) 
                if (Nombre_Del_Team_Del_Policia == "Policias") then 
                    outputChatBox("[Radio] #FFFFFFSe ha reportado un robo en una hamburgueseria cerca de Santa Maria Beach",thePlayer,0,99,255,true) 
                end 
            end 
    else 
    outputChatBox("No",thePlayer) 
    end 
end 
end 
addCommandHandler("robarhamburgueseria",comprobar) 
  
function Robo_Escape(leaveElement) 
    
    local Jugador_Escapado = getElementData(leaveElement,"Robo_Hamburgueseria_Escape") 
    if source == Circulo_De_Escape then 
    if Jugador_Escapado == "Si" then 
        givePlayerMoney(leaveElement,10000) 
        setElementData(leaveElement,"Robo_Hamburgueseria_Escape","No") 
        outputChatBox("Has ganado #007000$10000 #ffffffpor el robo de la hamburgueseria.",leaveElement,255,255,255,true) 
    end 
end 
end 
addEventHandler ("onColShapeLeave",root,Robo_Escape) 
  
  
function Cuando_Un_Ladron_Salga() 
if getElementData(source,"Robo_Hamburgueseria") == "Si" then 
    setElementData(Robo_Hamburgueseria,"Robo_Hamburgueseria_Criminales_Totales",getElementData(Robo_Hamburgueseria,"Robo_Hamburgueseria_Criminales_Totales")-1) 
end 
end 
addEventHandler("onPlayerQuit",root,Cuando_Un_Ladron_Salga) 

Posted
Your help is very bad and debugscript 3 gives me no warnings, help please.

Do you really have to be rude to the people trying to help you? If you want help, you need to be nice.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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