Jump to content

Sintassi corretta?


Recommended Posts

local root = getRootElement() 
local this = getThisResource() 
local resourceRoot = getResourceRootElement(this) 
local localPlayer = getLocalPlayer() 
local Marker = {} 
funzioneAttiva = 0 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
    Marker[1] = createMarker( 4315.2998046875, -1626.3000488281, 1.7999999523163, "corona", 5, 255, 0, 0) -- coordinate X Y Z 
    end 
) 
addEventHandler("onClientMarkerHit", root, 
function(player, matchingDimension) 
if not matchingDimension then return end 
if player == localPlayer and isPedInVehicle(player) then 
local vehicle = getPedOccupiedVehicle(player) 
if source == Marker[1] and  funzioneAttiva == 0 then 
funzioneAttiva = 1 
outputChatBox ("[#D2691EPOWER #7FFF00UP] #FFA500Sei Protetto(Durerà 30 Secondi)", 255, 255, 255, true)      
local arrowMarker = createMarker ( 0, 0, 0, "arrow", .75, 255, 0, 0, 170 ) 
attachElements (arrowMarker,vehicle, 0, 0, 2 ) 
setTimer( 
function() 
funzioneAttiva = 0 
outputChatBox ("[#D2691EPOWER #7FFF00DOWN] #FFA500Finito Power Bonus..", 255, 255, 255, true)  
destroyElement (arrowMarker)  
end 
, 30000, 1)     
            end 
        end 
    end 
) 
  
 addEventHandler("onClientPlayerDamage", getLocalPlayer(), 
 function() 
 cancelEvent() 
 end 
 ) 
  
  
  
  

Link to comment
local Marker = {} 
funzioneAttiva = 0 
  
Marker[1] = createMarker( 4315.2998046875, -1626.3000488281, 1.7999999523163, "corona", 5, 255, 0, 0 ) 
  
addEventHandler ( "onClientMarkerHit", root, 
    function ( player, matchingDimension ) 
        --if not matchingDimension then return end 
        if getElementType ( player ) == "player" then 
            if isPedInVehicle ( player ) then 
                local vehicle = getPedOccupiedVehicle ( player ) 
                if source == Marker[1] and  funzioneAttiva == 0 then 
                    funzioneAttiva = 1 
                    outputChatBox ("[#D2691EPOWER #7FFF00UP] #FFA500Sei Protetto(Durerà 30 Secondi)", 255, 255, 255, true)     
                    arrowMarker = createMarker ( 0, 0, 0, "arrow", 0.75, 255, 0, 0, 170 ) 
                    attachElements ( arrowMarker, vehicle, 0, 0, 2 ) 
                    setTimer( 
                        function() 
                            funzioneAttiva = 0 
                            outputChatBox ("[#D2691EPOWER #7FFF00DOWN] #FFA500Finito Power Bonus..", 255, 255, 255, true) 
                            destroyElement ( arrowMarker ) 
                        end 
                    , 30000, 1)  
                end 
            end 
        end 
    end 
) 
  
addEventHandler ( "onClientPlayerDamage", localPlayer, 
    function() 
        cancelEvent ( ) 
    end 
) 
  

Link to comment

Anyway :

  
local root = getRootElement() 
local this = getThisResource() 
local resourceRoot = getResourceRootElement(this) 
local localPlayer = getLocalPlayer() 
local Marker = {} 
funzioneAttiva = 0  
addEventHandler("onClientResourceStart", resourceRoot, 
function() 
Marker[1] =  createMarker( 4315.2998046875, -1626.3000488281, 1.7999999523163, "corona", 5, 255, 0, 0) 
end 
) 
addEventHandler("onClientMarkerHit", root, 
function(player, matchingDimension) 
if not matchingDimension then return end 
if player == localPlayer and isPedInVehicle(player) then 
local vehicle = getPedOccupiedVehicle(player) 
if source == Marker[1] and  funzioneAttiva == 0 then 
local x, y, z = getElementPosition ( vehicle )  
local arrow = createMarker ( x, y, z, "arrow", 10, 255, 0, 0, 170 ) -- cambia la grandezza (prima era .75 che non aveva senso) 
attachElements ( arrow, vehicle, 0, 0, 0)    
setVehicleDamageProof(vehicle, true) 
funzioneAttiva = 1   
outputChatBox ("[#D2691EPOWER #7FFF00UP] #FFA500Sei Protetto(Durer࠳0 Secondi)", 255, 255, 255, true) 
setTimer( 
function() 
setVehicleDamageProof(vehicle, false) 
destroyElement (arrow) 
funzioneAttiva = 0 
outputChatBox ("[#D2691EPOWER #7FFF00DOWN] #FFA500Finito Power Bonus..", 255, 255, 255, true)  
end 
, 30000, 1)     
end 
end 
end 
) 
  
  

Gia testata,devi solo cambiare forse la grandezza del marker che vai ad attaccare.

 

Prima era .75 che non aveva senso,cmq ti ho messo 10 default.

Link to comment

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...