Ah okay, dachte immer die Variable wäre denn auch in anderen Resourcen verfügbar.
Danke für die schnelle Hilfe
Beiträge von Riptentacion
-
-
-
Ich glaube der Link ist down
Magst du den nochmal aktualisieren ?
Ich erreiche die Website nämlich nicht. -
Versteh die negative Kritik hier nicht recht, aber jedem das seine.
Ich bin nicht aktiv in Samp aber, finde trotzdem das es eine gute Idee ist.
Das Design ist zwar "langweilig" aber das macht das ganze übersichtlich.
Und das macht das ganze Design wieder schön und angenehm.
Im großen und ganzen kann man sagen es ist was Schönes.
Deswegen wünsche ich euch viel Erfolg und Glück -
Ja ich habe es gerade selber bemerkt.
Ich kann nicht glauben das ich so blöd bin
Naja trotzdem vielen dank, und tut mir leid für die Umstände! -
Ich habe mein AtmScript wiedergefunden.
Also wie gesagt, es tut mir leid wenn ich das echt nicht verstehe, ich gebe mein bestes auch wenn das nicht viel sein mag.Lua: server
Alles anzeigenatm1 = createObject(2942, 1649.8000488281, -1656.0999755859, 22.200000762939) addEventHandler("onElementClicked", getRootElement(), function(cursorButton, buttonState, playerWhoClicked) local accountWhoClicked = getPlayerAccount(playerWhoClicked) local isGuestAccountWhoClicked = isGuestAccount(accountWhoClicked) if not isGuestAccountWhoClicked then if cursorButton == "left" then if getElementModel(source) == 2942 then local accountname = getPlayerAccount(playerWhoClicked) local kontostand = getAccountData(accountname, "kontostand") if kontostand == false then setAccountData(getPlayerAccount(playerWhoClicked), "kontostand", "0") end triggerClientEvent(playerWhoClicked, "onAtmClicked", getRootElement(), kontostand) end end end end) addEvent("abhebenEinzahlen", true) addEventHandler("abhebenEinzahlen", getRootElement(), function(wvGeld, whichButton) local accountname = getPlayerAccount(source) local kontostand = getAccountData(accountname, "kontostand") local pMoney = getPlayerMoney(source) if whichButton == 1 then if tonumber(wvGeld) <= tonumber(kontostand) then local newKontostand = kontostand - wvGeld setAccountData(accountname, "kontostand", newKontostand ) givePlayerMoney(source, wvGeld) triggerClientEvent("refreshKontostand", getRootElement(), newKontostand) end else if tonumber(wvGeld) <= pMoney then local newKontostand = kontostand + wvGeld setAccountData(accountname, "kontostand", newKontostand ) takePlayerMoney(source, wvGeld) triggerClientEvent("refreshKontostand", getRootElement(), newKontostand) end end end) addEvent("ueberweisen", true) addEventHandler("ueberweisen", getRootElement(), function(wvGeld, username) local pnameAccount = getPlayerAccount(source) local usernameAccount = getPlayerAccount(getPlayerFromName(username)) local pnameKontostand = getAccountData(pnameAccount, "kontostand") local usernameKontostand = getAccountData(usernameAccount, "kontostand") local pnameNewKontostand = pnameKontostand - wvGeld local usernameNewKontostand = usernameKontostand + wvGeld local isGood = setAccountData(usernameAccount, "kontostand", tostring(usernameNewKontostand)) if isGood then outputChatBox("Überweisung erfolgreich!", source, 0, 255, 0) setAccountData(pnameAccount, "kontostand", tostring(pnameNewKontostand)) local newKontostand = pnameNewKontostand triggerClientEvent("refreshKontostand", getRootElement(), newKontostand) else outputChatBox("Überweisung fehlgeschlagen!", source, 255, 0, 0) end end)
Lua: client
Alles anzeigenatm = { tab = {}, staticimage = {}, tabpanel = {}, edit = {}, button = {}, window = {}, label = {} } function openAtmGui(kontostand) local pname = getPlayerName(localPlayer) removeEventHandler("onAtmClicked", localPlayer, openAtmGui) atm.window[1] = guiCreateWindow(585, 361, 359, 274, "ATM made by Riptentacion [X]", false) guiWindowSetSizable(atm.window[1], false) atm.label[1] = guiCreateLabel(10, 24, 94, 37, "Kontoinhaber:", false, atm.window[1]) guiLabelSetVerticalAlign(atm.label[1], "center") atm.label[2] = guiCreateLabel(104, 24, 245, 37, tostring(pname), false, atm.window[1]) guiLabelSetVerticalAlign(atm.label[2], "center") atm.label[3] = guiCreateLabel(10, 61, 94, 37, "Kontostand:", false, atm.window[1]) guiLabelSetVerticalAlign(atm.label[3], "center") atm.label[4] = guiCreateLabel(104, 61, 245, 37, tostring(kontostand), false, atm.window[1]) guiLabelSetVerticalAlign(atm.label[4], "center") atm.tabpanel[1] = guiCreateTabPanel(12, 108, 337, 156, false, atm.window[1]) atm.tab[1] = guiCreateTab("Abheben", atm.tabpanel[1]) atm.staticimage[1] = guiCreateStaticImage(12, 11, 315, 41, ":atm/image.png", false, atm.tab[1]) atm.button[1] = guiCreateButton(12, 93, 315, 29, "Enter", false, atm.tab[1]) atm.edit[1] = guiCreateEdit(15, 62, 312, 21, "Wie viel wollen sie abheben ?", false, atm.tab[1]) atm.tab[2] = guiCreateTab("Einzahlen", atm.tabpanel[1]) atm.staticimage[2] = guiCreateStaticImage(10, 10, 317, 43, ":atm/image.png", false, atm.tab[2]) atm.button[2] = guiCreateButton(19, 98, 298, 24, "Enter", false, atm.tab[2]) atm.edit[2] = guiCreateEdit(19, 64, 298, 24, "Wie viel wollen sie Einzahlen?", false, atm.tab[2]) atm.tab[3] = guiCreateTab("Überweisen", atm.tabpanel[1]) atm.staticimage[3] = guiCreateStaticImage(12, 10, 315, 45, ":atm/image.png", false, atm.tab[3]) atm.edit[3] = guiCreateEdit(14, 62, 222, 26, "An wem soll das Geld gehen ?", false, atm.tab[3]) atm.edit[4] = guiCreateEdit(14, 96, 222, 26, "Wie viel wollen sie Überweisen?", false, atm.tab[3]) atm.button[3] = guiCreateButton(246, 64, 71, 58, "Enter", false, atm.tab[3]) addEventHandler("onClientGUIClick", atm.window[1], function() guiSetVisible(atm.window[1], false) addEventHandler("onAtmClicked", localPlayer, openAtmGui) end, false) addEventHandler("onClientGUIClick", atm.button[1], function() local wvGeld = guiGetText(atm.edit[1]) local whichButton = 1 triggerServerEvent("abhebenEinzahlen", localPlayer, wvGeld, whichButton) end, false) addEventHandler("onClientGUIClick", atm.button[2], function() local wvGeld = guiGetText(atm.edit[2]) local whichButton = 2 triggerServerEvent("abhebenEinzahlen", localPlayer, wvGeld, whichButton) end, false) addEventHandler("onClientGUIClick", atm.button[3], function() local username = guiGetText(atm.edit[3]) local wvGeld = guiGetText(atm.edit[4]) triggerServerEvent("ueberweisen", localPlayer, wvGeld, username) end, false) end addEvent("refreshKontostand", true) addEventHandler("refreshKontostand", localPlayer, function(newKontostand) guiSetText(atm.label[4], tostring(newKontostand)) end) addEvent("onAtmClicked", true) addEventHandler("onAtmClicked", localPlayer, openAtmGui)
-
Nein das erste Argument bei triggerClientEvent ist nicht nil, das habe ich mit outputChatBox überprüft es ist das PlayerElement von demjenigen der den Command benutzt hat.
Und ich glaube du verstehst mich falsch das Problem ist nicht irgendein Script es ist ein Fehler den ich immer und immer wieder mache und bei dem ich nicht begreife wie ich diesen umgehe.
Und ich hab auch kein Script.
Ich nenne einfach mal ein weiteres Bsp.
Weil ich das Gefühl habe ich werde missverstanden, tut mir leid wenn das nicht der Fall ist.
Also ich habe ein LoginPanel welches nach dem Login geschlossen wird.
Spieler1 und 2 joinen dem Server und wollen sich einloggen.
Spieler1 ist schneller als Spieler2.
Das Loginfenster schließt sich für beide, obwohl Spieler2 noch gar nicht eingeloggt ist.
Währendessen kann Spieler1 draus los spielen, und Spieler2 sitzt mit nem Blackscreen das weil er sich nicht einloggen konnte da das Fenster vorher verschwunden ist. -
Mhm das oben genannte Atm-System war nur ein Bsp.
Ich habe das Script nicht mehr, deswegen hab ich schnell was leichtes und ähnliches gemacht.
Und ich weiß nicht ob ich dich falsch verstehe oder einfach zu dumm dafür bin aber playerSource ist doch im diesen fall nicht nil, es ist das Player-Element welches den Command ausgeführt hat oder nicht ? -
Also ich glaube hier hätte ich das Problem aber ich weiß es nicht, habe keinen zweiten Spieler.
Lua: test_client.lua
Alles anzeigentest = { label = {}, window = {} } addEvent("openGui",true) addEventHandler("openGui", getRootElement(), function(testPlayerMoney) showCursor(true) test.window[1] = guiCreateWindow(814, 368, 258, 189, "Kontostand", false) guiWindowSetSizable(test.window[1], false) test.label[1] = guiCreateLabel(21, 54, 220, 89, "0", false, test.window[1]) guiSetFont(test.label[1], "sa-header") guiLabelSetHorizontalAlign(test.label[1], "center", false) guiLabelSetVerticalAlign(test.label[1], "center") addEventHandler("onClientGUIClick", test.window[1], function() guiSetVisible(test.window[1], false) showCursor(false) end) guiSetText(test.label[1], testPlayerMoney) end )
-
Also ich habe schon seit einiger Zeit das Problem dass, wenn ich z.B ein Atm-System mache wo man seinen Kontostand sehen kann, und 2 Spieler dieses Atm Gui geöffnet haben, und ein Spieler was einzahlt oder abhebt.
Denn soll ja der Kontostand aktualisiert werden und auf den richtigen wert gebracht werden.
Aber bei mir ist es immer so das sich nun der Kontostand(Wert) für beide Spieler ändert
Also Spieler 1 hat 100$ und Spieler 2 hat 200$ wenn jetzt beide das Gui geöffnet haben und Spieler 1, 100$ abhebt, hat Spieler 1 einen Kontostand von 0$ aber jetzt das Problem Spieler 2 hat nun ebenfalls 0$ bis er das Gui schließt und wieder öffnet denn hat er wieder 200$.Also ich hoffe das reicht, hab versucht mein Problem so genau wie möglich zu schildern aber das ist schwer zu erklären.
Wenn nicht versuch ich es mit Code und Bildern.
Also wäre wie immer dankbar für Hilfe! -
Keine Ahnung, kannst ja nochmal auf anderen Auflösungen probieren.
Glaube zwar nicht das dass was bringt aber man kann es ja mal probieren. -
Hast du schonmal versucht gta_vc.set oder gta3.set zu löschen ? Findest du unter Dokumente\GTA User Files oder so
Und was für eine Auflösung hast du ? -
ne klappt nicht
könntest du vll deinen GTA Ordner wo hochladen dann könnte ich mir den runterladen und einfach benutzen
Google einfach, bekommst du überall hinterher geschmissen.
-
Ok ich krieg es nicht zum laufen
Wäre sehr dankbar für ein bisschen hilfeLog file
Alles anzeigen[2018-06-27 00:15:12] ERROR: bl\weather.lua:59: attempt to index global 'gameplayVariables' (a nil value) [2018-06-27 00:15:18] ERROR: bl\zombies.lua:67: attempt to index global 'gameplayVariables' (a nil value) [2018-06-27 00:15:24] ERROR: bl\survivorSystem.lua:602: attempt to index global 'gameplayVariables' (a nil value) [2018-06-27 00:15:24] ERROR: bl\survivorSystem.lua:635: attempt to index global 'gameplayVariables' (a nil value) [2018-06-27 00:16:12] ERROR: bl\zombies.lua:67: attempt to index global 'gameplayVariables' (a nil value) [2018-06-27 00:16:12] ERROR: bl\survivorSystem.lua:613: attempt to index global 'gameplayVariables' (a nil value) [2018-06-27 00:16:12] ERROR: bl\survivorSystem.lua:623: attempt to index global 'gameplayVariables' (a nil value) [2018-06-27 00:16:12] ERROR: bl\weather.lua:59: attempt to index global 'gameplayVariables' (a nil value) [2018-06-27 00:16:14] ERROR: bl\survivorSystem.lua:602: attempt to index global 'gameplayVariables' (a nil value) [2018-06-27 00:16:14] ERROR: bl\survivorSystem.lua:635: attempt to index global 'gameplayVariables' (a nil value) [2018-06-27 00:16:18] ERROR: bl\zombies.lua:67: attempt to index global 'gameplayVariables' (a nil value) [2018-06-27 00:16:24] ERROR: bl\survivorSystem.lua:602: attempt to index global 'gameplayVariables' (a nil value) [2018-06-27 00:16:24] ERROR: bl\survivorSystem.lua:635: attempt to index global 'gameplayVariables' (a nil value) [2018-06-27 00:16:30] ERROR: bl\zombies.lua:67: attempt to index global 'gameplayVariables' (a nil value) [2018-06-27 00:16:34] ERROR: bl\survivorSystem.lua:602: attempt to index global 'gameplayVariables' (a nil value) [2018-06-27 00:16:39] ERROR: bl\survivorSystem.lua:635: attempt to index global 'gameplayVariables' (a nil value) [2018-06-27 00:16:39] ERROR: bl\zombies.lua:67: attempt to index global 'gameplayVariables' (a nil value) [2018-06-27 00:16:39] ERROR: bl\zombies.lua:67: attempt to index global 'gameplayVariables' (a nil value) [2018-06-27 00:16:45] ERROR: bl\zombies.lua:67: attempt to index global 'gameplayVariables' (a nil value) [2018-06-27 00:16:45] ERROR: bl\zombies.lua:67: attempt to index global 'gameplayVariables' (a nil value) [2018-06-27 00:16:50] ERROR: bl\zombies.lua:67: attempt to index global 'gameplayVariables' (a nil value) [2018-06-27 00:16:51] ERROR: bl\zombies.lua:67: attempt to index global 'gameplayVariables' (a nil value) [2018-06-27 00:16:57] ERROR: bl\zombies.lua:67: attempt to index global 'gameplayVariables' (a nil value) [2018-06-27 00:17:04] ERROR: bl\survivorSystem.lua:602: attempt to index global 'gameplayVariables' (a nil value) [2018-06-27 00:17:04] ERROR: bl\survivorSystem.lua:635: attempt to index global 'gameplayVariables' (a nil value) [2018-06-27 00:17:09] ERROR: bl\zombies.lua:67: attempt to index global 'gameplayVariables' (a nil value) [2018-06-27 00:17:12] ERROR: bl\survivorSystem.lua:613: attempt to index global 'gameplayVariables' (a nil value) [2018-06-27 00:17:12] ERROR: bl\survivorSystem.lua:623: attempt to index global 'gameplayVariables' (a nil value) [2018-06-27 00:17:12] ERROR: bl\weather.lua:59: attempt to index global 'gameplayVariables' (a nil value)
Ein kleiner ausschnitt aus dem Log, das geht noch ewig so weiter.Lua
Alles anzeigen--Server outputs shownInfos = {} shownInfos["nomag"] = "You got no magazine for this weapon" shownInfos["youconsumed"] = "You have consumed" shownInfos["needwatersource"] = "You need to be in a water source" shownInfos["filledup"] = "You filled your Water Bottle up." shownInfos["noradio"] = "You got no Radio Device." --Spawnpoints pickupPositions = { ["industrial"] = { {2776.3916015625,-2445.9912109375,13.63644695282}, {2776.302734375,-2465.4873046875,13.636467933655}, {2794.921875,-2483.4482421875,13.641567230225}, {2776.123046875,-2504.1513671875,13.633953094482}, {2743.7646484375,-2452.8408203125,13.86225605011}, {2799.1015625,-2393.4853515625,13.95600605011}, {-2457.4091796875,777.58203125,35.171875}, {2776.4013671875,-2408.6435546875,13.648777008057}, {2786.978515625,-2428.1826171875,13.633860588074}, {2505.9169921875,-2454.0302734375,17.882808685303}, {2513.732421875,-2417.6318359375,17.882808685303}, {2430.7978515625,-2467.2958984375,13.632326126099},
Und noch von der server_editor.lua
-
Ok danke, nun klappt alles
Ich hab mich ein bissl dumm angestellt
Aber wie sagt man so schön, Übung macht den Meister. -
Erstmal danke für die schnellen Antworten,
Ich versteh nicht recht wie ich die vehID jetzt zum Server bekomme.Lua: client
Alles anzeigenWangP = { button = {}, window = {}, staticimage = {}, label = {} } marker = createMarker(-1965.5999755859, 294, 36, "arrow", 1) addEventHandler("onClientMarkerHit", marker, function(hitPlayer) setCameraMatrix(-1980.4368896484, 284.56866455078, 40.451221466064, -1880.8718261719, 285.27215576172, 31.161264419556, 0, 70) showCursor(true, true) WangP.window[1] = guiCreateWindow(751, 381, 372, 242, "Wang Cars Autoshop", false) guiWindowSetMovable(WangP.window[1], false) guiWindowSetSizable(WangP.window[1], false) WangP.label[1] = guiCreateLabel(10, 23, 352, 66, "Wang Cars", false, WangP.window[1]) guiSetFont(WangP.label[1], "sa-header") guiLabelSetHorizontalAlign(WangP.label[1], "center", false) guiLabelSetVerticalAlign(WangP.label[1], "center") WangP.button[1] = guiCreateButton(11, 99, 351, 47, "Infernus[120.000$]", false, WangP.window[1]) WangP.button[2] = guiCreateButton(10, 156, 351, 47, "Turismo[80.000$]", false, WangP.window[1]) WangP.button[4] = guiCreateButton(10, 213, 126, 19, "Kaufen", false, WangP.window[1]) WangP.button[3] = guiCreateButton(340, 213, 21, 19, "X", false, WangP.window[1]) addEventHandler("onClientGUIClick", WangP.button[1], function() local vehid = 411 setCameraMatrix(-1963.3782958984, 301.40698242188, 38.273052215576, -1876.7384033203, 267.29428100586, 1.8058335781097, 0, 70) return vehid end) addEventHandler("onClientGUIClick", WangP.button[2], function() local vehid = 451 setCameraMatrix(-1963.0208740234, 271.21255493164, 38.81908416748, -1876.2165527344, 278.47732543945, -10.29545879364, 0, 70) return vehid end) addEventHandler("onClientGUIClick", WangP.button[3], function() showCursor(false, false) guiSetVisible(WangP.window[1], false) setCameraTarget(localPlayer) end) addEventHandler("onClientGUIClick", WangP.button[4], function() triggerServerEvent("buyCar", localPlayer, vehid) end) end)
@Bonus Debugscript 3 benutze ich, aber mir wurden keine Fehler ausgegeben.
-
Ich habe mich an einem Script versucht bei dem man Autos im Wang Cars kaufen kann mit Gui aber irgendwie, geht alles bis auf dem Kauf am ende.
Nun wollte ich euch nach Rat fragen, aber seht selbstLua: client.lua
Alles anzeigenWangP = { button = {}, window = {}, staticimage = {}, label = {} } marker = createMarker(-1965.5999755859, 294, 36, "arrow", 1) addEventHandler("onClientMarkerHit", marker, function(hitPlayer) setCameraMatrix(-1980.4368896484, 284.56866455078, 40.451221466064, -1880.8718261719, 285.27215576172, 31.161264419556, 0, 70) showCursor(true, true) WangP.window[1] = guiCreateWindow(751, 381, 372, 242, "Wang Cars Autoshop", false) guiWindowSetMovable(WangP.window[1], false) guiWindowSetSizable(WangP.window[1], false) WangP.label[1] = guiCreateLabel(10, 23, 352, 66, "Wang Cars", false, WangP.window[1]) guiSetFont(WangP.label[1], "sa-header") guiLabelSetHorizontalAlign(WangP.label[1], "center", false) guiLabelSetVerticalAlign(WangP.label[1], "center") WangP.button[1] = guiCreateButton(11, 99, 351, 47, "Infernus[120.000$]", false, WangP.window[1]) WangP.button[2] = guiCreateButton(10, 156, 351, 47, "Turismo[80.000$]", false, WangP.window[1]) WangP.button[4] = guiCreateButton(10, 213, 126, 19, "Kaufen", false, WangP.window[1]) WangP.button[3] = guiCreateButton(340, 213, 21, 19, "X", false, WangP.window[1]) addEventHandler("onClientGUIClick", WangP.button[1], function() setElementData(localPlayer, "wang.matrix", infernus) setCameraMatrix(-1963.3782958984, 301.40698242188, 38.273052215576, -1876.7384033203, 267.29428100586, 1.8058335781097, 0, 70) end) addEventHandler("onClientGUIClick", WangP.button[2], function() setElementData(localPlayer, "wang.matrix", turismo) setCameraMatrix(-1963.0208740234, 271.21255493164, 38.81908416748, -1876.2165527344, 278.47732543945, -10.29545879364, 0, 70) end) addEventHandler("onClientGUIClick", WangP.button[3], function() showCursor(false, false) guiSetVisible(WangP.window[1], false) setCameraTarget(localPlayer) end) addEventHandler("onClientGUIClick", WangP.button[4], function() local playerWangMatrix = getElementData(localPlayer, "wang.matrix") if playerWangMatrix == "infernus" then outputChatBox("infernus") triggerServerEvent("buyInfernus", localPlayer, localPlayer) elseif playerWangMatrix == "turismo" then triggerServerEvent("buyTurismo", localPlayer, localPlayer) else return false end end) end)
Lua: server.lua
Alles anzeigeninfernus = createVehicle(411, -1956.8000488281, 298.60000610352, 35.099998474121, 0, 0, 130, "Wang Cars") turismo = createVehicle(451, -1956.4000244141, 271.20001220703, 35.299999237061, 0, 0, 40, "Wang Cars") setVehicleDamageProof(infernus, true) setVehicleDamageProof(turismo, true) setVehicleLocked(infernus, true) setVehicleLocked(turismo, true) addEvent("buyInfernus") addEventHandler("buyInfernus", getRootElement(), function(localPlayer) local playerMoney = getPlayerMoney(localPlayer) if playerMoney >= 120000 then local infernus = createVehicle(411, -1927.8000488281, 270.29998779297, 41, 0, 0, 180) warpPedIntoVehicle(localPlayer, infernus) setPlayerMoney(localPlayer, playerMoney-120000) else outputChatBox("Du hast nicht genug Geld!", localPlayer, 255, 0, 0) end end) addEvent("buyTurismo") addEventHandler("buyTurismo", getRootElement(), function(localPlayer) local playerMoney = getPlayerMoney(localPlayer) if playerMoney >= 80000 then local turismo = createVehicle(451, -1927.8000488281, 270.29998779297, 41, 0, 0, 180) warpPedIntoVehicle(localPlayer, turismo) setPlayerMoney(localPlayer, playerMoney-80000) else outputChatBox("Du hast nicht genug Geld!", localPlayer, 255, 0, 0) end end)
Ps: Ich hab ziemlich wenig Erfahrung im scripten also seid mir nicht Böse