Jammie Posted February 4, 2010 Share Posted February 4, 2010 Hi all, how can you make a marker when you in the marker then you can't die. (godmode if you are in the marker) like a safemarker. I hope so you can help me with this because this is new for me to create a safe marker. I hope that people have an example or something! Link to comment
dzek (varez) Posted February 4, 2010 Share Posted February 4, 2010 why you left this topic? https://forum.multitheftauto.com/viewtop ... 08&t=26489 btw: its looking like you want us to script your whole server.. Link to comment
Jammie Posted February 4, 2010 Author Share Posted February 4, 2010 I dont left that because I need only a anti real drive by script.. I dont know what I must modify in that script... I need help for that.. The same for a Safe Marker. Whole server, lol haha.... no I have 50 scripts and I need help for 4 scripts I hope you can help me! Link to comment
dzek (varez) Posted February 4, 2010 Share Posted February 4, 2010 so why posted 2nd topic about same problem? Link to comment
robhol Posted February 4, 2010 Share Posted February 4, 2010 At least this one is actually in the right subforum... Link to comment
Jammie Posted February 5, 2010 Author Share Posted February 5, 2010 Ok, thanks for you tips, I can modify that greenzone script to a marker script but how can you enable the god mode in the marker? Link to comment
dzek (varez) Posted February 5, 2010 Share Posted February 5, 2010 you're right, you can, good luck Link to comment
Jammie Posted February 5, 2010 Author Share Posted February 5, 2010 Thanks Varez, can you enable godmode in that marker? Link to comment
Jammie Posted February 5, 2010 Author Share Posted February 5, 2010 Thanks Varez, can you enable godmode in that marker? Link to comment
Wojak Posted February 5, 2010 Share Posted February 5, 2010 you can try to getElementHealth https://wiki.multitheftauto.com/wiki/GetElementHealth when the player hit the marker, than setElementHealth https://wiki.multitheftauto.com/wiki/SetElementHealth on client render https://wiki.multitheftauto.com/wiki/OnClientRenderwhile while the player is within marker https://wiki.multitheftauto.com/wiki/IsE ... thinMarker (this must be client side) Link to comment
dzek (varez) Posted February 5, 2010 Share Posted February 5, 2010 Wojak, he got a solution in https://forum.multitheftauto.com/viewtopic.php?f=108&t=26489 this topic.. i think he still want a completed script Jammie, i said YOU can, i cannot do this for you and name me as "varez", not "Varez" (w/out capital), thanks Link to comment
Jammie Posted February 5, 2010 Author Share Posted February 5, 2010 varez hehe, ok but I dont want a complete script I want a god mode toggle.. Thanks Wojak, i take a look! Link to comment
dzek (varez) Posted February 5, 2010 Share Posted February 5, 2010 teres no such this as one-line toggle. you need to handle onClientMarkerHit, do something like setElementData on your player (or just set a global variable, as this will be just client-side i think) then just cancel any onClientPlayerDamage event on player in your marker. now, you need to script it, i described it enough, good luck Link to comment
Jammie Posted February 5, 2010 Author Share Posted February 5, 2010 (edited) I know about the toggle but maybe should this work? I am now at school and I can't create a bigger script... this I have fastly scripted.. ]local myMarker = createMarker( -2596.6259765625, 579.3583984375, 15.626741409302, 'cylinder', 2.0, 255, 0, 0, 150 ) function MarkerHit( hitElement, matchingDimension ) if getElementType( hitElement ) == "player" then outputChatBox( "* You Entered The Safe Zone", getRootElement(), 255, 255, 0 ) toggleControl ( thePlayer, "onClientPlayerDamage", false ) end end addEventHandler( "onMarkerHit", myMarker, MarkerHit ) function markerLeave( leaveElement, matchingDimension ) if getElementType( leaveElement ) == "player" then outputChatBox ( "* You Left The Safe Zone", getRootElement(), 255, 255, 0 ) toggleControl ( thePlayer, "onClientPlayerDamage", true ) end end addEventHandler( "onMarkerLeave", myMarker, markerLeave ) Edited February 5, 2010 by Guest Link to comment
dzek (varez) Posted February 5, 2010 Share Posted February 5, 2010 toggleControl is used for disabling CONTROLS (moving, shooting, etc), not for disabling/cancelling events ps. post your code in [lua] [/lua] tags Link to comment
Jammie Posted February 5, 2010 Author Share Posted February 5, 2010 Yea of course... I was go to home and I was thinking about toggle.. it "can't very stupid... -,- but I will add cancelEvent. I have add a CancelEvent. local myMarker = createMarker( -2596.6259765625, 579.3583984375, 15.626741409302, 'cylinder', 2.0, 255, 0, 0, 150 ) function safezone(attacker, weapon, bodypart) cancelEvent() end addEventHandler( "onMarkerHit", myMarker, MarkerHit ) addEventHandler("onClientPlayerDamage", getLocalPlayer(), safezone) function markerLeave( leaveElement, matchingDimension ) if getElementType( leaveElement ) == "player" then outputChatBox ( "* You Left The Safe Zone", getRootElement(), 255, 255, 0 ) end end addEventHandler( "onMarkerLeave", myMarker, markerLeave ) Link to comment
dzek (varez) Posted February 5, 2010 Share Posted February 5, 2010 wheres your MarkerHit function? you have removed it. now all players will be in "god mode" Link to comment
50p Posted February 5, 2010 Share Posted February 5, 2010 Yea of course... I was go to home and I was thinking about toggle.. it "can't very stupid... -,- but I will add cancelEvent. I have add a CancelEvent. local myMarker = createMarker( -2596.6259765625, 579.3583984375, 15.626741409302, 'cylinder', 2.0, 255, 0, 0, 150 ) function safezone(attacker, weapon, bodypart) cancelEvent() end addEventHandler( "onMarkerHit", myMarker, MarkerHit ) addEventHandler("onClientPlayerDamage", getLocalPlayer(), safezone) function markerLeave( leaveElement, matchingDimension ) if getElementType( leaveElement ) == "player" then outputChatBox ( "* You Left The Safe Zone", getRootElement(), 255, 255, 0 ) end end addEventHandler( "onMarkerLeave", myMarker, markerLeave ) You can't mix client and server side scripts in one file. Besides, your script would make everyone invincible if the resource started. Link to comment
Jammie Posted February 5, 2010 Author Share Posted February 5, 2010 I did something wrong yea... I am back in 20 minutes... (go to work). I will create a client one after my work over 20 minutes. 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