pa3ck
Members-
Posts
1,141 -
Joined
-
Last visited
-
Days Won
7
Everything posted by pa3ck
-
You just asked 2 questions that I answered in my post. Read my post again, if you need use Google Translator as well. I will quote it again (for the 3rd time) Note: The values for group and index can be determined by using the client command showsound in conjunction with setDevelopmentMode" - it says on the wiki
-
Note: The values for group and index can be determined by using the client command showsound in conjunction with setDevelopmentMode" - it says on the wiki -> This explains how to get the group and index of a sound. When using setWorldSoundEnabled, there are 3 parameters, one of which is optional. As far as I know the "group" for the weapons is 5. To turn off ALL weapon sounds, you used setWorldSoundEnabled ( 5, false ) But, if you want to only disable specific weapon sounds, you should also pass the function that optional argument, which is the "index" setWorldSoundEnabled ( 5, 22, false ) If you read the 1st line of this post, you will then also understand how to find these ID's. Good luck.
-
"This function allows you to disable world sounds. A world sound is a sound effect which has not been caused by playSound or playSound3D. Note: The values for group and index can be determined by using the client command showsound in conjunction with setDevelopmentMode" - it says on the wiki
-
setAmbientSoundEnabled( "gunfire", false )
-
This is the one I looked at to see how JavaScript and LUA work together: https://community.multitheftauto.com/index.php?p=resources&s=details&id=12905
-
It will always be true, unless there's no connection, check the results by getting the table length returned from dbPoll as I said.
-
Do you have HEX code in your name, by any chance? Are you sure there actually is something in the table with that name? You should also consider using id's (primary key with auto_increment) and you wouldn't need to worry about names.
-
Try to get the length of the query (#query) and see
-
No, it will only return that one column, but it's still structured the same way.
-
To check if there's actually something returned from SQL you should check "#result > 0", so you will know that there's something in the table. When checking if a username exist or just getting only 1 row from SQL you should always use "LIMIT 1" at the end, just like you would break out of the loop when you find what you are looking for. Now, for your problem, MySQL returns rows as table, so it looks like this: results = { { ["username"] = "SomeBooodys username", ["password"] = "SomeBooodys password", } } So in order to get the first and only row, you don't need a loop, but you do it this way: outputChatBox("found username: "..tostring(query[1]["username"])) BTW, in LUA, the first index is not 0 but 1.
-
Read what I said about JavaScript, HTML doesn't really care about the tags, it won't throw errors or anything, that couldn't be the problem.
-
Because in JavaScript, you have to put ";" after the lines, but you clearly didn't. What I suggest you is, test everything in your browser using Google Chrome Dev tools and the console should point out errors like that. Also, what LoPollo said, pay attention to the default HTML layout, <html><head></head><body></body></html> etc... EDIT: I don't know if you know it already, but you also have to include all the files in the meta.xml, including JS files and CSS.
-
Well hasObjectPermissionTo is a server-side only function, so you either make changes to it so you don't have to use that function or just do the explosion server side: function robbant(p,s) if hasObjectPermissionTo(p,"command.rob") then local pX, pY, pZ = getElementPosition ( p ) createExplosion ( pX+3, pY+3, pZ, 2 ) createExplosion ( pX-3, pY-3, pZ, 2 ) createExplosion ( pX+5, pY-2, pZ, 2 ) createExplosion ( pX-4, pY+4, pZ, 2 ) end end addCommandHandler("rob",robbant)
-
If I understand correctly, you want to keep the text when closing - reopening the GUI? If so, this will do exactly that, put this inside the PGUI function: if #GUItext > 0 then for i = 1, #GUItext do local row = guiGridListAddRow( GUIEditor.gridlist[1] ) guiGridListSetItemText( GUIEditor.gridlist[1], row, 1, GUItext[i], false, false ) guiGridListSetItemText( GUIEditor.gridlist[1], row, 2, Admin[i], false, false ) end end Just so you know, only the local player will see the text.
-
Just by looking at it, I can definitely say that these lines: vehCol = createColSphere(x,y,z,1.5) attachElements ( vehCol, veh, 0, 0, 0 ) local vehicle = setElementData(vehCol,"parent",veh) local vehicle = setElementData(veh,"parent",vehCol) local vehicle = setElementData(vehCol,"vehicle",true) local vehicle = setElementData(vehCol,"MAX_Slots",6) local tires,engine = getVehicleAddonInfos (getElementModel(veh)) local vehicle = setElementData(vehCol,"Tire_inVehicle",math.random(0,tires)) local vehicle = setElementData(vehCol,"Engine_inVehicle",math.random(0,engine)) Should be this, so vehicle will still be the element, not a true/false that's been returned: vehCol = createColSphere(x,y,z,1.5) attachElements ( vehCol, veh, 0, 0, 0 ) setElementData(vehCol,"parent",veh) setElementData(veh,"parent",vehCol) setElementData(vehCol,"vehicle",true) setElementData(vehCol,"MAX_Slots",6) local tires,engine = getVehicleAddonInfos (getElementModel(veh)) setElementData(vehCol,"Tire_inVehicle",math.random(0,tires)) setElementData(vehCol,"Engine_inVehicle",math.random(0,engine)) Is this the whole server side code? Because I can not see the function getVehicleAddonInfos
-
You can use anynomous functions inside the setTimer like: setTimer(function() updatePlayerZoneWrapper(self, player) end, 4000, 1) But the way you tried is also a working method, so the problem is probaly the variable "player" is not accessible by the setTimer. Try to reference it before setting the setTimer like: local player = player setTimer( ... )
-
Looks like the problem is at this line: addPlayerStats (source,"thirst",waterGain) Can you insert the following line after it: outputChatBox("waterGain value: " .. tostring(waterGain)) Then see what it returns
-
I think the custom fadeout is a bit complicated, so it would be difficult to understand it right away. I made a simple window animation, with the same principles as the custom fadeout. And this is the working custom fadeIn and fadeOut:
-
I'm really sorry that that's what you understood from my post. I didn't mean to mock you, or @LoPollo (I know he is in fact a very good scripter himself), I just wanted to make my point. Why I used onPlayerLogin? Because in his code he is checking getAccountData so probably he is saving something there, don't you think? Probably only specific players could regenerate their hp... don't know, it's not my code. As I said, I didn't mean to mock you, but can you please elaborate on elementData being the worst? Over triggerServerEvent every 7 secs? You are stating that changing elementData when user logs in and logs out, meaning 2 "server operations" in probably at least 30 mins is worse than your code, which makes "server operations" in every 7 second, that is 1800 / 7 = 257 in 30 mins. My main programming language is C# and JavaScript, I would be glad if you could explain it to me, I'm probably just like you, trying to learn every day, whenever I can. Thanks @Simple01.
-
Actually I already edited the script so it will only fade out when you set it to false I just didn't want to spoon feed you I tried to make you solve it. I'm away In Dublin now but I will send you the code tomorrow with some comments explaining how to do it.
-
You are still using the old startTime in the else block, which is pagerStartTick you should update it to getTickCount() where you update the pagerOutTick