Jump to content

firefighter


Estevam2d

Recommended Posts

Has two problems.

The first is fire created goes out with little time.

The second problem is that when I use the fire extinguisher against the fire did not get anything onClientPlayerTarget should I use?

I intend to put this scripture to download. without being compiled. there is nothing similar in mtasa community. will be a simple scripture.

Link to comment

Galera, worked with object but not with fire.

But all I backrest that is the object makes me earn money.

sorry help :roll:

addEventHandler ("onClientGUIClick", getRootElement(), 
function(hitElement, theSize) 
if (source == GUIEditor_Button[1]) then 
    if guiRadioButtonGetSelected(radioButton1) == true then 
     fireElem = createObject(2023, 2488.354, -1671.3, 12.336) 
        end 
    end 
end 
) 
  
  
function targetingActivated ( fire ) 
    if (fire) then 
    if (getPedWeapon (localPlayer) ~= 42) then return end  
        outputChatBox(tostring(getElementType(fire))) 
        if (fire) then 
        end 
        givePlayerMoney ( 70 ) 
        destroyElement (fireElem) 
    end 
end 
addEventHandler ( "onClientPlayerTarget", getRootElement(), targetingActivated ) 

Link to comment

50% solved, but now the problem that if I hold the right mouse button and I'm making money without stopping. :|

I am immensely happy for the tip of the create Effect :P

addEventHandler ("onClientGUIClick", getRootElement(), 
function(hitElement, theSize) 
if (source == GUIEditor_Button[1]) then 
    if guiRadioButtonGetSelected(radioButton1) == true then 
fires  =  createFire(2493.792, -1667.981, 13.344) 
     fire = createEffect("fire", 2493.792, -1667.981, 13.344) 
        end 
    end 
end 
) 
  
function wastedMessagee (hitElement) 
if (fire) then 
    if weapon == 42 then return end 
            outputChatBox ( "test", hitElement ) 
            destroyElement (fire) 
            givePlayerMoney ( 70 ) 
    end 
end 
addEventHandler ( "onClientPlayerWeaponFire", getLocalPlayer(), wastedMessagee ) 

Link to comment

oh thanks :D

Now the problem is that I do not know how that one is marked ensencial to earn money.

I hope you understand me

You can only make money if you stay for a while in the cylinder.

Observation: -- Error: How to identify if the player really on this cylinder to get the money?

local markerer = createMarker ( 2024.114, -1702.907, 17.369, "cylinder", 3.0, 255, 255, 255,50.1 ) 
  
function Lixeirojob(hitElement) 
        if getElementType(hitElement) == "player" and (hitElement == localPlayer) then 
            destroyElement (markerer) 
            triggerServerEvent ( "receber", localPlayer ) 
            exports.killmessages:outputMessage("*Bombeiro acaba de salvar uma casa.", root, 10, 118, 240, true) 
        end 
    end 
    addEventHandler("onClientMarkerLeave", markerer, Lixeirojob) 
  
  
  
function detonatorAction (key, attacker) 
if (fire) then 
if (getPedWeapon (localPlayer) ~= 42) then return end  
if ( getElementType ( target ) == "fire" ) then 
                blowVehicle ( target )       
end 
if isElement ( hitElement ) and getElementType(hitElement) == "Marker" then -- Error: How to identify if the player really on this cylinder to get the money?              
setTimer ( function() 
outputChatBox ("**Agora afaste-se do lugar do acidente para receber sua grana.", 255, 255, 0) 
destroyElement (fire) 
destroyElement (blipsbombeiro) 
end, 2000, 1 ) 
if (fire) then 
    for control in pairs (getBoundControls(key)) do 
        setControlState (control, true) 
           end 
        end 
    end 
end 
bindKey ("lctrl", "down", detonatorAction) 

I want to use something like this "markerer"

if isElement ( hitElement ) and getElementType(hitElement) == "Marker" then 
  

Link to comment
  • 3 months later...
How do you want to create this as long as it is impossible to retrieve if you hit the fire with water or not?

You can do it with colshapes, effects and onVehicleWeaponFire or OnClientWeaponFire. I'm sure any experienced lua programmer can pull this off easily. I've tried it before but I couldn't do it, but that's only because I have a very limited knowledge of lua.

H7gus, try asking Solidsnake, one of the mods of this forum. I'm sure he can do it for you for a small price.

Link to comment
  • 2 weeks later...

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