Jump to content
Mr. Green Gaming

Map Scripts


Recommended Posts

Hello to all the map-makers out there :)

I'll post some scripts I have that can make your map more fun/enjoyable.

1) Checkpoint boosting.

We all know checkpoints can change your vehicle and advance you through the race, but let's give it another usage for the crazy rollercoaster maps out there! We can have the checkpoints give you a lil' boost (adjustable speed) to each racer that goes through it. Here's the script I made to do this:


local multiplier = 1.4 -- Change this to suit your needs (recommended: 1.4). If using higher values don't put many checkpoints or the server will think it is cheating (warping)
function boost()
local theVehicle = getPedOccupiedVehicle(source)
if theVehicle then
local speedx, speedy, speedz = getElementVelocity(theVehicle)
setElementVelocity(theVehicle, speedx*multiplier, speedy*multiplier, speedz*multiplier)
end
end
addEvent("onPlayerReachCheckpoint", true)
addEventHandler("onPlayerReachCheckpoint", getRootElement(), boost)

To use this script in your map, copy-paste everything into a .lua file such as speedboost.lua and put it in the map archive. Then edit your meta.xml to add the following: <script src="speedboost.lua" /> Also, do test the map WITH the script before you send it to us and if the speed doesn't please you, change the multiplier value. Ranges like from 1.1 to 1.8 or so :)

2) Handling script.

This script was made by [sKC]Plodders. What it does is modify the handling of any vehicle in your map. Actually, it sort of gives it more speed, very useful for cirtcuit race tracks as it also drifts nicely.

To use it: go here http://www.xoti.net/stuff/uploads/handling_15ed.lua . Then copy paste everything into a new lua file preferably handling.lua which will be put in the map archive along with the .map and .xml . Then modify meta.xml so it loads up the script: <script src="handling.lua" type="client" />

3) Flying cars and the ability to drive on water (Vice City style) - same script for both of these features

Activate/Deactivate it by pressing 1 (for flying) and 2 (for driving on water) . You can trigger this at anytime during the race.

To use it: go here http://www.xoti.net/stuff/uploads/flying_7b1b.lua . Save everything as flying.lua and add it to your map archive file. Then open meta.xml and make the required change: <script src="flying.lua" type="client" />

UPDATE for flying cars script. Now shows ON or OFF

Maybe I'll add some more as I make/find interesting stuff.

Edited by BinSlayer
Link to comment
  • Replies 90
  • Created
  • Last Reply

Top Posters In This Topic

4) Drive-bys for your race maps. Description: this script gives each player who passes through the first checkpoint a gun with 50 rounds to shoot others. If the ammo runs out, well, just get the 3rd checkpoint. This will remove your gun and add a TEC-9 sub machine gun with 100 rounds. Then on the 6th you get a refill for it, then on the 9th CP.. and so on.. Basically, every third one :) These are just some values I thought were suitable but you can change these as you please in the script code. To use it: get the script from here: http://www.xoti.net/stuff/uploads/weapon_acfd.lua

Save everything as weapons.lua (in your map archive file), then make the change in meta.xml: <script src="weapons.lua" />

hope it helps :)

EDIT: Updated. So it also shows what weapon you have exactly and the ammo

Edited by BinSlayer
Link to comment

5) Made by Wojak

Race Hunter. What this does is basically add a hunter (a bot) that automatically detects the first player of the race and tries to kill him with rockets. (Don't underestimate it, it's very accurate :P )

Download here: http://www.xoti.net/stuff/uploads/race_huntbot_9c78.zip

To use it in your map, extract the 2 LUA files and put them INSIDE your Map Archive.

Edit meta.xml so it adds these 2 lines:

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

<script src="hunt_s.lua" type="server"/>

Link to comment
  • 3 weeks later...

6) Blur script

The GTA San Andreas motion blur is a feature which makes your screen blurry while you are driving at high speed. Having this blur could be annoying in most maps, so we have it disabled.

However, you've built a map and you think the blur would be a nice addition to it? Go here:

http://www.xoti.net/stuff/uploads/blur_4fb5.lua

Save all codes as blur.lua then put the file in your map archive. Open meta.xml and add this line:

<script src="blur.lua" /> right before the </meta> tag

It'll make your map have blur :)

Note: default blur level is 25. You can put anything from 0-255 , but it's not recommended

Edited by BinSlayer
Link to comment

You can create vehicle with collision:

Script:


function vehicles ()

theVehicle01 = createVehicle( 596, -2565.5588378906, 1101.1065673828, 55.387321472168, 0, 0, 340.5) ---create the policecar
ped01 = createPed ( 280, 0, 0, 0 ) ---create the policeman
warpPedIntoVehicle ( ped01, theVehicle01 ) ---send him into the car
setElementData ( theVehicle01, 'race.collideothers', 1 ) ---set the car collision on
setVehicleEngineState ( theVehicle01, true ) ---turn the engin on
setVehicleSirensOn ( theVehicle01 ,true ) ---turn the siren on
setVehicleOverrideLights ( theVehicle01, 2 ) ---turn the light on

theVehicle02 = createVehicle( 596, -2563.3388671875, 1108.3162841797, 55.387321472168, 0, 0, 340.5)
ped02 = createPed ( 280, 0, 0, 0 )
warpPedIntoVehicle ( ped02, theVehicle02 )
setElementData ( theVehicle02, 'race.collideothers', 1 )
setVehicleEngineState ( theVehicle02, true )
setVehicleSirensOn ( theVehicle02 ,true )
setVehicleOverrideLights ( theVehicle02, 2 )

theVehicle03 = createVehicle( 596, -2559.3916015625, 1119.3482666016, 55.387321472168, 0, 0, 340.5)
ped03 = createPed ( 280, 0, 0, 0 )
warpPedIntoVehicle ( ped03, theVehicle03 )
setElementData ( theVehicle03, 'race.collideothers', 1 )
setVehicleEngineState ( theVehicle03, true )
setVehicleSirensOn ( theVehicle03 ,true )
setVehicleOverrideLights ( theVehicle03, 2 )

theVehicle04 = createVehicle( 596, -2557.0859375, 1125.9329833984, 55.387321472168, 0, 0, 340.5)
ped04 = createPed ( 280, 0, 0, 0 )
warpPedIntoVehicle ( ped04, theVehicle04 )
setElementData ( theVehicle04, 'race.collideothers', 1 )
setVehicleEngineState ( theVehicle04, true )
setVehicleSirensOn ( theVehicle04 ,true )
setVehicleOverrideLights ( theVehicle04, 2 )

end
addEventHandler("onResourceStart", resourceRoot, vehicles)

meta.xml


<script src="vehicles.lua" type="server" />

Ped skin id: http://wiki.multitheftauto.com/wiki/Character_Skins

Vehicle id: http://wiki.multitheftauto.com/wiki/Vehicle_IDs

Note: If you are too far from the policecars warpPedIntoVehicle wont work. If not you can hear siren sound. Use timer for the warpPedIntoVehicle like this:


setTimer(warpPedIntoVehicle, 1000, 1, ped, Vehicle ) ---1000 is milisec (1 sec)

Edited by CsenaHUN
Link to comment

7) Driving on walls(similar to no-gravity)

To use it in your map:

Go here: http://www.xoti.net/stuff/uploads/magnetwheels_client_f559.lua

Save all codes as magnet.lua

Put magnet.lua in your map-archive.

Edit meta.xml and add this before the </meta> tag:

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

To test it: Play the map "Race Turbolar" as it uses this script.

Note. Original script taken from here: http://community.mtasa.com/index.php?p=resources&s=details&id=329

Edited by BinSlayer
Link to comment

On yoshi's request, I made the script you know from his turtle + dolphin maps more flexible

Change the replacements on the first lines, currently it replaces a few fast cars with some animals, lemme know if it's bugged.

(serverside)


local replacements = {
[451] = 1607, -- Turismo -> Turtle
[541] = 1608, -- Bullet -> Shark
[411] = 1609 -- Infernus -> Dolphin
-- [vehicle_id] = [object_id]
}

local obj = {}
addEventHandler ( "onPlayerVehicleEnter" , getRootElement(), function(veh)
if obj[source] then return end
if tonumber(replacements[getElementModel(veh)]) then
setElementData( source, "overrideAlpha.alpha", 0, false )
local vx, vy, vz = getElementPosition ( veh )
local rx, ry, rz = getVehicleRotation ( veh )
obj[source] = createObject (tonumber(replacements[getElementModel(veh)]), vx, vy, vz, rx, ry, rz)
attachElements ( obj[source], veh, 0, 0, 0, 0, 0, 0 )
end
end)
addEventHandler ( "onResourceStop", getResourceRootElement(), function()
for k,v in ipairs(getElementsByType('player')) do
setElementData( v, "overrideAlpha.alpha", nil, false )
end
end)

Edited by .:SDK:.
Link to comment

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