Jump to content

How create this script?


VeTaL

Recommended Posts

i am want this script for my rpg server, but idk how made this, who can help me?

Bro I think here no one will make that for you, because people already are very busy on their projects, and well its the rulles you see? first you need to do something, and then show to us, and people will help more!

But I can give you some ideas.

I think you need to use:

https://wiki.multitheftauto.com/wiki/CreateProjectile

And on hit of projectile you make a explosion with

https://wiki.multitheftauto.com/wiki/CreateExplosion

Well I am not that such a pro, but I think you can make that way.

Sorry if I am not right :S

By the way, if you are new to lua I advice you to read this:

https://wiki.multitheftauto.com/wiki/Scr ... troduction

From here you can have a quickly introduce to lua on mta, and will start to learn how this works :)

If you wanna go more deep, learn scripting guis, those windows you know? here is the tutorial:

https://wiki.multitheftauto.com/wiki/Int ... ng_the_GUI

I guess its everything ,

Good luck bro ;)

Link to comment

I am noob in scripting, and don't want know all in this, but i am want this script in server, and i think all admins will like that...

and i have 1 question, how made the time start script || i am want, what zombie going after 18:00 to server time, and all zombie die in 6:00 :P

=====

sry for bad english((

i am russian

Link to comment
  • 2 weeks later...

Try this =D

SERVER SIDE

car = createVehicle( 600, 0, 0, 2 ) 
setElementData(car,"rocket",true) 
object = createObject(3884, 2530.621, -1715.385, 12.489) 
attachElements(object, car, 0,-1.8,-0.5) 
  
function bindKeyStartFire() 
bindKey(source,"i","down",rocketfire) 
end 
addEventHandler("onPlayerJoin", getRootElement(),bindKeyStartFire) 
  
function rocketfire(source) 
 if isPedInVehicle(source) then 
  local vehicle = getPedOccupiedVehicle(source) 
  if getElementData(vehicle,"rocket") == true then 
   if getVehicleController(vehicle) == source then 
    local x,y,z = getElementPosition(vehicle) 
    local rx,ry,rz = getVehicleRotation(vehicle)     
      triggerClientEvent("fireRocket", getRootElement(), source, x, y, z, rz,vehicle)  
     end 
   end   
  end  
 end 

Client side!

function fireRocket(source,x, y, z, rz,vehicle) 
if source == getLocalPlayer() then 
 createProjectile(source, 19, x, y-1, z+3, 900, nil, 0,-15,-(rz+180),0,0,0) 
  createProjectile(source, 19, x, y+1, z+3, 900, nil, 0,-15,-(rz+180),0,0,0) 
 car = vehicle 
  
end 
end 
addEvent("fireRocket", true) 
addEventHandler("fireRocket", getRootElement(), fireRocket) 
  

Link to comment

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