Jump to content

[HELP] Marker


1LoL1

Recommended Posts

Hello, i created script but when i use /markerr so marker is created but if i again use /markerr so marker is created again. How i can when marker is created and i want to again so outputChatBox("Marker is created")

function www (source) 
w = createMarker( -2805.87890625,1318.779296875,7.1015625, "cylinder", 1.5, 255, 255, 0, 170 ) 
if w then 
else 
cancelEvent() 
outputChatBox("Marker is created", source, 255, 255, 255, true) 
end 
end 
addCommandHandler("markerr", www) 

Link to comment
  
 local markersCreated = 0 
  
function www (source) 
local w = createMarker( -2805.87890625,1318.779296875,7.1015625, "cylinder", 1.5, 255, 255, 0, 170 ) 
  
if not w then  
return -- stop the function by returning nothing 
end 
  
      if markersCreated > 1 then 
      outputChatBox("Marker is created", source, 255, 255, 255, true) 
              else 
                markersCreated = markersCreated + 1 
       end  
end 
addCommandHandler("markerr", www) 

cancelEvent() is used to cancel events not command handlers.

Link to comment

local Makedd = false; 
  
addCommandHandler ( "markerr", function ( plr ) 
        if ( getElementType ( plr ) == "player" ) then 
            if ( Makedd ~= true ) then 
        w = createMarker ( -2805.87890625,1318.779296875,7.1015625, "cylinder", 1.5, 255, 255, 0, 170 ); 
            Makedd = true; 
        else 
            outputChatBox ( "Marker is created", plr, 255, 0, 0, true ); 
        end 
    end 
end ); 
Link to comment

local Makedd = false;
 
addCommandHandler ( "markerr", function ( plr )
        if ( getElementType ( plr ) == "player" ) then
            if ( Makedd ~= true ) then
        w = createMarker ( -2805.87890625,1318.779296875,7.1015625, "cylinder", 1.5, 255, 255, 0, 170 );
            Makedd = true;
        else
            outputChatBox ( "Marker is created", plr, 255, 0, 0, true );
        end
    end
end );

Thanks. Works.

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