Jump to content

Safe Marker


Jammie

Recommended Posts

Posted

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!

Posted

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 :P I hope you can help me!

Posted

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?

Posted

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 :)

Posted (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 by Guest
Posted

Yea of course... I was go to home and I was thinking about toggle.. it "can't :P 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 )

Posted
Yea of course... I was go to home and I was thinking about toggle.. it "can't :P 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.

Posted

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.

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