Jump to content

pa3ck

Members
  • Posts

    1,141
  • Joined

  • Last visited

  • Days Won

    7

Everything posted by pa3ck

  1. function hydra (thePlayer) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) -- get his account name if accName and isObjectInACLGroup ("user."..accName, aclGetGroup ( "VIP" ) ) then local x, y, z = getElementPosition ( thePlayer ) local hydra = createVehicle ( 520, x, y, z ) warpPedIntoVehicle (thePlayer, hydra ) end end addCommandHandler ( "Hydra", hydra ) Try this, next time please type "/debugscript 3" and take a screenshot / write down the error(s) that may come up as well, that way we can easily identify the problem. The problem here was that the thePlayer was not defined and you used "client", which is not available at the addCommandHandler event handler.
  2. Both of them are in Polish mate, if you want to get help ASAP, try to write it in English as well. But what I understood from the translation, you cheated and now looking to get un-banned and you claim you didn't know cheating is punishable.. who would have thought of that, right? Like the lamest excuse (if it can even be called an excuse..) ever.
  3. Ok, so if I understand correctly, there's already an event called "onZombieWasted" which you want to trigger an event called onNemesisWasted, correct? If so, you can do this: addEvent("onZombieWasted", true) addEventHandler("onZombieWasted", root, functon(whatever, args, you, have) if whatever = "isthis" and args = "notargs" then triggerEvent("onNemesisWasted", root, pass, your, arguments) -- if you want from server to server or client to client, you can also -- trigger this to server -> client or client -> server by using triggerClient/ServerEvent end end) addEvent("onNemesisWasted", true) addEventHandler("onNemesisWasted", root, function(pass, your, arguments) if pass then outputChatBox("onNemesisWasted called") end end)
  4. It's a proper Lua table, the same way as any other variable.. function generateTable() local query = dbQuery(connection, "SELECT * FROM players") local result = dbPoll(query, -1) if result and #result > 0 then -- result is always true, except when the connection is not working, make sure you always check the length.. triggerClientEvent(playerElement,"myEvent", playerElement, result)
  5. I think the easiest would be to add the commandHandler server side, then get the data from MySQL and trigger to client to create the GUI, this way you wouldn't: triggerToServer - triggerToClient, you would only triggerToClient.
  6. Something problem? Ok, try to fix something by doing something in the code.. Rather than saying there's something wrong, can you just tell us what the problem is exactly?
  7. I seen so many times in your code that you just assume thePlayer is like a magic keyword, whenever you use it without it being defined it would just work and get the player. That is not how it works, there are "magic" variables like source, client, resourceRoot, root etc which you don't have to define, but thePlayer is not always a parameter... When you trigger from client to server and the sendTo argument (2nd arg.) is the localPlayer, you can use the variable client without defining it. Change thePlayer @line 3 to client on s side and @line 5 resourceRoot to localPlayer c side.
  8. From Lua to Javascript, you use the executeBrowserJavascript which takes pure JS code. For example: executeBrowserJavascript(myBrowser, 'document.getElementById("myId").innerHTML = "hello";') //Or if you have jQuery executeBrowserJavascript(myBrowser, '$("#myId").html("hello");')
  9. First you dbPoll that query you can then just send over the Lua table with triggerClientEvent / triggerClientLatentEvent depending on the amount of players you have in the database. You can then use a loop to create the grid. There should be number of examples on the wiki that shows how to populate gridlists, the only difference here would be that you're populating from a MySQL result table.
  10. pa3ck

    HoursToDay

    Why are you dividing by 60 @TheMOG, 1 day = 24 hours, so you divide by 24
  11. That's not the original weapon, that will be the custom one. You can't hide the alpha of the actual weapon element that is in your hands, you'd need to use an invisible TXD.
  12. How do you set the alpha of the original weapon?
  13. If you turn off the rain server side, it will be turned off for everybody else as well. @ line 42 use setAccountData to save the "ChkWeath" state on the user account and also use setElementData which you can use on the client side. Use onPlayerLogin event to get the accountData and save it to setElementData again to be able to use it client side. You can also just implement the command client side and use xmlCreateFile / xmlLoadFile to create a settings XML where you can save things like this.. When you create a timer, there's no thePlayer parameter either, you can only pass values into it manually.
  14. BTW.: if you think you're unable to explain certain things in English, you can also just use the Russian section here: https://forum.multitheftauto.com/forum/100-russian-русский/
  15. There's a difference between paintjobs and nitro effect. Basically every single car got their own body, which you can change, because the "parent" is the vehicle itself. But not all cars have the nitro effect element, the parent is basically the "word", or at least that is what I understand. For example if you want to use shader for the ocean, you wouldn't be able to differentiate between the ocean in San Fierro and Los Santos, they are the same.
  16. pa3ck

    setInterior

    local intID = tonumber(intID) -- make sure it's an int local int,x,y,z = interiors[intID][1],interiors[intID][2],interiors[intID][3],interiors[intID][4]
  17. And the explanation: since you have more than one marker positions, if you run the loop number of times, the variable mar and mar2 will be replaced with the newly created marker, since a variable can have only one value, the values will be overridden. To fix that, you'll need to use tables, the way it's been done above.
  18. You probably can, if the 'runcode' resource is running on the server. Since you have ACL rights, you should be able to execute code in-game.. but you would need to write the code to load the map files and save them to your PC with fileWrite
  19. When using the resource freeroam, you can open the F1 panel and I think it shows your position, but as far as I know there's also a /gp command which outputs your x, y, z coords.
  20. function removeLoginText(text) if text:lower():find('login:') or text:lower():find('logout:') then cancelEvent() else return end if text:lower():find("already logged in") then outputChatBox() -- your own message elseif text:lower():find("something else") then somethingElse() end end addEventHandler("onClientChatMessage", root, removeLoginText) I think this would be the simplest way around it.
  21. There are other components which can be changed on individual vehicles like paintjobs, rims, glass etc and that is when targetElement comes in to play.
  22. function removeLoginText(text) if text:lower():find('login:') or text:lower():find('logout:') then cancelEvent() end end addEventHandler("onClientChatMessage", root, removeLoginText) Try that, there might be a space or something in the text, so they are not actually the same.
×
×
  • Create New...