Jump to content

createMarker question.


BennyBunny

Recommended Posts

I try atm server side and have done that:

       function omgstart ( source, commandName )  
   if ( theMarkeromg ) then -- check if the marker was created successfully  
         outputChatBox ("Maker is Already Online!", source, 252, 255, 10 )  
      else  
         theMarkeromg = createMarker ( -2257, 2330, 5, "cylinder", 1.5, 255, 255, 0, 170, source )  
         outputChatBox ("Create Maker", source, 252, 255, 10 )  
     timeromgcount = setTimer(destroyElement, 10000, 1, theMarkeromg)  
  end  
end  
addCommandHandler ( "startomg", omgstart ) 

My qestion is now when 2 or more player have use startomg kill the timeromgcount all Marker from all players or only from the player where is the counter 0?

Later i wanna add when the player is in the marker he get money... and work more with the setTimer and killTimer, onMarkerHit, onMarkerLeave.

Thats why i ask :) Its bad when all Marker gone from all players when one setTimer is 0 from one player.

Link to comment

Sorry, but I don't understand...

If you are going to make it server-side, then I suggest you to make a table.

local timersTable = {} 
local playerMarkers = {} 
  
function omgstart ( source, commandName )  
   if ( playerMarkers[source] ) then -- check if the marker was created successfully  
         outputChatBox ("Maker is Already Online!", source, 252, 255, 10 )  
      else  
         playerMarkers[source] = createMarker ( -2257, 2330, 5, "cylinder", 1.5, 255, 255, 0, 170, source )  
         outputChatBox ("Create Maker", source, 252, 255, 10 )  
         timersTable[source] = setTimer(destroyElement, 10000, 1, playerMarkers[source]) 
      end  
end  
addCommandHandler ( "startomg", omgstart ) 

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