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

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

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

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

so why posted 2nd topic about same problem?

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

At least this one is actually in the right subforum...

Do NOT PM ME for help unless invited. - New MTA Script Editor

Scripting help "etiquette": understandable language, relevant code (ALL code if unsure), [Lua] tags, error messages with line numbers. Super simple stuff.

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

you're right, you can, good luck

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

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

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

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

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

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

toggleControl is used for disabling CONTROLS (moving, shooting, etc), not for disabling/cancelling events

ps. post your code in [lua] [/lua] tags

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

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

wheres your MarkerHit function? you have removed it. now all players will be in "god mode"

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

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