Jump to content

help skydivers


OrbTanT

Recommended Posts

How can I set for as soon as the player typing /skip, create a marker and a blip in the position of the marker, which will be the place where the player will have to go down with the parachute

local Marker = createMarker ( -2235.21, -1736.60, 479.80, "cylinder", 2.5, 0, 0, 255, 170 ) 
  
function paraquedismo ( thePlayer, matchingDimension ) 
    if isElementWithinMarker( thePlayer, Marker) then 
    outputChatBox("Para pular de paraquedas digite /pular!", thePlayer, 255, 0, 0) 
    end 
end 
addEventHandler ("onMarkerHit", Marker, paraquedismo) 
  
  
function pular ( playerSource ) 
     
    setElementPosition( playerSource, -2235.21, -1736.60, 1000.80 ) 
end 
addCommandHandler ( "pular", pular ) 

Link to comment

Is occurring error marker, somebody could help, should give money when the player enter within the Marker1.

error:

WARNING: paraquedismo\server.lua:34: Bad argument @ 'addEventHandler' [Expected element at argument 2, got nil] 

server:

local Marker = createMarker ( -2235.21, -1736.60, 479.80, "cylinder", 2.5, 0, 0, 255, 170 ) 
  
function paraquedismo ( thePlayer, matchingDimension ) 
    if isElementWithinMarker( thePlayer, Marker) then 
    outputChatBox("Para pular de paraquedas digite /pular!", thePlayer, 255, 0, 0) 
    end 
end 
addEventHandler ("onMarkerHit", Marker, paraquedismo) 
  
  
function pular ( playerSource, matchingDimension ) 
    if isElementWithinMarker( playerSource, Marker) then 
    setElementPosition( playerSource, -2235.21, -1736.60, 1300.80 ) 
    giveWeapon ( playerSource, 46 ) 
    setPedWeaponSlot(playerSource, getSlotFromWeapon(46)) 
    outputChatBox("Caia no Alvo para ganhar 5000$!", thePlayer, 255, 0, 0) 
    local Marker1 = createMarker ( -2407.97, -596.58, 131.80, "cylinder", 7.0, 0, 0, 255, 170 ) 
    local blip1 = createBlip( -2407.97, -596.58, 132.64, 0, 0, 0, 255, 255 ) 
    setBlipSize ( blip1, 5 ) 
    else 
    outputChatBox("Você não está na área de Paraquedismo!", thePlayer, 255, 0, 0) 
    end 
end 
addCommandHandler ( "pular", pular ) 
  
function cairmarker ( thePlayer, matchingDimension ) 
    if isElementWithinMarker( thePlayer, Marker1) then 
    setPlayerMoney(thePlayer, 5000) 
    outputChatBox("Você ganhou 5000$ por cair no alvo!", thePlayer, 255, 0, 0) 
    else 
    outputChatBox("Você não conseguiu cair no Alvo!", thePlayer, 255, 0, 0) 
    end 
end 
addEventHandler ("onMarkerHit", Marker1, cairmarker) 

Link to comment
  
local Marker = createMarker ( -2235.21, -1736.60, 479.80, "cylinder", 2.5, 0, 0, 255, 170 ) 
  
function paraquedismo ( thePlayer, matchingDimension ) 
    if isElementWithinMarker( thePlayer, Marker) then 
    outputChatBox("Para pular de paraquedas digite /pular!", thePlayer, 255, 0, 0) 
    end 
end 
addEventHandler ("onMarkerHit", Marker, paraquedismo) 
  
  
function pular ( playerSource, matchingDimension ) 
    if isElementWithinMarker( playerSource, Marker) then 
    setElementPosition( playerSource, -2235.21, -1736.60, 1300.80 ) 
    giveWeapon ( playerSource, 46 ) 
    setPedWeaponSlot(playerSource, getSlotFromWeapon(46)) 
    outputChatBox("Caia no Alvo para ganhar 5000$!", thePlayer, 255, 0, 0) 
    local Marker1 = createMarker ( -2407.97, -596.58, 131.80, "cylinder", 7.0, 0, 0, 255, 170 ) 
    local blip1 = createBlip( -2407.97, -596.58, 132.64, 0, 0, 0, 255, 255 ) 
    setBlipSize ( blip1, 5 ) 
    else 
    outputChatBox("Você não está na área de Paraquedismo!", thePlayer, 255, 0, 0) 
    end 
end 
addCommandHandler ( "pular", pular ) 
  
function cairmarker ( thePlayer, matchingDimension ) 
    if isElementWithinMarker( thePlayer, Marker) then 
    setPlayerMoney(thePlayer, 5000) 
    outputChatBox("Você ganhou 5000$ por cair no alvo!", thePlayer, 255, 0, 0) 
    else 
    outputChatBox("Você não conseguiu cair no Alvo!", thePlayer, 255, 0, 0) 
    end 
end 
addEventHandler ("onMarkerHit", Marker, cairmarker) 
  

Link to comment

You can do all this with 1 event handler but I don't got much time to anyway here:

  
local Marker,Marker1  = createMarker ( -2235.21, -1736.60, 479.80, "cylinder", 2.5, 0, 0, 255, 170 ), nil 
  
function paraquedismo ( thePlayer, matchingDimension ) 
    if isElementWithinMarker( thePlayer, Marker) then 
    outputChatBox("Para pular de paraquedas digite /pular!", thePlayer, 255, 0, 0) 
    end 
end 
addEventHandler ("onMarkerHit", Marker, paraquedismo) 
  
  
function pular ( playerSource, matchingDimension ) 
    if isElementWithinMarker( playerSource, Marker) then 
    setElementPosition( playerSource, -2235.21, -1736.60, 1300.80 ) 
    giveWeapon ( playerSource, 46 ) 
    setPedWeaponSlot(playerSource, getSlotFromWeapon(46)) 
    outputChatBox("Caia no Alvo para ganhar 5000$!", thePlayer, 255, 0, 0) 
     Marker1 = createMarker ( -2407.97, -596.58, 131.80, "cylinder", 7.0, 0, 0, 255, 170 ) 
    local blip1 = createBlip( -2407.97, -596.58, 132.64, 0, 0, 0, 255, 255 ) 
    setBlipSize ( blip1, 5 ) 
    else 
    outputChatBox("Você não está na área de Paraquedismo!", thePlayer, 255, 0, 0) 
    end 
end 
addCommandHandler ( "pular", pular ) 
  
function cairmarker ( thePlayer, matchingDimension ) 
    if isElementWithinMarker( thePlayer, source) then 
       if Marker1 == nil and source ~= Marker1 then return end  
         setPlayerMoney(thePlayer, 5000) 
             outputChatBox("Você ganhou 5000$ por cair no alvo!", thePlayer, 255, 0, 0) 
       else 
             outputChatBox("Você não conseguiu cair no Alvo!", thePlayer, 255, 0, 0) 
        end 
    end 
addEventHandler ("onMarkerHit",resourceRoot, cairmarker) 
  

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