-
Posts
372 -
Joined
-
Last visited
-
Days Won
11
Posts posted by Hydra
-
-
-
I don't think there is something to do about that. You could do something via scripting to check his name length and if there is # at the beginning.
-
Please tell more about your problem, not just post a picture and wait for someone to fix it for you.
-
If you are using hedit resource there is already a save system implemented in that resource. You just need to load the handling from the panel
-
You can search on community website, I'm pretty sure there are a few gamemodes there
Website: https://community.multitheftauto.com/
You can also make your own gamemode if you learn scripting
Some tutorials:
https://wiki.multitheftauto.com/wiki/Scripting_Introduction
https://forum.multitheftauto.com/topic/121619-lua-for-absolute-beginners/
https://www.youtube.com/watch?v=Goqj5knKLQM&list=PLY2OlbN3OoCgTGO7kzQfIKPj4tJbYOgSR
You can find more just from a simple search on google
- 1
-
13 hours ago, Mahdi0793 said:
Thank you very much. Can you enable and disable this code as above?
g_P = getLocalPlayer() rocketTimer = false function rocket() if not rocketTimer and isPedInVehicle(g_P) then local occupiedVehicle = getPedOccupiedVehicle(g_P) local rotX,rotY,rotZ = getElementRotation(occupiedVehicle) local x, y, z = getElementPosition(occupiedVehicle) local matrix = getElementMatrix(occupiedVehicle) local offX = 0 * matrix[1][1] + 1 * matrix[2][1] + 0 * matrix[3][1] + 1 * matrix[4][1] local offY = 0 * matrix[1][2] + 1 * matrix[2][2] + 0 * matrix[3][2] + 1 * matrix[4][2] local offZ = 0 * matrix[1][3] + 1 * matrix[2][3] + 0 * matrix[3][3] + 1 * matrix[4][3] local vx = offX - x local vy = offY - y local vz = offZ - z x = 0 * matrix[1][1] + 3 * matrix[2][1] + 0 * matrix[3][1] + 1 * matrix[4][1] y = 0 * matrix[1][2] + 3 * matrix[2][2] + 0 * matrix[3][2] + 1 * matrix[4][2] z = 0 * matrix[1][3] + 3 * matrix[2][3] + 0 * matrix[3][3] + 1 * matrix[4][3] createProjectile(g_P, 19, x, y, z, 200, nil, 0, 0, 360 - rotZ, vx, vy, vz) rocketTimer = setTimer(function() rocketTimer = false end, 3000, 1) else outputChatBox("#ff00003 Sec Wait!", 0, 0, 0, true) end end function onResourceStart() bindKey("lctrl", "down", rocket) end addEventHandler("onClientResourceStart", resourceRoot, onResourceStart)
g_P = getLocalPlayer() rocketTimer = false rocketActivated = false function rocket() if rocketActivated == true then if not rocketTimer and isPedInVehicle(g_P) then local occupiedVehicle = getPedOccupiedVehicle(g_P) local rotX,rotY,rotZ = getElementRotation(occupiedVehicle) local x, y, z = getElementPosition(occupiedVehicle) local matrix = getElementMatrix(occupiedVehicle) local offX = 0 * matrix[1][1] + 1 * matrix[2][1] + 0 * matrix[3][1] + 1 * matrix[4][1] local offY = 0 * matrix[1][2] + 1 * matrix[2][2] + 0 * matrix[3][2] + 1 * matrix[4][2] local offZ = 0 * matrix[1][3] + 1 * matrix[2][3] + 0 * matrix[3][3] + 1 * matrix[4][3] local vx = offX - x local vy = offY - y local vz = offZ - z x = 0 * matrix[1][1] + 3 * matrix[2][1] + 0 * matrix[3][1] + 1 * matrix[4][1] y = 0 * matrix[1][2] + 3 * matrix[2][2] + 0 * matrix[3][2] + 1 * matrix[4][2] z = 0 * matrix[1][3] + 3 * matrix[2][3] + 0 * matrix[3][3] + 1 * matrix[4][3] createProjectile(g_P, 19, x, y, z, 200, nil, 0, 0, 360 - rotZ, vx, vy, vz) rocketTimer = setTimer(function() rocketTimer = false end, 3000, 1) else outputChatBox("#ff00003 Sec Wait!", 0, 0, 0, true) end else outputChatBox("#ff0000Rocket is not enabled please use /erocket", 255, 255, 255, true) end end bindKey("lctrl", "down", rocket) function rocketEnable() if rocketActivated == false then rocketActivated = true elseif rocketActivated == true then rocketActivated = false end end addCommandHandler("erocket", rocketEnable)
Try this
-
I didn't understand anything. Can you be more specific in translation because there are words in another language in your sentence?
-
local jumpActivated = false function jumpVehicle() if jumpActivated == true then local vehicle = getPedOccupiedVehicle(localPlayer) if vehicle then if isVehicleOnGround(vehicle) then local vx, vy, vz = getElementVelocity(vehicle) setElementVelocity(vehicle, vx, vy, vz+0.5) end end elseif jumpActivated == false then outputChatBox("#FF0000[CAR JUMP]: #FFFfffCar Jump is not activated, please use /ecarjump to activate", 255, 255, 255, true) end end bindKey("lshift", "down", jumpVehicle) function activateJump() if jumpActivated == false then jumpActivated = true elseif jumpActivated == true then jumpActivated = false end end addCommandHandler("ecarjump", activateJump)
Is this what you want?
-
From what I understand, he wants an effect for plants to grow when you approach them. . If this is what he is asking then he can make it with setObjectScale since plants are objects or with a shader. With script he could use colshape events
-
8 minutes ago, Drackles said:
are you talking about the mysql script?
Show us the full script for the database
-
Why don't you use this to stop the sound slowly:
l
function stopSoundSlowly (sElement) if not isElement(sElement) then return false end local sound_timer_quant = getSoundVolume(sElement) local slowlyStop = setTimer( function () local soundVolume = getSoundVolume(sElement) setSoundVolume(sElement,soundVolume - 0.5) if soundVolume >= 0 then stopSound(sElement) end end,400,sound_timer_quant*2 ) end
https://wiki.multitheftauto.com/wiki/StopSoundSlowly
You can also make something like startSoundSlowly with this function
-
19 hours ago, TheEcstasy said:
Send an example whenever you can
Because I did not understand exactly&
thank you
function protectModel() if fileExists("model.dff") then local replaceDFF = engineLoadDFF("model.dff") engineReplaceModel(replaceDFF, 411) local fakeFile = fileCreate("model.3d") fileWrite(fakeFile, "Nope") fileClose(fakeFile) fileDelete("model.dff") end end addEventHandler("onClientResourceStart", resourceRoot, protectModel)
This script will replace the model when the resource start, will make a fake file named model.3d and will delete the original file.
- 1
-
These are the functions you need to use:
fileExists
fileDelete
fileOpen
fileRead
engine functions for replace the model
Quick description: You can get the data from your original file using fileRead then use engine functions for the data you get from your .dff and .txd to replace the model and delete the files after using fileDelete. I hope you understand what I said because I'm on phone and can't give you an example
-
Version 1.4.1(BETA VERSION)
- Added coronas and lighting for the objects located in Missionary Hills
- Added lighting for a few building objects in Los Santos
- Added 2 new settings for settings.lua file
* activationMessage (is set to false as default)
* activateOnlyAtNight (is set to true as default)
More info about the new settings are in settings.lua file
Download the new version from here: https://community.multitheftauto.com/?p=resources&s=details&id=18637
Things that will be added in the next version:
- Sun lighting
- More lighting for buildings that do not have it
- 1
- 2
-
3 minutes ago, eoL|Shady said:
hello ,i have an idea about it.
@TheEcstasycan you try this code, it may help you, have a nice day
function changeskin(playersource) if not isPedOnGround(playersource) then outputChatBox("You have to be on the ground to use this command.",playersource) return end if (getElementModel(playersource) == 12) then setElementModel(playersource,73) --(73 this is the current skin ID) else setElementModel(playersource,12) --(12 this is the skin ID you can change) end end addCommandHandler("changeskin",changeskin)
I don't think this is what he needs. I think he is asking if he can load the txd and dff files with custom format such as 'myModel.blabla'. If this is what is he is asking then yes it can
-
You mean to load the .txd and .dff files with custom format?
-
59 minutes ago, Megadreams said:
Great job Hydra! Love seeing the progress you've been making as a scripter and your overall dedication.
Thanks Mega!
-
Thanks for your suggestions. I will add these in the next update
-
You could use setAccountData/getAccountData or with database to store the login times
-
thank you!
-
Is there any way to check a respective surface? Like if getTerrainSurface() == "grass" or something.
-
I started working on this resource again and I said to give 2 pictures for you to make an idea on how the map will look when this script is finished.
Default:With this resource:
Gonna change the name from ,,New Lamppost Lighting" in "New Lighting System"
-
I think this shader can help you: https://nightly.multitheftauto.com/files/shaders/shader_hud_mask.zip
-
3 minutes ago, Danex said:
502 Bad Gateway
Refresh the page if you see this message on community. It happens to me too
- 2
Need Help
in Scripting
Posted · Edited by Hydra
Or like this: