Jump to content

Elmatus

Members
  • Content Count

    47
  • Joined

  • Last visited

Community Reputation

2 Neutral

About Elmatus

  • Rank
    Rat

Details

  • Gang
    cPz

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Yeah, you said you already had it so I didn't post it! I'm glad its working now.
  2. Spawning a weapon doesn't make it fire. You can use the function setWeaponState (theWeapon, "firing") to make it fire (i.e when you press the left mouse button)
  3. function shootProjectile() local vehicle = getPedOccupiedVehicle(localPlayer) -- Check if the player is in a vehicle if(vehicle)then --Check if its a rustler if getElementModel(vehicle) == 476 then --Get the current position of the vehicle and fire a rocket (No rotation is passed to createProjectile function because it automaticaly gets the vehicle rotation) local x, y, z = getElementPosition(vehicle) createProjectile(vehicle, 19, x, y, z) end end end bindKey("mouse1", "down", shootProjectile) I think I understand
  4. Thanks in advantage for any help The problem is kind of simple, yet I haven't figured it out yet. I want that the barrels created actually move and fall. It only happens when a player touches it. The wiki says that to implement physics in an object just set velocity to 0, but it doesn't work A snippet of the code: function .... if.... for i,spot in ipairs (spots) do local pos = split(spot,",") if objectType == "object" then local theObject = createObject (object,pos[1],pos[2],pos[3]) setElementVelocity(theObject
  5. Didn't know aswell That worked just perfect, thanks!
  6. Thanks in advantage for everyone who is willing to help Ok, so I have a problem regarding to fileWrite It works just fine in a normal resource. But when I try it in a zipped script it doesn't have effect. Is this a common thing? How can I fix this problem?
  7. Tried that to pcall (loadstring(luaCode)) But nothing
  8. Ok, thanks in advantage for whoever takes time to answer. I'm trying to make a a script that loads a txt when it starts up. The script is serverside. I have a very weird problem. If I just put the lua code like normal it works just fine. But if Put it in a .txt or event a .lua outside meta, it doesnt work! The purpose of what I want is that admin of the sv can change the file without having to have the FTP of the server. Here is a snippet of my code: (server-side) function loadTheCode() file = fileOpen ("editable.lua") size = fileGetSize(file) luaCode = fileRead(file,size)
  9. I didn't realize that, thanks! I have another question, too small for making it a post. Can you get a return in server-side, by a client-side? Or vice versa
  10. Hi, thanks everyone beforehand I'm making a script o attach a m4 in a migun base and that a player can enter it and shoot. When I tested it with a friend in the server, he doesn't see the bullets coming out. I made it shootable everywhere (me far from the minigun bae) and I stepped in front of it, and I do get killed. I think the problem has to be with being client-side. But createWeapon is only a client-side function. Here is the function that fires the weapon: Client-side customWeapon = createWeapon ("m4",0,0,0) setElementAlpha(customWeapon,0) setElementCollisionsEnabled(custo
  11. Yes it outputs. And no I already tried debugscript and no error is displayed. Like I said is only when I add other argument
  12. Oh sorry! I didn't paste it here, I already have it!
  13. The event is triggered if I only send one argument, "theShooter". I added the argument "object", ensuring is not nil. But the server event is not triggered after that Any help is aprecciated Client (Relevant: line 34-40) function ObjectShot ( theShooter, weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement ) shooterX, shooterY, shooterZ = getElementPosition (theShooter) targetDistance = getDistanceBetweenPoints3D ( shooterX, shooterY, shooterZ, hitX, hitY, hitZ ) local startX, startY, startZ = getPointInFrontOfPlayer(theShooter, 1.5 )
  14. Ok that would work, I'll use it. Just for doubt, how I make it to have a natural movement (gravity, etc) Do I have to mess with the velocity and not the moveObject?
  15. Hi, I have a simple question I was looking in the wiki, but I didn't find how to move a vehicle like you move an object. For example like how gravity gun does. I tried the normal moveObject, but it didn't work
×
×
  • Create New...