Jump to content

[Ajuda] TIMER


Recommended Posts

tipo criei o script coloquei os timer bllz agr ta funcionando tudo bonitinho, mais queria colocar um timer para o carro reparar exemplo que ele demorasse 10 segundos para reparar totalmente, quem poder me ajudar ^^

theMarker = createMarker ( 1611.8278808594,-2153.7219238281,13.5546875 -0.9, "cylinder", 1.5, 255, 255, 0, 170 ) 
--pickup = createPickup ( 913.171875,-1787.7205810547,13.385736465454,3,1247 ) 
  
function fix (playerSource) 
if isElementWithinMarker(playerSource, theMarker) then 
local team = getPlayerTeam(playerSource) 
    if team and getTeamName(team) == "Mecanico" then 
    local theVehicle = getPedOccupiedVehicle (playerSource) 
    setElementFrozen(theVehicle, true) 
    setTimer(setElementFrozen, 10000, 1, theVehicle, false) 
    if theVehicle and getVehicleController ( theVehicle ) == playerSource then 
    fixVehicle (theVehicle) 
         outputChatBox ("// Você consertou o veículo, converse com o dono e pegue sua recompen$a!" , thePlayer) 
         end 
end 
end 
end 
addCommandHandler("fix",fix) 

Link to comment

Testado, só precisa usa as funções para tirar o dinheiro do dono do veiculo e mandar para o "Mecânico"

para isso use

givePlayerMoney 

e

takePlayerMoney 

Roteiro testado:

local myBlip = createBlip( 1611.8278808594,-2153.7219238281,0, 51, 0, 0, 0, 255, myPlayer ) 
  
theMarker = createMarker ( 1611.8278808594,-2153.7219238281,13.5546875 -0.9, "cylinder", 1.5, 255, 255, 0, 170 ) 
function fix (playerSource, thePlayer) 
if isElementWithinMarker(playerSource, theMarker) then 
    local team = getPlayerTeam(playerSource) 
    if team and getTeamName(team) == "Mecanico" then 
    local theVehicle = getPedOccupiedVehicle (playerSource) 
    setElementFrozen(theVehicle, true) 
    setTimer(setElementFrozen, 10000, 1, theVehicle, false) 
        if theVehicle and getVehicleController ( theVehicle ) == playerSource then 
    setTimer( fixVehicle, 10000, 1, theVehicle ) -- função do FuSioN_ 
    outputChatBox ("Você consertou o veículo, converse com o dono e pegue sua recompença!", thePlayer, 255, 0, 0, true ) 
end 
    end 
        end 
end 
addCommandHandler("fix",fix) 

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