Jump to content

Citizen

Moderators
  • Posts

    1,803
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by Citizen

  1. It's a good idea only for specific markers. But here it's obviously for an undefined amount of generic markers. You won't set a unique id to each marker you will create for each house. That's why I did it this way. And mostly because he wanted to know in wich marker the player was in to then get its element data(s). My system prevent you to loop into all makers or all ids to check if the localPlayer is in the marker.
  2. Citizen

    dx panel

    put this at line 121: panel.detailFunction = drawHomeDetails
  3. Citizen

    dx panel

    Try this (fill the function at the top to draw the right part of your panel: function drawHomeDetails() -- draw dxDrawText("This is the home detail content.", 660, 317, 887, 405, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, true, false, false) end function drawPlayerDetails() -- draw dxDrawText("This is the player detail content.", 660, 317, 887, 405, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, true, false, false) end function drawWeaponDetails() -- draw dxDrawText("This is the weapon detail content.", 660, 317, 887, 405, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, true, false, false) end function drawVehicleDetails() -- draw dxDrawText("This is the vehicle detail content.", 660, 317, 887, 405, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, true, false, false) end function drawBindsDetails() -- draw dxDrawText("This is the binds detail content.", 660, 317, 887, 405, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, true, false, false) end local panel = { btn = {}, detailFunction = drawHomeDetails } function drawPanel() dxDrawRectangle(491, 297, 497, 263, tocolor(23, 23, 23, 255), true) dxDrawRectangle(481, 279, 517, 28, tocolor(55, 55, 55, 255), true) dxDrawText("Player", 487, 350, 622, 383, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "center", "top", false, false, true, false, false) dxDrawText("Weapon", 487, 383, 622, 416, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "center", "top", false, false, true, false, false) dxDrawText("Vehicle", 487, 416, 622, 449, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "center", "top", false, false, true, false, false) dxDrawText("Home", 487, 317, 622, 350, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "center", "top", false, false, true, false, false) dxDrawText("X", 968, 279, 998, 305, tocolor(255, 255, 255, 255), 2.00, "default-bold", "center", "top", false, false, true, false, false) dxDrawText("X", 481, 279, 511, 305, tocolor(255, 255, 255, 255), 2.00, "default-bold", "center", "top", false, false, true, false, false) dxDrawText("Binds", 487, 482, 622, 515, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "center", "top", false, false, true, false, false) if detailFunction and type(detailFunction) == "function" then detailFunction() -- draw the right part the panel end end function onPanelHomeButtonClicked( btn, state ) if btn ~= "left" or state ~= "up" then return end -- do some extra stuff if needed detailFunction = drawHomeDetails end function onPanelPlayerButtonClicked( btn, state ) if btn ~= "left" or state ~= "up" then return end -- do some extra stuff if needed detailFunction = drawPlayerDetails end function onPanelWeaponButtonClicked( btn, state ) if btn ~= "left" or state ~= "up" then return end -- do some extra stuff if needed detailFunction = drawWeaponDetails end function onPanelVehicleButtonClicked( btn, state ) if btn ~= "left" or state ~= "up" then return end -- do some extra stuff if needed detailFunction = drawVehicleDetails end function onPanelBindsButtonClicked( btn, state ) if btn ~= "left" or state ~= "up" then return end -- do some extra stuff if needed detailFunction = drawBindsDetails end panel.btn.home = guiCreateButton(487, 317, 135, 33, "", false) guiSetAlpha(panel.btn.home, 0) guiSetVisible(panel.btn.home, false) addEventHandler("onClientGUIClick", panel.btn.home, onPanelHomeButtonClicked, false) panel.btn.vehicle = guiCreateButton(487, 416, 135, 33, "", false) guiSetAlpha(panel.btn.vehicle, 0) guiSetVisible(panel.btn.vehicle, false) addEventHandler("onClientGUIClick", panel.btn.vehicle, onPanelVehicleButtonClicked, false) panel.btn.weapon = guiCreateButton(487, 383, 135, 33, "", false) guiSetAlpha(panel.btn.weapon, 0) guiSetVisible(panel.btn.weapon, false) addEventHandler("onClientGUIClick", panel.btn.weapon, onPanelWeaponButtonClicked, false) panel.btn.player = guiCreateButton(487, 350, 135, 33, "", false) guiSetAlpha(panel.btn.player, 0) guiSetVisible(panel.btn.player, false) addEventHandler("onClientGUIClick", panel.btn.player, onPanelPlayerButtonClicked, false) panel.btn.binds = guiCreateButton(487, 482, 135, 33, "", false) guiSetAlpha(panel.btn.binds, 0) guiSetVisible(panel.btn.binds, false) addEventHandler("onClientGUIClick", panel.btn.binds, onPanelBindsButtonClicked, false) local drawingPanel = false function togglePanel() if not drawingPanel then showPanel() drawingPanel = true else hidePanel() drawingPanel = false end end addCommandHandler("panel", togglePanel, false, false) function guiPanelBtnSetVisible( bool ) guiSetVisible(panel.btn.home, bool) guiSetVisible(panel.btn.player, bool) guiSetVisible(panel.btn.weapon, bool) guiSetVisible(panel.btn.vehicle, bool) guiSetVisible(panel.btn.binds, bool) end function showPanel() addEventHandler("onClientPreRender", root, drawPanel) showCursor(true) guiPanelBtnSetVisible(true) end function hidePanel() removeEventHandler("onClientPreRender", root, drawPanel) showCursor(false) guiPanelBtnSetVisible(false) end
  4. Not really, you created them in the server side okay but they also exists (and accessible) from the client side. Put this wherever you want in the client side: local inHouseMarker = nil addEventHandler("onClientMarkerHit", root, function ( player ) if getElementType(player) ~= "player" then return end if getElementData(source, "isHouseMarker") then inHouseMarker = source end end) addEventHandler("onClientMarkerLeave", root, function ( player ) if getElementType(player) ~= "player" then return end if getElementData(source, "isHouseMarker") then inHouseMarker = nil end end) --[[ Desc: Get house marker in which the player is. return: The marker element if the player is currently in one of them, nil otherwise. ]] function getCurrentHouseMarker() return inHouseMarker end Set the element data "isHouseMarker" to true on the server side for all the house markers you create: setElementData(theMarker, "isHouseMarker", true) And then use this function on the client side: local houseMarker = getCurrentHouseMarker() It will return the house marker in which the player is currently in. But please check if houseMarker is not equal to nil (it will return nil if you called that function while the player is not in any house marker). Once you got it and you checked it's not equal to nil, you can call your getElementData on that returned marker to get the element data you set on the server side.
  5. Yeah get the marker in which the player is currently in, then try to get that data from it.
  6. Citizen

    Tables

    table.insert(resources, {name=getResourceName(resource), state=getResourceState(resource)}) So you can do it like this: server: function resources() local resources = {} local res = getResources() for k, resource in ipairs(res) do if getResourceInfo(resource, "type") ~= "map" then table.insert(resources, {name=getResourceName(resource), state=getResourceState(resource)}) end triggerClientEvent("ResourcesTable", root, resources) end end client: local serverResources = {} function ress( resources ) serverResources = resources for k, resource in ipairs(serverResources) do outputChatBox( "Name: "..resource.name..", State: "..tostring(resource.state) ) end end addEvent("ResourcesTable", true) addEventHandler("ResourcesTable", root, ress)
  7. Toujours 60 triggers mais toutes les 5 secondes cette fois-ci (et toujours sur la base de 20 joueurs). En terme de temps d'éxecution les triggers font partis des fonctions les plus gourmandes. Si tu avais compris ma proposition d'amélioration comme il faut, tu aurais dû te retrouver avec ceci: Pull request: https://github.com/PicardRemi/mdayz-anticheat/pull/1
  8. Citizen

    Question

    So the server has to be perfect at public release and should never be updated ... Great idea yeah
  9. Here is an example: server: addEvent("onGetPlayerOriginalXResponse") function s_getPlayerOriginalX( response ) if not response then triggerClientEvent(player, "onGetPlayerOriginalXRequest", player) else -- do something with the response: outputChatBox("The PlayerOriginalX is: "..response) end end addEventHandler("onGetPlayerOriginalXResponse", root, s_getPlayerOriginalX) client: addEvent("onGetPlayerOriginalXRequest", true) function c_getPlayerOriginalX() local response = 2 triggerClientEvent("onGetPlayerOriginalXResponse", localPlayer, 2) end addEventHandler("onGetPlayerOriginalXRequest", root, c_getPlayerOriginalX) The s_getPlayerOriginalX cannot return anything. It only cans do stuff for you with the response. I don't know what you are trying to do, but according to your event name (getPlayerOriginalX) it looks like you are trying to get a position that is stored in the client-side. If it's what you are trying to do, please use element datas instead ! In short, element datas are like variables stored in a player element and automatically synced with bot sides (client and server sides): client: -- Your code that set the original position variables: local originalPosition = {X=10, Y=20, Z=30} -- Store it in the player element (the local player here) setElementData(localPlayer, "originalPosition", originalPosition) -- This data is automatically synced with the server side in background server: function printMyOriginalPosition() local originalPosition = getElementData(thePlayer, "originalPosition") if originalPosition then local x, y, z = originalPosition.X, originalPosition.Y, originalPosition.Z outputChatBox("My original position is: "..x..", "..y..", "..z, thePlayer) else outputChatBox("Your originalPosition data has not been set yet !", thePlayer) end end addCommandHandler("originalpos", printMyOriginalPosition)
  10. What are you talking about ?! guieditor DOES support dx gui creation ... https://community.multitheftauto.com/in ... ils&id=141
  11. A part le fait que cet "anti-dépassement" soit vraiment basique, pourquoi avoir fait 3 timers qui vont faire un trigger toutes les secondes alors que faire un seul timer qui va appeler une fonction qui elle appellera tes 3 fonctions de check serait 10x (nombre pris au hasard) plus performant ! Trouves tu ça normal de générer 60 triggers par secondes si tu as 20 joueurs sur ton serveur ?! (3 triggers x 20 joueurs). C'est déjà énorme alors imagine en comptant aussi ceux générer par le mod de base (que je ne connais pas, faudrait regarder le code ou utiliser le panel web de performance des ressources) Alors qu'avec le système que je viens de t'exposer, le script va générer non pas 60 triggers par secondes mais 0 ! Tu ne te retrouveras plus qu'avec un script côté serveur. J'y connais rien en cheat sur MTA mais si un joueur cheat ça vie pour être toujours à 12000 ou légèrement inférieur, ton checkHealth devient totalement inefficace contre ce joueur.
  12. Citizen

    Tables

    No you didn't, he wanted to get the list of the resources which aren't of type maps on the client side. Your code does nothing more that looping your hardcoded table. I fixed his code (and you didn't) because I get the list of resources, get their name, store them in a table, send that table using triggerClientEvent and then receive that table on the client side. So now he can use serverResources to do a panel an admin panel for example.
  13. Citizen

    Tables

    You didn't understand at all.
  14. Citizen

    Bloq Mays

    And it won't work if the player joins with the capslock already enabled.
  15. Citizen

    Tables

    map is not defined, maybe did you want to write "map" instead ? Also source isn't defined in the code you pasted here. server: function resourcese( thePlayer ) local resources = {} local res = getResources() for k, resource in ipairs(res) do if getResourceInfo(resource, "type") ~= "map" then table.insert(resources, getResourceName(resource)) end -- here it's a good practice to not use getRootElement() as source (avoid it as much as you can) triggerClientEvent(thePlayer, "ResourcesTable", thePlayer, resources) -- idk what was source in your script. end end -- I put the command here and not on the client side so I can know who asked for the list without using an extra triggerServerEvent from the client side addCommandHandler("restest", resourcese) client: local serverResources = {} function ress( resources ) serverResources = resources for k, resource in ipairs(serverResources) do -- why 'ke' ? outputChatBox( resource ) -- no need to add empty strings before and after a string end end addEvent("ResourcesTable", true) addEventHandler("ResourcesTable", root, ress)
  16. And here I come ! Your code was a mess so I just cleaned as much as I wanted (because it's taking a lot of time actually which I don't really have). local x, y = 200, 200 local recx, recy = 300, 200 local recw, rech = 400, 200 local eastype = "Linear" local totallines = 10 local nbToSkip = 0 local playersTable = getElementsByType("player") setTimer(function() playersTable = getElementsByType("player") end, 3000, 0) local selectedPlayer = playersTable[1] local tickk = getTickCount() function performRender() local tick = getTickCount() local endTime = tickk + 500 local laufzeit = tick - tickk local dauer = endTime - tickk local progress = laufzeit/dauer local recintw, recinth, _ = interpolateBetween(x, y, 0, recw, rech, 0, progress, eastype) local recintx, recinty, _ = interpolateBetween(0, 0, 0, recx, recy, 0, progress, eastype) dxDrawRectangle(recintx, recinty, recintw, recinth, tocolor(101, 101, 101, 100), false) dxDrawRectangle(recintx+10, recinty+10, 180, 180, tocolor(50, 50, 50, 200), false) -- Drawing table + row selection local line = 0 for k, player in ipairs (playersTable) do if k > nbToSkip and line < totallines-1 then local nameplayer = getPlayerName(player) if player == selectedPlayer or line == 0 then dxDrawRectangle(recintx+10, recinty+10+line*20, 180, 20, tocolor(15, 192, 252, 80), false) end dxDrawText(nameplayer, recintx+15, recinty+10+line*20, recintx+15+180, recinty+12+line*20+20, tocolor(255,255,255,255), 1, "default-bold", "left", "center", false, false, true, true) line = line + 1 end end -- Drawing details only local nameplayer = getPlayerName(selectedPlayer) or "Undefined" local level = getElementData(selectedPlayer, "Level") or 0 local money = getElementData(selectedPlayer, "Money") or 0 local country = getElementData(selectedPlayer, "Country") or "N/A" local state = getElementData(selectedPlayer, "Status") or "N/A" local playerX, playerY, playerZ = getElementPosition( selectedPlayer ) local zone = getZoneName( playerX, playerY, playerZ ) dxDrawText(nameplayer, recintx+200, (recinty+10), x, y, tocolor(255, 255, 255, 255), 2, "default", "left", "top", false, false, true, true) dxDrawText("Level: "..level, recintx+200, (recinty+40), x, y, tocolor(255, 255, 255, 255), 1, "default-bold", "left", "top", false, false, true, false) dxDrawText("Money: "..money,recintx+200, (recinty+60), x, y, tocolor(255, 255, 255, 255), 1, "default-bold", "left", "top", false, false, true, false) dxDrawText("Location: "..zone, recintx+200, (recinty+80), x, y, tocolor(255, 255, 255, 255), 1, "default-bold", "left", "top", false, false, true, false) dxDrawText("State: "..state, recintx+200, (recinty+120), x, y, tocolor(255, 255, 255, 255), 1, "default-bold", "left", "top", false, false, true, false) dxDrawText("Country: "..country, recintx+200, (recinty+100), x, y, tocolor(255, 255, 255, 255), 1, "default-bold", "left", "top", false, false, true, false) end -- addEventHandler("onClientRender", root, performRender) function scrolling( _, _, side) outputChatBox(side) if side == "down" then nbToSkip = nbToSkip + 1 elseif side == "up" then nbToSkip = nbToSkip - 1 end if nbToSkip < 0 then nbToSkip = 0 end if nbToSkip >= #playersTable then nbToSkip = #playersTable-1 end selectedPlayer = playersTable[nbToSkip+1] end bindKey("mouse_wheel_up", "down", scrolling, "up") bindKey("mouse_wheel_down", "down", scrolling, "down") It can obviously be improuved but I won't do it. (Or maybe I will but not for free) Also the selected row will always be the 1st one due to the way I'm scrolling the table. If you want this blue rectangle to be scrolled instead of the table, I can do it, just ask. I was alone to test it so I used some tricks to fill that table and the display on the right might have bugs (even if I think it's okay ). I'm waiting for your feedback. (Also feel free to replace the values at the top from line 1 to 5 only)
  17. Hummm if I remember right, MTA supports custom animations using ifp files. By the way they disabled it in the source code because of issues and probably because it makes the server/client unstable. It was exactly the same about setPedWalkingStyle a long time ago. My bro wanted this function which has been disabled. They said that he has to enable that code and compile it himself. It successfully did it so I guess you can do it too.
  18. make sure you have this in the meta of your global resource (the resource name must be "global") <export function="getCityName" type="server"/>
  19. Oui, je t'ai filé un code que tu n'as pas été capable de copier coller comme il faut. Enfait tu n'as même pas copié collé mon code. Et pour ça je ne peux pas t'aider désolé. EDIT: Et je ne sais pas avec quoi tu codes (j'ai un fort soupçon sur wordpad ou notepad) mais quand tu colles ton code, l'indentation est tout simplement dégueulasse. Utilise Notepad++ et utilise des tabulations et non des espaces.
  20. Are you sure? I remember that i was able to trigger onPlayerWasted. But that wasn't using triggerServerEvent but just triggerEvent and the handler was in another resource. You are totally right, I just tried and it does work with triggerEvent but not with triggerClientEvent and triggerServerEvent. From server to client event: From client to server event: Even if I tried to override the remote triggerable info to true by doing an addEvent with true as 2nd argument. So yeah we can trigger built in events but not remotly because they have been created as non remote triggerable.
  21. Parce que t'as copié coller sans faire attention (et du coup ma2med n'a pas relu son script non plus). Dans le script côté serveur, à la ligne 22 il a mit du texte sans le mettre en commentaire, du coup c'est considéré comme du code à exécuter. Donc le script ne se compile pas et donc le fichier entier n'est pas chargé. Deuxième erreur bloquante, coté client cette fois-ci, il manque une parenthèse fermante après lol ligne 23. Donc le script ne se compile pas et donc le fichier entier n'est pas chargé. Donc au final pour le serveur, c'est comme si ces deux fichiers n'existaient pas. Un conseil, quand tu dis qu'un script ne fonctionne pas, ça serait cool (voir obligatoire) de nous donner les erreurs côté serveur (visibles dans la console du serveur et dans /debugscript 3) , mais aussi les erreurs côté client (visible seulement avec /debugscript 3). Après en erreurs de code non bloquant si je puis dire (le script fonctionne mais peu ou aura des problèmes): serveur: - ligne 5, tu donnes au joueur +10 d'xp mais ligne 6 tu lui dis qu'il a gagné seulement 5 d'xp. - ligne 14, la fonction recomp à un paramètre player mais n'est jamais utilisé. ça ne sert donc à rien de le laisser. - ligne 21, la fonction clientResourceStop est attaché à l'event onResourceStop mais cette fonction n'existe tout simplement pas. En plus onClientResourceStop n'existe que du côté client. - ligne 23, tu trigger l'event lol côté client pour tous les joueurs sur le serveur. Là par contre c'est un gros bug car dès que quelqu'un butera un zombie, la barre d'expérience de tous les joueurs vont augmenter. En plus, il est fortement déconseiller d'utiliser getRootElement() en tant que source d'un event car ça va générer un trigger pour tous les éléments du serveur (donc pour tous les objets, véhicules, joueurs, markers etc et même ceux ayant été créé par une autre ressource que celle-ci). Voilà ce qu'il fallait faire: triggerClientEvent ( killer, "lol", killer ) - Et pourquoi as-tu créés deux fonctions pour le même event ? C'est bien de faire ça seulement si les deux codes n'ont rien à voir ensemble mais là y en a une pour donner de l'expérience au killer et une autre pour donner de l'argent et faire avancer la barre d'expérience. Faire une seule fonction pour ça est vraiment approprié ! Passons au client: - ligne 3 (et oui déjà ^^), il n'est pas nécessaire de préciser des arguments optionnels lorsque c'est pour mettre la même chose que la valeur par défaut (je parle du nil) et s'il n'y a pas d'argument optionnel après celle-ci dont tu veux préciser une autre valeur que celle par défaut. (Relis bien cette phrase pour bien visualiser) la ligne 3 peut donc devenir: somebar = guiCreateProgressBar( 0, 0.9, 10, 0.1, true ) - ligne 6: en utilisant getRootElement() une nouvelle barre de progression se créera - ligne 7 à la ligne 10: C'est du gros n'importe quoi !! Lorsque une ressource s'arrête, MTA se charge de détruire tout ce que cette ressource à créé ! En plus tu as mis (et c'est pour ça que c'est vraiment n'importe quoi) getRootElement() qui correspond, je le rappelle, à la racine du système d'élément du serveur (les ressources étant des sous éléments de cette racine et sont les racines des éléments créé par ces ressources). En gros, lorsque qu'un admin arrêtera une ressource (n'importe laquelle) ça détruira la barre d’expérience pour tout le monde. Il fallait donc donner la racine de la ressource actuelle au lieu de la racine du serveur: addEventHandler( "onClientResourceStop", getResourceRootElement(getThisResource()), clientResourceStop ) -- ou (c'est exactement pareil) addEventHandler( "onClientResourceStop", resourceRoot, clientResourceStop ) - ligne 19: Il faut éviter au maximum d'utiliser le getRootElement() comme source d'un trigger pour la même raison énoncée plus haut. Ici il est tout a fait adapté d'utiliser getLocalPlayer() ou localPlayer (c'est la même chose): triggerServerEvent( "recomp", localPlayer ) J'espère que vous avez tout lu parce que sinon vous allez faire les même erreurs qui va se terminer par un serveur avec des bugs et des lags. Pour finir, voici ma version basée sur celle de ma2med: Serverrecomp)[/lua] local XP_REWARD = 10 -- +10 d'XP par zombie local CASH_REWARD = 100 -- +100$ par zombie local LVL_REWARD = 10000 -- +10 000$ par level function rewardOnWasted(killer) local exp = tonumber(getElementData(killer,"exp")) or 0 local newXP = exp + XP_REWARD setElementData(killer, "exp", newXP) outputChatBox("Tu gagnes "..XP_REWARD.." d'experience et "..CASH_REWARD.."$! (Total: "..newXP.." XP)", killer, 0, 200, 0) givePlayerMoney(killer, CASH_REWARD) triggerClientEvent(killer, "onZombieDied", killer) end addEvent("onZombieWasted",true) addEventHandler("onZombieWasted", root, rewardOnWasted) function recomp() givePlayerMoney(client, CASH_REWARD) outputChatBox("Tu gagnes 10 000$ !", client, 0, 200, 0) end addEvent("recomp",true) addEventHandler("recomp", root, recomp) Client: -- faire de expbar une local permet d'eviter un eventuel remplacement -- si cette même variable et utilisé ailleurs pour autre chose local expbar = nil local PROGRESS_REWARD = 2 -- progression en % de la barre function clientResourceStart( ) expbar = guiCreateProgressBar( 0, 0.9, 10, 0.1, true) end addEventHandler( "onClientResourceStart", resourceRoot, clientResourceStart) function addProgression() if expbar then local newProgress = guiProgressBarGetProgress(expbar) + PROGRESS_REWARD if newProgress >= 100 then newProgress = 0 triggerServerEvent("recomp", localPlayer) end guiProgressBarSetProgress(expbar, newProgress) setElementData(localPlayer, "expProgress", newProgress) --pour peut être enregistrer en db après end end addEvent("onZombieDied", true) addEventHandler("onZombieDied", root, addProgression) Je fait pas souvent de grand post comme celui-ci, alors merci de tout lire par respect du travail effectué.
  22. This function takes two arguments (the second one isn't optional at all !) + every other engineLoadDFF you made put 0 as second argument. Do the same for this skin too and it will work. (Also, use [ lua][/lua] tags to paste code instead of [ code][/code]. For xml use: [ code=xml][/code])
  23. Citizen

    Trigger

    If your meta is ok, then the trigger is working, it's not because the 2 elements you are trying to destroy aren't destroyed than the trigger is obviously not working. server function wyjdz(player, seat, jacked) if getElementData(source, "komb") == true then outputChatBox("Vehicle is a 'komb'") -- debugging destroyElement(source) triggerClientEvent(player, "koniecc", player) else outputChatBox("Vehicle is not a 'komb'") -- debugging end end addEventHandler("onVehicleExit", root wyjdz) client: addEvent ("koniecc", true) addEventHandler ("koniecc", root, function () setElementData(localPlayer, "wyjazd", false) setElementData(localPlayer, "1-19", false) setElementData(localPlayer, "2-19", false) setElementData(localPlayer, "3-19", false) setElementData(localPlayer, "4-19", false) setElementData(localPlayer, "5-19", false) setElementData(localPlayer, "6-19", false) setElementData(localPlayer, "7-19", false) setElementData(localPlayer, "8-19", false) setElementData(localPlayer, "9-19", false) setElementData(localPlayer, "10-19", false) setElementData(localPlayer, "11-19", false) setElementData(localPlayer, "12-19", false) setElementData(localPlayer, "13-19", false) setElementData(localPlayer, "14-19", false) setElementData(localPlayer, "15-19", false) setElementData(localPlayer, "16-19", false) setElementData(localPlayer, "17-19", false) setElementData(localPlayer, "18-19", false) setElementData(localPlayer, "19-19", false) if not destroyElement( niewidok2 ) then outputChatBox("Failed to destroy 'niewidok2'") -- debugging else outputChatBox("Successfully destroyed 'niewidok2'") -- debugging end if not destroyElement( niewidok3 ) then outputChatBox("Failed to destroy 'niewidok3'") -- debugging else outputChatBox("Successfully destroyed 'niewidok2'") -- debugging end end) Also loops are your friends ! client: addEvent ("koniecc", true) addEventHandler ("koniecc", root, function () setElementData(localPlayer, "wyjazd", false) for k = 1, 19 do setElementData(localPlayer, k.."-19", false) end if not destroyElement( niewidok2 ) then outputChatBox("Failed to destroy 'niewidok2'") -- debugging else outputChatBox("Successfully destroyed 'niewidok2'") -- debugging end if not destroyElement( niewidok3 ) then outputChatBox("Failed to destroy 'niewidok3'") -- debugging else outputChatBox("Successfully destroyed 'niewidok2'") -- debugging end end) What about [ lua] [/lua] ? (without spaces ofc)
×
×
  • Create New...