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 Just Smile !
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? Looking for tutorials or information? check out: www.simpleask.co.uk
d43dr4 Posted December 10, 2012 Author Posted December 10, 2012 Type in serial place "SERIAL" and i will replace it Just Smile !
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 ) Please do not PM me with scripting related question nor support, use the forums instead.
d43dr4 Posted December 10, 2012 Author Posted December 10, 2012 you forget the : setElementHealth ( thePlayer, 0 ) Just Smile !
manve1 Posted December 10, 2012 Posted December 10, 2012 you forget the : setElementHealth ( thePlayer, 0 ) change return to: setElementHealth ( thePlayer, 0 ) return Looking for tutorials or information? check out: www.simpleask.co.uk
DNL291 Posted December 10, 2012 Posted December 10, 2012 Why setElementHealth (thePlayer, 0) ? If you want kill the player use the killPed() function. Please do not PM me with scripting related question nor support, use the forums instead.
manve1 Posted December 10, 2012 Posted December 10, 2012 it still does the same function of killing him. Looking for tutorials or information? check out: www.simpleask.co.uk
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() Looking for tutorials or information? check out: www.simpleask.co.uk
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
DNL291 Posted December 11, 2012 Posted December 11, 2012 The onMarkerHit event is server-side only. Please do not PM me with scripting related question nor support, use the forums instead.
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 ) If I helped you, please click the like button on the right Thanks!
d43dr4 Posted December 11, 2012 Author Posted December 11, 2012 can i make the marker invisible ? Just Smile !
Vision Posted December 11, 2012 Posted December 11, 2012 can i make the marker invisible ? Yes, Just set the Alpha Color to 0
myonlake Posted December 11, 2012 Posted December 11, 2012 You're welcome. If I helped you, please click the like button on the right Thanks!
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