Jump to content

outputting


roaddog

Recommended Posts

Hello guys, I had no idea, why if I the function executed, I got many messages show up in a row, Then what would i do to make it 1 message only. I need an information about it, because I got 2 scripts which have same issue.

I hope you guys understand what Im trying to do.

function callPetrolBlips (thePlayer) 
     if getElementType(thePlayer) == "player" and (thePlayer) then 
        gasStationsBlip[name] = createBlip(x,y,z,48,0,0,0,0,0,0,450); 
        setTimer (destroyPetrolBlips, 60000, 1 ) 
        outputChatBox("Streaming for gasstations, press F11!", thePlayer, 255, 100, 0, true) 
    end 
end 
addCommandHandler("station", callPetrolBlips)  
  
function destroyPetrolBlips (thePlayer ) 
    blips = getElementsByType("blip") 
    for i, v in ipairs (blips) do 
       blipIcon = getBlipIcon ( v ) 
       if (blipIcon == 48) then 
          destroyElement(v) 
          outputChatBox("gasstations's blips have been removed, type /station !", thePlayer , 255, 100, 0, true, 5) 
       end 
    end 
end 
addCommandHandler("ok", destroyPetrolBlips)      
  

Thank you.

Link to comment
  
function callPetrolBlips (thePlayer) 
     if getElementType(thePlayer) == "player" and (thePlayer) then 
        gasStationsBlip[name] = createBlip(x,y,z,48,0,0,0,0,0,0,450); 
        setTimer (destroyPetrolBlips, 60000, 1 ) 
        outputChatBox("Streaming for gasstations, press F11!", thePlayer, 255, 100, 0, true) 
    end 
end 
addCommandHandler("station", callPetrolBlips) 
  
function destroyPetrolBlips (thePlayer ) 
    blips = getElementsByType("blip") 
    for i, v in ipairs (blips) do 
       blipIcon = getBlipIcon ( v ) 
       if (blipIcon == 48) then 
          destroyElement(v) 
       end 
       end 
          outputChatBox("gasstations's blips have been removed, type /station !", thePlayer , 255, 100, 0, true, 5) 
end 
addCommandHandler("ok", destroyPetrolBlips)     
  
  

Link to comment

Still the same.

this has been fixed.

outputChatBox("gasstations's blips have been removed, type /station !", thePlayer , 255, 100, 0, true) 
end 

but this one still giving many messages

  outputChatBox("Streaming for gasstations, press F11!", thePlayer, 255, 100, 0, true) 

could you explain what was the problem?

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