MSHost.cz
https://forum.mshost.cz:443/

Scripts
https://forum.mshost.cz:443/viewtopic.php?f=16&t=31747
Page 1 of 1

Author:  UNDERTAK3R [ Wed 09. Mar 2016 17:12:53 ]
Post subject:  Scripts

Set Sky Color
Code:
function startclient()
 setSkyGradient(0, 100, 100, 200, 200, 200)
 end
 addEventHandler("onClientResourceStart", resourceRoot, startclient)


Set Water Color
Code:
function startclient()
 setWaterColor(0, 200, 100)
 end
 addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), startclient)


Create Fire
Code:
function startclient ()
 createFire( 3840.5, -2031.5, 3, 40)
 end
 addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), startclient )


Create Explosion
Code:
function explosion()
 createExplosion(3840.5, -2031.5, 3, 12)
 setTimer(explosion, 5000, 1)
 end
 addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), explosion)


False Colisions
Code:
function startClient()
 shade = createObject(1225, 3840.5, -2031.5, 2, 0, 0, 0)
 setElementCollisionsEnabled(shade, false)
 end
 addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), startClient)


Hydrant Effect
Code:
function hydrant()
 hydrant1 = fxAddWaterHydrant(3840.5, -2031.5, 3, 40)
 setTimer(hydrant, 1000, 1)
 end
 addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), hydrant)


Custom Objects
Code:
function onResourceStart()
 vgncarshade1 = engineLoadTXD("vgncarshade1.txd")
 engineImportTXD(vgncarshade1, 3458)
 end
 addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onResourceStart)


Create a Teleport
Code:
marker = createMarker(3840.5, -2031.5, 3, "corona", 3.5, 255, 0, 0, 255)

 function teleport(player)
 if getElementType(player)=="player" then
 local vehicle=getPedOccupiedVehicle(player)
 if source == marker then
 setElementPosition(vehicle, 3843.7, -2021, 2.2)
 setVehicleFrozen(vehicle, true)
 setTimer(setVehicleFrozen, 1000, 1, vehicle, false)
 end
 end
 end
 addEventHandler("onClientMarkerHit", getRootElement(), teleport)


ChatBox
Code:
function startclient()
 outputChatBox("==========This is the script==========", 255, 0, 0, true)
 end
 addEventHandler("onClientResourceStart", getRootElement(), startclient)


Create Ped
Code:
function pedLoad()
 ped1 = createPed(90, 3840.5, -2031.5, 3)
 setPedRotation(ped1, 60)
 setTimer(pedAnimations, 2500, 1)
 end
 addEventHandler("onResourceStart", getRootElement(), pedLoad)

 function pedAnimations()
 giveWeapon(ped1, 38, 2500, true)
 setPedAnimation(ped1, "STRIP", "strip_e")
 end


Push Player
Code:
marker1 = createMarker(3840.5, -2031.5, 3, "corona", 3.5, 255, 0, 0, 255)

 function MarkerHit(player)
 if getElementType=="player" then
 local vehicle = getPedOccupiedVehicle(player)
 if source == marker1 then
 setElementVelocity(vehicle, 0, 0, 1.5)
 end
 end
 end
 addEventHandler("onClientMarkerHit", getRootElement(), MarkerHit)


Change Gravity
Code:
marker = createMarker(3640, 6210, 52, "corona", 25, 0, 0, 0, 200)


function gravity(player)
Code:
if getElementType(player)=="player" then
 if source == marker then
 vehicle = getPedOccupiedVehicle(player)
 x,y,z = getElementPosition(player)
 setVehicleGravityPoint(vehicle, x, y, z-1000, 1) -- You need to test it many times until you understand how it works.
 end
 end
 end

 function setVehicleGravityPoint(targetVehicle, pointX, pointY, pointZ, strength)
 if isElement(targetVehicle) and getElementType(targetVehicle)=="vehicle" then
 local vehicleX,vehicleY,vehicleZ = getElementPosition(targetVehicle)
 local vectorX = vehicleX-pointX
 local vectorY = vehicleY-pointY
 local vectorZ = vehicleZ-pointZ
 local length = (vectorX^2 + vectorY^2 + vectorZ^2)^0.5
 local propX = vectorX^2 / length^2
 local propY = vectorY^2 / length^2
 local propZ = vectorZ^2 / length^2
 local finalX = (strength^2 * propX)^0.5
 local finalY = (strength^2 * propY)^0.5
 local finalZ = (strength^2 * propZ)^0.5
 if vectorX > 0 then finalX = finalX * -1 end
 if vectorY > 0 then finalY = finalY * -1 end
 if vectorZ > 0 then finalZ = finalZ * -1 end
 return setVehicleGravity(targetVehicle, finalX, finalY, finalZ)
 end
 return false
 end
 addEventHandler("onClientMarkerHit", getRootElement(), gravity)


Blow Vehicle
Code:
marker = createMarker(3823, -2024, 2.5, "corona", 5, 255, 0, 255, 255)

 function boom(player)
 if getElementType(player)=="player" then
 local vehicle=getPedOccupiedVehicle(player)
 if source == marker then
 blowVehicle(vehicle)
 end
 end
 end
 addEventHandler("onClientMarkerHit", getRootElement(), boom)


Create a Ring of Fire
Code:
function fire()
 createObject(13641, 3825.7, -2026, 3)
 setTimer(ogien, 2500, 0)
 x,y,z = 3825.7, -2026, 3
 end
 addEventHandler("onClientResourceStart", getRootElement(), fire)

 function ogien()
 createFire(x+12, y, z+2.5, 2)
 createFire(x+12, y, z+17, 2)
 createFire(x+12, y+7.5, z+8.5, 2)
 createFire(x+12, y-6.5, z+8.5, 2)
 createFire(x+12, y-5.5, z+12.5, 2)
 createFire(x+12, y-4, z+13.5, 2)
 createFire(x+12, y-2, z+15.5, 2)
 createFire(x+12, y+7.5, z+8.5, 2)
 createFire(x+12, y+6.5, z+12.5, 2)
 createFire(x+12, y+5, z+13.5, 2)
 createFire(x+12, y+3, z+15.5, 2)
 createFire(x+12, y+6.5, z+6.5, 2)
 createFire(x+12, y+4.5, z+4.5, 2)
 createFire(x+12, y+3.5, z+3.5, 2)
 createFire(x+12, y+2.5, z+3.5, 2)
 createFire(x+12, y-5.5, z+6.5, 2)
 createFire(x+12, y-4, z+4.5, 2)
 createFire(x+12, y-3.5, z+3.5, 2)
 createFire(x+12, y-2.5, z+3.5, 2)
 end


Fix Vehicle
Code:
marker = createMarker(3823, -2024, 2.5, "corona", 5, 255, 255, 0, 255)

 function fixx(player)
 if getElementType(player)=="player" then
 local vehicle=getPedOccupiedVehicle(player)
 if source == marker then
 fixVehicle(vehicle)
 end
 end
 end
 addEventHandler("onClientMarkerHit", getRootElement(), fixx)


Vehicle Upgrades
Code:
local marker = createMarker(3823, -2024, 2.5, "corona", 5, 0, 255, 255, 255)

 function fixx(player)
 if getElementType(player)=="player" then
 local vehicle=getPedOccupiedVehicle(player)
 if source == marker then
 addVehicleUpgrade(vehicle, 1164)
 end
 end
 end
 addEventHandler("onClientMarkerHit", getRootElement(), fixx)

Author:  Script [ Wed 09. Mar 2016 18:33:26 ]
Post subject:  Re: Scripts

Only copied of MTA wiki?

Author:  UNDERTAK3R [ Sun 13. Mar 2016 0:45:06 ]
Post subject:  Re: Scripts

Shut up, Im Scripter nab

Author:  Script [ Sun 13. Mar 2016 10:57:09 ]
Post subject:  Re: Scripts

UNDERTAK3R wrote:
Shut up, Im Scripter nab


:DDDDDDDDDDDDDDDDDDD

Author:  t1. [ Sun 13. Mar 2016 22:43:55 ]
Post subject:  Re: Scripts

Copy - Paste? :D
I think we all know how to use google.

Author:  UNDERTAK3R [ Mon 14. Mar 2016 10:04:45 ]
Post subject:  Re: Scripts

K2O Dafuq? You have a brain error 404
Please fix the error

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/