-
Posts
656 -
Joined
-
Days Won
9
Everything posted by SpecT
-
Yeah, this guy created a backdoor... Are the scripts compiled ?
-
If they are supposed to run at the same time you can merge the functions into one then you will need only one add/removeEventHandler. And also your idea of non-messy code and at the same time all the stuff done in one lane are kinda opposite things (in my opinion). Your main goal should be to optimize your code as good as possible not to make it "beautiful" lol.
-
Go to MTA's installation folder -> mods -> deathmatch -> resources -> find the folder "killmessages" and delete it. And then ronnect to the server.
-
Read this: https://updatesa.multitheftauto.com/sa/trouble/?tr=netlimiter You might have an installed netlimiter on your computer which is not allowed in the server you want to join.
-
It depends how the player gets the kills count information. If it's with getElementData then this should update it immediately. addCommandHandler("kills", function (thePlayer, _, account, amount) if (isPlayerInACL(thePlayer, "Admin")) and (tonumber(amount)) then local targetAccount = getAccount(account) local targetPlayer = getAccountPlayer(targetAccount) if (targetAccount) then if (setAccountData(targetAccount,"kills", tonumber(amount))) then if targetPlayer then -- If there is a player logged into the account setElementData(targetPlayer, "kills", tonumber(amount)) end outputChatBox("done", thePlayer, 0, 0, 255) else outputChatBox("failed", thePlayer, 255, 0, 0) end else outputChatBox("account not found", thePlayer, 255, 0, 0) end end end)
-
Oops I made some mistakes ? This should work: addCommandHandler("kills", function (thePlayer, _, account, amount) if (isPlayerInACL(thePlayer, "Admin")) and (tonumber(amount)) then local targetAccount = getAccount(account) if (targetAccount) then if (setAccountData(targetAccount,"kills", tonumber(amount))) then outputChatBox("done", thePlayer, 0, 0, 255) else outputChatBox("failed", thePlayer, 255, 0, 0) end else outputChatBox("account not found", thePlayer, 255, 0, 0) end end end)
-
I guess you want to make a function which sets the number of kills of an account you type in the command ? addCommandHandler("kills", function (thePlayer, _, account, amount) if (isPlayerInACL(thePlayer, "Admin")) and (tonumber(amount)) then local targetAccount = getAccount(account) if (targetAccount) then if (account) then setAccountData(account,"kills", tonumber(amount)) end outputChatBox("done", thePlayer, 0, 0, 255) else outputChatBox("failed", thePlayer, 255, 0, 0) end else outputChatBox("account not found", thePlayer, 255, 0, 0) end end end)
-
Client: local songPlaying function gotSong(musicData) local fileName = "temp.mp3" local tmpFile = fileCreate(fileName) fileWrite(tmpFile,musicData) fileClose(tmpFile) songPlaying = playSound(fileName) end addEvent("gotSong",true) addEventHandler("gotSong", root, gotSong) function seekStuff(cmd, seek) if songPlaying then setSoundPosition(songPlaying, seek) outputChatBox("Setting to "..seek.." seconds") end end addCommandHandler("seek",seekStuff) Server: function dlSong(thePlayer) fetchRemote("https://someURL.com/randomSong.mp3",handleSong, "", false, thePlayer ) end addCommandHandler("alo",dlSong) function handleSong(data,err,player) if err ~= 0 then return outputChatBox("We got a problem", player) end outputChatBox("Sending song data to client...", player) triggerClientEvent(player, "gotSong", player, data) end Note: The song won't play immediately! Also it will generate some traffic to the server and between client-server because it has to transfer the music data. But in the end you will be able to seek wherever you want the moment the song starts playing. I don't know what your case is so I'm not sure if this way is efficient for you but it's an answer to your question. *I wrote this stuff quickly so it could be done better I guess. Hope this example is useful! ?
-
setSoundPosition works when you seek to a part of the song which was loaded/downloaded. Using it on sounds which are played from URL won't work fine if the connection is slow. A solution could be to download and write the song in a temporary file and play it. Then you should be able to seek without problems.
-
Yeah and how will it get that "matchingdimension" variable when it's not declared in the function arguments ? Also this ":getType()" will throw an error because no element was specified. I already suggested a solution which I guess is working as the post author didn't write anymore.
-
Read this: https://updatesa.multitheftauto.com/sa/trouble/?tr=netlimiter
-
Oh I thought you have Windows 10 but you have Windows 7. Then you should run: bcdedit -set TESTSIGNING OFF bcdedit -set NOINTEGRITYCHECKS OFF And also this is how a Command Prompt with Administrator privileges should look like: From what I saw in your screenshot you did run the CMD without Admin rights.
-
You did NOT start the CMD with Administrator rights! This is the reason of "Access is denied." message.
-
Run "Command Prompt" as Administrator and run this: BCDEDIT /set nointegritychecks OFF You might need to restart PC.
-
The event onMarkerHit also has an argument for matching dimension (true or false) which you could use. I don't know where you set the variable "dim" so maybe the problem is from there. addEventHandler("onMarkerHit", marker, function( player, matchDim ) if player:getType() == "player" and matchDim then outputDebugString("TEST") end end) *matchDim - true if the player and the marker are in the same dimension
-
Of the target marker. Is it like the default (GTA's) one or more like a custom one?
-
This is some sort of GTA:SA limitation. There are mods (for GTA:SA) that can remove this limitation but without mods I don't think it's possible in MTA. You can create a ped and warp it in the vehicle and use setPedAnalogControlState to turn to the last known direction by the player BUT warpPedIntoVehicle only works with client created peds and vehicles (those are not seen by the other players). Sooo it seems impossible. You could write this in here as an issue but I don't know if they will take care about it.
-
I just did some testing and the weird thing is it kinda works kinda not. It gets the correct rotation and when you leave the vehicle it resets the wheels to their default rotation but when you start entering back in the vehicle and AFTER the ped closes the door it sets the old rotation (turned) for some miliseconds and then it resets the rotation to default. Dunno if this helps somehow tho.
-
Then there could be a custom one. Can you post a screenshot of it here ?
-
You could check every file in the DayZ gamemode and see if SetPedTargetingMarkerEnabled exists in any of them. If you find one you can change it to false and this should disable it. Otherwise you can simply add SetPedTargetingMarkerEnabled(false) in any client-sided file in the gamemode and it will disable it by the time the script gets loaded. BTW it's possible that there is a custom targeting marker in the gamemode.
-
Money and health are not saved when you log out of your account
SpecT replied to Egor_Varaksa's topic in Scripting
Well you already got an answer from @WASSIm.. -
Well the code you have shown seems correct and it should save the data just fine. But you should add a handler when the player logs in (onPlayerLogin) and check (with getAccountData) if he has any rank and then do setPlayerTeam to the player.
-
You can check this topic: They are discussing the same problem as the one you posted with the DX error.
-
updateTimer = setTimer(function() textItemSetText(text, math.floor(remaining/1000)) end,1000,0) -- when the player gets out of the jail if isTimer(updateTimer) then killTimer(updateTimer) end This will create a timer which will trigger the setText function per 1 second so the player will see in real time how much time left to wait. And put the killTimer where you take the player out of jail. Feel free to ask if you can't understand something. ?
