It is currently Fri 22. Nov 2024 23:57:39

All times are UTC + 1 hour [ DST ]




Post new topic  Post a reply   Page 1 of 1  [ 6 posts ] 
Author Message

Stroiter
 Post subject: Scripts
PostPosted: Wed 09. Mar 2016 17:12:53 
offline
'Mower'
'Mower'
User avatar

Joined: Sat 20. Feb 2016 17:54:09
Posts: 47
Location: Arada, Portugal

Banned on server
Points: 33 732
Cash: $1 561
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)

___________________
Image


Last edited by UNDERTAK3R on Sun 13. Mar 2016 0:49:43, edited 1 time in total.

Top
   
 

#SH
 Post subject: Re: Scripts
PostPosted: Wed 09. Mar 2016 18:33:26 
offline
'Mower'
'Mower'

Joined: Thu 30. Oct 2014 13:01:25
Posts: 45

Points: 4 802
Cash: $451
Only copied of MTA wiki?


Top
   
 

Stroiter
 Post subject: Re: Scripts
PostPosted: Sun 13. Mar 2016 0:45:06 
offline
'Mower'
'Mower'
User avatar

Joined: Sat 20. Feb 2016 17:54:09
Posts: 47
Location: Arada, Portugal

Banned on server
Points: 33 732
Cash: $1 561
Shut up, Im Scripter nab

___________________
Image


Top
   
 

#SH
 Post subject: Re: Scripts
PostPosted: Sun 13. Mar 2016 10:57:09 
offline
'Mower'
'Mower'

Joined: Thu 30. Oct 2014 13:01:25
Posts: 45

Points: 4 802
Cash: $451
UNDERTAK3R wrote:
Shut up, Im Scripter nab


:DDDDDDDDDDDDDDDDDDD


Top
   
 

SHASUFG
 Post subject: Re: Scripts
PostPosted: Sun 13. Mar 2016 22:43:55 
offline
'Monster Truck'
'Monster Truck'
User avatar

Joined: Sun 29. Mar 2015 13:17:19
Posts: 304
Location: Estonia

Points: 1 049 551
Cash: $3 406 710
Copy - Paste? :D
I think we all know how to use google.

___________________
Image

Image


Top
   
 

Stroiter
 Post subject: Re: Scripts
PostPosted: Mon 14. Mar 2016 10:04:45 
offline
'Mower'
'Mower'
User avatar

Joined: Sat 20. Feb 2016 17:54:09
Posts: 47
Location: Arada, Portugal

Banned on server
Points: 33 732
Cash: $1 561
K2O Dafuq? You have a brain error 404
Please fix the error

___________________
Image


Top
   
 
Display posts from previous:  Sort by  
Post new topic  Post a reply   Page 1 of 1  [ 6 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
TOPlist
Powered by phpBB® Forum Software © phpBB Group

©MSHost.cz