BennyBunny Posted August 9, 2011 Share Posted August 9, 2011 I wanna crate a marker that only the player can see where create it. Create a Marker is easy and that with a command too. But i wanna go sure that only the player can see the marker. Must i add in the meta file the script as client or something like that? Link to comment
Castillo Posted August 9, 2011 Share Posted August 9, 2011 If you want just the person to see it, I would recommend creating the marker client sided. Link to comment
BennyBunny Posted August 9, 2011 Author Share Posted August 9, 2011 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
Castillo Posted August 9, 2011 Share Posted August 9, 2011 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now