Jump to content
Mr. Green Gaming

Map Scripts


Recommended Posts

Posted

Speedboosting at will.

You are able to speedboost at will by pressing the "X" button. After you've pressed it, there will be a cooldown period of 8 seconds during which you will not be able to speedboost again.

It comes with a nice text that lets you know whether it's cooling down or it's usable.

Installation for your map:

Go to: http://www.xoti.net/uploads/boost_a749.lua

Select and copy everything, paste it in a boost.lua script. Put the boost.lua script in the map archive. Open meta.xml and right before the </meta> tag, add this line:

<script src="boost.lua" type="client" />

have fun

Awesome-O. Did you make that?

  • Replies 90
  • Created
  • Last Reply

Top Posters In This Topic

  • 2 weeks later...
Posted

Hey guys

I need serious help, i don't know the bases of scripting, and i want a script, that doesn't exist (i guess)

It's possible to do damage to a plane if its higher than "x"? I was thinking like in a mission of GTA SA, that if you're higher than a certain hight you will lose, something like that.

Can someone help me, pleasee

Posted

It's possible to do damage to a plane if its higher than "x"? I was thinking like in a mission of GTA SA, that if you're higher than a certain hight you will lose, something like that.

Most certainly is possible. Unfortunately I don't know how to code either.

But it would probably just be checking the plane's Z coordinate and then if it is, executing a kill command.

Posted

Clientscript:


height = 50 -- CHANGE THIS NUMBER TO WHATEVER HEIGHT U WANT
respawnTime = 10 -- CHANGE THIS TO THE RESPAWN TIME OF YOUR MAP (IN SECONDS)

dead = false
function checkClient()
if dead == false then
theVehicle = getPedOccupiedVehicle(getLocalPlayer())
if theVehicle then
if getVehicleType(theVehicle) == "Plane" then
x,y,z = getElementPosition(theVehicle)
if z > height then
dead = true
setTimer(function() dead = false end , respawnTime*1000, 1)
triggerServerEvent("onPlayerHighZ", getLocalPlayer())
killTimer(mytimer)
end
end
end
end
end

setTimer(checkClient, 200, 0)

Save everything as client.lua , go to meta.xml and add this line

<script src="client.lua" type="client" />

Serverside:


function killHim()
killPed(source)
outputChatBox("Not allowed to go that high.", source, 255, 255, 255)
end

addEvent("onPlayerHighZ", true)
addEventHandler("onPlayerHighZ", getRootElement(), killHim)

Save everything as server.lua then go to meta.xml and add this line:

<script src="server.lua" />

Note: Read the codes and change the required stuff that I explained above. (Respawntime and height)

Note2: I didn't test the script, but it should work. Because I'm using a similar script for Go Fast Til you Die map.

  • 3 weeks later...
Posted

this is an idea i had for emanuel's next bike map; we all know ppl hate tapping in bike maps xD

setTimer(toggleControl,1000,0,"steer_forward", false)

1-line script that fixes that xD

run it client-side for your bike map :)

Posted

Just a short script: Water and Sky colour changer


-----------------
--Water Colours--
-----------------

wr = 112 --Red
wg = 219 --Green
wb = 147 --Blue
wa = 200 --Alpha (visibility)

---------------
--Sky Colours--
---------------

str = 0 --skytopRed
stg = 0 --skytopGreen
stb = 0 --skytopBlue
sbr = 0 --skybottomRed
sbg = 0 --skybottomGreen
sbb = 0 --skybottomBlue

function thaResourceStarting( )
setWaterColor ( wr, wg, wb, wa ) --water
setSkyGradient( str, stg, stb, sbr, sbg, sbb ) --sky
end
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), thaResourceStarting)


<script src="watersky.lua" type="client" />

You can find colour codes here: link

Posted

this is an idea i had for emanuel's next bike map; we all know ppl hate tapping in bike maps xD

setTimer(toggleControl,1000,0,"steer_forward", false)

1-line script that fixes that xD

run it client-side for your bike map :)

That's nice.

Posted (edited)

From "Revolution is coming 2.0"

local rootElement = getRootElement()
local screenWidth, screenHeight = guiGetScreenSize()
local nexp = 100000 -- Number of explosions
local nres = 100000 -- Number of vehicles respawns

----- Messages -----

function message ()
local missiontextone = "Reach the base to change your vehicle,"
local missiontexttwo = "then destroy the President's aircraft."
dxDrawRectangle ( screenWidth/3.2, screenHeight - 90, screenWidth/2.7, 80, tocolor ( 0, 0, 0, 150 ) ) -- Create black background Rectangle
dxDrawText ( missiontextone, 0, 0, screenWidth, screenHeight - 50, tocolor ( 255, 255, 255, 255 ), 1, "pricedown", "center", "bottom", false, false, false )
dxDrawText ( missiontexttwo, 0, 0, screenWidth, screenHeight - 25, tocolor ( 255, 255, 255, 255 ), 1, "pricedown", "center", "bottom", false, false, false ) -- Create text
setTimer (remove, 10000, 1) -- Text showing for 10 sec
end

function remove ()
removeEventHandler("onClientRender", rootElement, message)
end

addEventHandler("onClientRender", rootElement, message)

----- Explosions -----

function explosions ()
local rnd = 20 -- Explosion range
local pX, pY, pZ = getElementPosition ( getLocalPlayer () )
createExplosion ( math.random(pX - rnd, pX + rnd), math.random(pY - rnd, pY + rnd), pZ, 3, true, -1.0, true)
end

setTimer (explosions, 20000, nexp) -- Explosions interval 10 seconds

----- Vehicles -----

function createvehicles ()
local Tank = createVehicle ( 432, 2726.1, 2115.2, 7.3, 0, 0, 180 )
setElementVelocity(Tank, 0, -1, 0)
end

setTimer (createvehicles, 10000, nres) -- Vehicles respawns interval 10 seconds

Edited by ThisBadGuy
  • 1 month later...
  • 4 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...