Jump to content

luskanek

Members
  • Posts

    37
  • Joined

  • Last visited

Everything posted by luskanek

  1. Hey everyone For more than a hour I've been trying to create a projectile which would fire at the opposite side of a vehicle (let's say I have an Infernus facing front, but I want for the projectile to shoot from the side to the car and not to the front (think of it as a pirate ship broadside cannon), or another explantation: Let's say my vehicle is facing North, but I want the projectile to be shot at West) local veh = getPedOccupiedVehicle(getLocalPlayer()) local x, y, z = getElementPosition(veh) local rX, rY, rZ = getElementRotation(veh) local x = x + 4 * math.sin(math.rad(rZ + 90)) local y = y + 4 * math.cos(math.rad(rZ + 90)) createProjectile(veh, 19, x + 3.5, y + 3.6) This is the base code I'm working with. I've tried to change the rotation and velocity of the projectile, which worked, however, only if the vehicle was facing a certain direction otherwise the projectile just destroyed the vehicle. Please, I'm been trying to do this for more than a hour and would be grateful if you could help me.
  2. addCommandHandler("mycmd", function() if getPlayerName(getLocalPlayer()) == "myname" then -- do stuff end end )
  3. Hey, I'm looking for an event which triggers when the player aims or takes a picture with the Camera. onClientPlayerWeaponFire() -- doesn't support the camera and I couldn't find anything else. Thanks.
  4. Yes. Tried to change the element to player instead of vehicle and get the player's vehicle, however, nothing works.
  5. addEventHandler("onMarkerHit", getRootElement(), function(tElement) if getElementType(tElement) == "vehicle" then if getMarkerType(source) == "corona" then local x, y, z = getElementVelocity(tElement) setElementVelocity(tElement, x * 1.06, y * 1.06, z) end end end ) Doesn't work, no errors.
  6. TAPL, the event is onMarkerHit. I need the loop to check whenever the players hits a corona.
  7. Hello, for key, corona in pairs (getElementsByType("marker")) do if getMarkerType(corona) == "corona" then What I'm trying to do is to detect when a element hits a corona marker, however, the code triggers always, so not when it's a corona only. How do I fix this?
  8. Hello, -- server addEventHandler("onPlayerJoin", getRootElement(), function() triggerClientEvent(source, "showGui", source, "GUIEditor.window[1]") end ) -- client addEvent("showGui", true) addEventHandler("showGui", getRootElement(), function(guiElement) guiSetVisible(guiElement, true) guiSetInputEnabled(true) showCursor(true) end ) No errors, the cursor shows, however, the window (GUIEditor.window[1]) doesn't show. How do I fix this? Thanks.
  9. Hello! I'm trying to increase the player's speed, however I'm not any successful. I'm using the functions getElementVelocity setElementVelocity however, I want the player to always move at the speed I set. So always when the move. Is it somehow possible to make that when a player moves, he moves at an increased speed? I saw it at a RPG server, after using a drug you'd move faster. Thanks!
  10. Thank you for the response, but that's not what I wanted. I know that I can make so people select one, but then every other player will have the same model as that which the one player picked. For example, I have the models rustler1, rustler2 and rustler3. The first player picks the model rustler2, the second picks the rustler3 and the third player will pick rustler1. Now, when the first player will meets the second player, player one will have the model he picked (rustler2) and the second player he met will have the model which the second player picked (rustler3). So I want different models present in the game, so that different players will have different rustler, but the others will still be able to see the other models, not the ones they picked. I hope you understood. Thanks
  11. Hello! I have a question: I want multiple different models for the Rustler, is that possible? I have four models for the Rustler and want all of them to be usable on my server. Thank you!
×
×
  • Create New...