Jump to content

Greenzone **Help


Jammie

Recommended Posts

Posted

My problem is if I make a greenzone then are the positions wrong, very strange. And my other problem is if you get a car or bike then you can driveby in the greenzone. Can someone help me to make a good safezone. Maybe is this script too old or something because I had this script 2 years and it works very good.

Only not anymore..!

This is my script:

-- Greenzone Pirate Ship

x, y, size = 1844.5594482422, 1375.3376464844, 120

local greenzone = createColRectangle ( x-size/2, y-size/2, 120, 120 )

local greenzonemaparea = createRadarArea (1844.5594482422, 1375.3376464844, 284, 312.22, 0, 255, 0, 120)

function greenzone_Enter ( thePlayer, matchingDimension )

if getElementType( thePlayer ) ~= "player" then return end

outputChatBox ( "* You Entered The Greenzone!", thePlayer, 177, 252, 3 )

toggleControl ( thePlayer, "fire", false )

toggleControl ( thePlayer, "next_weapon", false )

toggleControl ( thePlayer, "previous_weapon", false )

setPlayerWeaponSlot ( thePlayer, 0 )

toggleControl ( thePlayer, "aim_weapon", false )

toggleControl ( thePlayer, "vehicle_fire", false )

toggleControl ( thePlayer, "vehicle_secondary_fire", false )

end

addEventHandler ( "onColShapeHit", greenzone, greenzone_Enter )

function greenzone_Exit ( thePlayer, matchingDimension )

if getElementType( thePlayer ) ~= "player" then return end

outputChatBox ( "* You Left The Greenzone!", thePlayer, 177, 252, 3 )

toggleControl ( thePlayer, "fire", true )

toggleControl ( thePlayer, "next_weapon", true )

toggleControl ( thePlayer, "previous_weapon", true )

toggleControl ( thePlayer, "aim_weapon", true )

toggleControl ( thePlayer, "vehicle_fire", true )

toggleControl ( thePlayer, "vehicle_secondary_fire", true )

end

addEventHandler ( "onColShapeLeave", greenzone, greenzone_Exit )

Posted (edited)

edit: sorry i dint readed well, by the way i fixed your code i tested and its working :D here is it

-- Greenzone Pirate Ship
x, y, size = 1844.5594482422, 1375.3376464844, 120
local greenzone = createColRectangle ( 1844.5594482422, 1375.3376464844, 284, 312.22 )
local greenzonemaparea = createRadarArea (1844.5594482422, 1375.3376464844, 284, 312.22, 0, 255, 0, 120)
 
function greenzoneEnter ( thePlayer, matchingDimension )
if getElementType( thePlayer ) ~= "player" then return end
outputChatBox ( "* You Entered The Greenzone!", thePlayer, 177, 252, 3 )
toggleControl ( thePlayer, "fire", false )
toggleControl ( thePlayer, "next_weapon", false )
toggleControl ( thePlayer, "previous_weapon", false )
setPedWeaponSlot ( thePlayer, 0 )
toggleControl ( thePlayer, "aim_weapon", false )
toggleControl ( thePlayer, "vehicle_fire", false )
toggleControl ( thePlayer, "vehicle_secondary_fire", false )
end
addEventHandler ( "onColShapeHit", greenzone, greenzoneEnter )
 
function greenzoneExit ( thePlayer, matchingDimension )
if getElementType( thePlayer ) ~= "player" then return end
outputChatBox ( "* You Left The Greenzone!", thePlayer, 177, 252, 3 )
toggleControl ( thePlayer, "fire", true )
toggleControl ( thePlayer, "next_weapon", true )
toggleControl ( thePlayer, "previous_weapon", true )
toggleControl ( thePlayer, "aim_weapon", true )
toggleControl ( thePlayer, "vehicle_fire", true )
toggleControl ( thePlayer, "vehicle_secondary_fire", true )
end
 
addEventHandler ( "onColShapeLeave", greenzone, greenzoneExit )

also use setPedWeaponSlot like i put there

Edited by Guest
Posted

i reported this topic to be moved to scripting help.

i also thinking about how to create a temporary "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

A near-perfect "godmode" can be created by hooking onClientPlayerDamage and cancelling it. That will block pretty much any damage. Of course, you can set element data or something when the player enters and leaves the area and then check it to see if you should cancel or not.

On a side note, the lack of original ideas and everybody's seeming willingness to create perfect duplicates of existing or earlier servers is a bit depressing. MTA could use some new ideas, server-wise.

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

my server isn't clone of existing servers. ive already spent a lot of time on it (scripting, mapping), and plan to spend more.. i just want a safe zone on spawn, as i see more and more spawn killers (kicking them automatically is not a good idea for me)

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 wasn't talking to you, but the actual topic.

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

It works great Wisin! Thank you so much! only one thing! real drive-by is not blocking:P

do you know how I can disallow real drive by? thanks!!

Posted

Jammie, you will proabably need to modify real_driveby resource ;)

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

realy no idea of what u must edit sorry :S, i was testing ways to get it working but no luck, by the way i will take a look again soon, i dont have much time making own things :D

Posted
i dont have much time making own things

in 90% cases this is called lazyness ;)

i have it too

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

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