Jump to content

Script Per una mappa


Recommended Posts

Riciao ecco con un questito allora, ho visto questo scipt in una mappa e volevo farlo anchio ma da dove comincio?

in pratica è uno shooter e fino qui ci siamo(il client dello shooter lo ho) ma mi server che in pratica quando vai in un marker ti da tipo dei bonus tipo puoi sparare a raffica, saltare, protezione di piu,si dovrebbe fare con un timer,ma non mi è chiaro come farlo

Link to comment
  
local root = getRootElement() 
local this = getThisResource() 
local resourceRoot = getResourceRootElement(this) 
local localPlayer = getLocalPlayer() 
local Marker = {} 
funzioneAttiva = 0 
  
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
    Marker[1] = createMarker(0, 0, 0, "corona", 5, 255, 0, 0) -- da definire le 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 
Jump()      
setTimer( 
function() 
funzioneAttiva = 0 
end 
, 15000, 1)     
            end 
        end 
    end 
) 
function Jump ( key, keyState ) 
local vehicle = getPlayerOccupiedVehicle(getLocalPlayer())   
if ( keyState == "down" ) and  funzioneAttiva == 1 then 
local x, y, z = getElementVelocity(vehicle) 
setElementVelocity(vehicle, x, y, z + 0.2) 
        end 
    end 
bindKey ( "z", "down", Jump ) 
bindKey ( "mouse2", "down", Jump ) 
  

Questo è per il jump, quando il player va sul marker si attiva per 15 sec il jump.

Link to comment

Scusa non mi sono spiegato..

In pratica appena prendi quel marker scompare e si mette da un'altra parte

ah un'altra cosa poi vi bacio i piedi lol

qual'è lo script diciamo dell'invincibilità, che se lo prendi anche se cadi da un palazzo o ti sparano altre cose non ti fai niente?(la function diciamo)

Link to comment

Sisi ShockZ l'ho Già fatto Grazzie Mille (p.s. c'è un bug che ogni volta che premi il tasto salta salta e salta..asd e voli xD xò ci ho messo un'altro timer di 3 secondi che ti impedisce di fare quella cosa)

E per l'invincibilità? che se lo prendi anche se cadi da un palazzo o ti sparano altre cose non ti fai niente?

Link to comment
Sisi ShockZ l'ho Già fatto Grazzie Mille (p.s. c'è un bug che ogni volta che premi il tasto salta salta e salta..asd e voli xD xò ci ho messo un'altro timer di 3 secondi che ti impedisce di fare quella cosa)

Sarei curioso di sapere come hai fatto . . . illuminami :mrgreen:

Forse hai tolto i 15 secondi che hai richiesto e hai settato 3000?

Hai cambiato il valore 15000 a 3000? ma sei uno scripter professionale :mrgreen:

Link to comment

Ecco Come da te richiesto cmq per l'invincibilità? p.s Tanto nabbo non lo sono :3

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 
Jump() 
Sesalti() 
outputChatBox ("[#D2691EPOWER #7FFF00UP] #FFA500Ora Puoi Saltare Premendo #40E0D0Shift(Puoi Saltare Ogni 3 Secondi..)(Durerà 30 Secondi)", 255, 255, 255, true)      
local arrowMarker = createMarker ( 0, 0, 0, "arrow", .75, 255, 0, 0, 170 ) 
attachElementToElement (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 
) 
  
function Sesalti() 
   temposalto = 1 
end 
  
function Jump ( key, keyState ) 
local vehicle = getPlayerOccupiedVehicle(getLocalPlayer())   
if ( keyState == "down" ) and  funzioneAttiva == 1 and temposalto == 1 then 
temposalto = 0 
local x, y, z = getElementVelocity(vehicle) 
setElementVelocity(vehicle, x, y, z + 0.2) 
setTimer(Sesalti, 3000, 1) 
        end 
    end 
bindKey ( "lshift", "down", Jump ) 
  
  
  
  

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