Jump to content

Correct code please !!


d43dr4

Recommended Posts

Hello,

Guys i have a code, i try to fix it but cant

here is the code :

theMarker = createMarker ( 262, 1978, 18, "cylinder", 100, 255, 255, 0, 170 ) 
      
addEventHandler ( "onMarkerHit", theMarker, 
    function ( thePlayer ) 
        if getElementType ( thePlayer ) == "player" then 
             if getPlayerName ( thePlayer ) == "#[iMr][E'rrOr]_N" then 
        outputChatBox ( "* Welcome Sir,", player, 20, 255, 0, true ) 
        elseif not getPlayerName ( thePlayer ) == "#[iMr][E'rrOr]_N" then 
                setElementHealth ( thePlayer, 0 ) 
            end 
        end 
    end 
) 

I create this code to make a marker no one exept me can enter to the place in it ...

the marker was created , but now isnt when i add my name and something else

so please if you can correct it help me

if u can replace name by serial do it .. and thx

Link to comment
Hello,

Guys i have a code, i try to fix it but cant

here is the code :

theMarker = createMarker ( 262, 1978, 18, "cylinder", 100, 255, 255, 0, 170 ) 
      
addEventHandler ( "onMarkerHit", theMarker, 
    function ( thePlayer ) 
        if getElementType ( thePlayer ) == "player" then 
             if getPlayerName ( thePlayer ) == "#[iMr][E'rrOr]_N" then 
        outputChatBox ( "* Welcome Sir,", player, 20, 255, 0, true ) 
        elseif not getPlayerName ( thePlayer ) == "#[iMr][E'rrOr]_N" then 
                setElementHealth ( thePlayer, 0 ) 
            end 
        end 
    end 
) 

I create this code to make a marker no one exept me can enter to the place in it ...

the marker was created , but now isnt when i add my name and something else

so please if you can correct it help me

if u can replace name by serial do it .. and thx

How can we replace with ur MTA serial if we dont know it? :redhotevil::?:

Link to comment
theMarker = createMarker ( 262, 1978, 18, "cylinder", 100, 255, 255, 0, 170 ) 
      
addEventHandler ( "onMarkerHit", theMarker, 
    function ( thePlayer ) 
        if getElementType ( thePlayer ) == "player" and getPlayerSerial( thePlayer )== "YouSerialHere" then 
              outputChatBox ( "* Welcome Sir,", thePlayer, 20, 255, 0, true ) 
        else 
           return 
        end 
end 
) 

Link to comment

Server-side

local theMarker = createMarker(262, 1978, 18, "cylinder", 100, 255, 255, 0, 170) 
  
addEventHandler("onMarkerHit", theMarker, 
    function(hitElement, matchingDimension) 
        if getElementType(hitElement) == "player" and matchingDimension then 
            if getPlayerSerial(hitElement) == "" then 
                outputChatBox("* Welcome, sir.", hitElement, 20, 255, 0, false) 
            else 
                killPed(hitElement) 
            end 
        end 
    end 
) 

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