d43dr4 Posted December 10, 2012 Posted December 10, 2012 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
manve1 Posted December 10, 2012 Posted December 10, 2012 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?
d43dr4 Posted December 10, 2012 Author Posted December 10, 2012 Type in serial place "SERIAL" and i will replace it
DNL291 Posted December 10, 2012 Posted December 10, 2012 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 )
d43dr4 Posted December 10, 2012 Author Posted December 10, 2012 you forget the : setElementHealth ( thePlayer, 0 )
manve1 Posted December 10, 2012 Posted December 10, 2012 you forget the : setElementHealth ( thePlayer, 0 ) change return to: setElementHealth ( thePlayer, 0 ) return
DNL291 Posted December 10, 2012 Posted December 10, 2012 Why setElementHealth (thePlayer, 0) ? If you want kill the player use the killPed() function.
manve1 Posted December 10, 2012 Posted December 10, 2012 it still does the same function of killing him.
Tete omar Posted December 10, 2012 Posted December 10, 2012 He meant instead all of that he can simply use killPed()
manve1 Posted December 10, 2012 Posted December 10, 2012 He meant instead all of that he can simply use killPed() I know what he ment, but setElementHealth( thePlayer, 0 ) does the same thing as killPed()
Renkon Posted December 10, 2012 Posted December 10, 2012 It's fine. It's just that you probably added it client-side
Tete omar Posted December 10, 2012 Posted December 10, 2012 It's fine. It's just that you probably added it client-side I doubt that so
myonlake Posted December 11, 2012 Posted December 11, 2012 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 )
Vision Posted December 11, 2012 Posted December 11, 2012 can i make the marker invisible ? Yes, Just set the Alpha Color to 0
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