Jump to content

iPanda

Members
  • Posts

    174
  • Joined

  • Last visited

Everything posted by iPanda

  1. В помощь: https://wiki.multitheftauto.com/wiki/Shader_examples
  2. Thanks for the help, everything turned out. с=
  3. iPanda

    [help] trigger

    may be you need to add event for function 'teste'?
  4. try function giveMinigun() giveWeapon ( source, 38, 5000 ) takePlayerMoney ( source, 15000 ) end addEvent ( "giveMinigun", true ) addEventHandler ( "giveMinigun", root, giveMinigun )
  5. TiM3, thank you very much, everything works! But I have another question, how can I get a few items at once (after all, this function gives only 1 point thing)?
  6. Yes, you have use this script: local state = {"pro","std","poor"} addEventHandler("onResourceStart",resourceRoot,function() for _,st in ipairs(state) do setWeaponProperty(22,st,"flags", 0x000800) end end)
  7. iPanda

    Help!

    Yes, you have use this functions: bindKey setVehicleSirens setVehicleSirensOn
  8. it also does not provide a random list of items and output an error in the console.
  9. iPanda

    [help] trigger

    you do not set the timer value after the function has been end (milliseconds,repeat). Try that. result = 0 setTimer (function () if result <= 25 then result = members_in_turf [team] [zone] + result triggerClientEvent ("OnTimer" theplayer, result) outputChatBox ("" .. tonumber (result) .. "") end--you forgot end,1000,1)--value for set the timer after 'end' and I recommend reading: https://wiki.multitheftauto.com/wiki/SetTimer
  10. Hello everyone. I have a problem when creating points with objects for inventory. I want to show a random item (or several items) from my table to output them at the point items. Table: itemTable = { ["Loot"] = { {"Item1",1}, {"Item2",1}, {"Item3",1}, {"Item4",1}, {"Item5",1}, {"Item6",1}, }, } I also tried to get a random item with the help of this string, but gives me an error that string. Please help, thanks in advance с: itemTable["Loot"][1][math.random(1,#itemTable["Loot"])] --or itemTable["Loot"][math.random(1,#itemTable["Loot"])]
  11. Problem solved! It was necessary to use: toJSON and fromJSON.
  12. You offered me some other option, but with Google translator translation I do not understand. I need my version and how I can save.
  13. Good day guys. I had a no problem, but rather a question. I've been working with Lua, but with a not yet encountered. Does not work saving a date element if its value is worth in braces "{}" That's actually made ​​an example for you to understand: --"elementData" value is {2,0.1,0.3,0.8,0.9} -- -- --EXAMPLE: setElementData(source,"elementData",{2,0.1,0.3,0.8,0.9}) playerData = {{"elementData"}} addEventHandler("onPlayerLogin",root,function() account = getPlayerAccount(source) for i,data in ipairs(playerData) do setElementData(source,data[1],getAccountData(account,data[1])) end end) addEventHandler("onPlayerQuit",root,function() local account = getPlayerAccount(source) if account then for i,data in ipairs(playerData) do setAccountData(account,data[1],getElementData(source,data[1])) end end end) And once again I went to the server, the value of a elementData is not available, it just is not saved. Debug shows that the value of an elementData has not been determined. So it has not been preserved. What to do? .
  14. How can I use the banPlayer on the client side? How do I express triggerServerEvent? server side: addEvent("banPlayer", true) addEventHandler("banPlayer", getRootElement(), function(ban) if (type(ban) == "player") then banPlayer(client, ban) end end) Then in client side i use client side: triggerServerEvent("banPlayer", getLocalPlayer(), getLocalPlayer())
  15. There was an unknown error to me. I have no idea what's going on ... Client.lua: Server.lua: At the command prompt on my server says: Acces denied @ "kickPlayer" ps. Do not pay attention to the incomplete code on the picture, I took the new variables and syntax observed.
  16. Did not help. Now even the kick does not work
  17. I've got one more question. How can I cancel a kick-timer, pressing the button? kickme = guiCreateButton(0.2, 0.52, 0.15, 0.05, "kick me", true) cancel = guiCreateButton(0.2, 0.60, 0.15, 0.05, "cancel", true) kickTimer = setTimer(function() triggerServerEvent("kickPlayer", getLocalPlayer()) end, 5000, 1) addEventHandler("onClientGUIClick", getRootElement(), function() if (source == kickme) then if isTimer(kickTimer) then resetTimer(kickTimer) end elseif (source == cancel) then if isTimer(kickTimer) then killTimer(kickTimer) end end end) The problem is that I was kicked from server without pressing any buttons. Also, the cancel button kick-timer is not running. Help.
  18. Thanks, did not notice. Just tested, it is still not working.
  19. How can i use function kickPlayer in client side for my GUI? I have code, but it don`t work! Help. server side: addEvent("kikcPlayer", true) addEventHandler("kikcPlayer", getRootElement(), function(kicked) if (type(kicked) == "player") then kickPlayer(client, kicked) end end) Then in client side i use client side: triggerServerEvent("kickPlayer", getLocalPlayer(), getLocalPlayer())
  20. iPanda

    Cry Slothbot

    Your suggestion does not work. More precisely zombies constantly cry 6 times without stopping. Here is the complete code: function botCry() local number = math.random(1,6) local sound = playSound3D("sounds/cry"..tostring(number)..".wav",pedX,pedY,pedZ,false) setSoundMaxDistance(sound, 20) end addEventHandler("onBotSpawned",getRootElement(),botCry)
  21. iPanda

    Cry Slothbot

    Hello everyone, I have a problem with the sound of my ped (slothbot). Total, 6 bots available sounds (randomly determined). Bots cry 1 time every 8 seconds. My mistake: boats scream all 6 sounds at once, every second. Help. local number = math.random(1,6) local sound = playSound3D("sounds/cry"..number..".wav",pedX,pedY,pedZ,false) setSoundMaxDistance(sound, 20)
  22. iPanda

    What is wrong?

    Thank you for help. But now there is a new bug.
  23. I create bots. Not to write a lot of code, I took the variable "i", but for some reason does not work. The following error occurred. local sniper = {} addEventHandler("onResourceStart", resourceRoot, function() local sniper[1] = exports.slothbot:spawnBot( myX, myY, myZ, 0, 286, 0, 0, nil, 33, "guarding", true ) local sniper[2] = exports.slothbot:spawnBot( myX, myY, myZ, 0, 286, 0, 0, nil, 33, "guarding", true ) local sniper[3] = exports.slothbot:spawnBot( myX, myY, myZ, 0, 286, 0, 0, nil, 33, "guarding", true ) local sniper[4] = exports.slothbot:spawnBot( myX, myY, myZ, 0, 286, 0, 0, nil, 33, "guarding", true ) for i=1,4 do setElementHealth( sniper[i], 100 ) end end)
  24. iPanda

    Help fix bugs

    Unfortunately I do not speak English. I live in Russia and I use a translator
×
×
  • Create New...