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