Rat32
Members-
Posts
121 -
Joined
-
Last visited
Everything posted by Rat32
-
Why it doesn't work? function infomech(hitElement, matchingDimension) if source == hitElement then triggerClientEvent(hitElement, "mechinfo", resourceRoot) outputChatBox("NO!") end end addEventHandler("onMarkerHit", mechpraca, infomech)
-
local chatRadius = 50 function sendMessageToNearbyPlayers ( message, messageType ) if ( messageType == 0 ) then local posX, posY, posZ = getElementPosition ( source ) local chatSphere = createColSphere ( posX, posY, posZ, chatRadius ) local nearbyPlayers = getElementsWithinColShape ( chatSphere, "player" ) destroyElement ( chatSphere ) for index, nearbyPlayer in ipairs( nearbyPlayers ) do local red, green, blue = getPlayerNametagColor ( source ) outputChatBox( getPlayerName ( source )..": #ffffff".. message, nearbyPlayer, red, green, blue, true ) end cancelEvent ( ) end end addEventHandler ( "onPlayerChat", getRootElement(), sendMessageToNearbyPlayers ) addEventHandler ( "onPlayerChat", getRootElement(), function ( message, messageType ) if messageType == 1 then cancelEvent() end end) Why this doesn't work? Sends a double message, does not close the event.
-
Hello. This is my script: function spawnOnLogin() setTimer(function() spawnPlayer (source, 2034.17883, -1403.27026, 17.28900) end, 4000, 1) end addEventHandler("onPlayerWasted", getRootElement(), spawnOnLogin) What this doesn't work? DEBUGSCRIPT: bad argument @ spawnPlayer, argument 1 - got nil.
-
Whats. I have a script that when you press the button, we spawn a vehicle. But I have a hard problem. I want to do so that when you press it a second time that vehicle exhausts with "destroyElement". But unfortunately removes ALL players then these vehicles and do not know what to do. Please help, I greet .
-
Work, very thanks .
-
Not work. Debugscript: "bad argument @ "addEventHandler" [Expected at argument 2, got nil]. //Gunmarker is on the function up
-
Hi. I have a problem with a permanent marker. Calls the function after EVERY marker upon entry, and I would like to invoke only one. Please help and possibly explain my mistake . MARKER: gunmarker = createMarker(1914.39136, -1870.26575, 12.56373, "cylinder", 0.5, 100) FUNCTION: function dealGUND(thePlayer, gunmarker) outputChatBox("Dealer: Yo, what you need, bro?") gun = false guiSetVisible(oknodila, true) showCursor(true) end addEventHandler("onClientMarkerHit", getRootElement(), dealGUND) All in clientside. PS. sorry for my bad English, I'm from Poland .
-
area = createRadarArea ( 2150.32666, -1393.43091, 45.61223, -40, 0, 0, 0, 175 ) areacol = createColRectangle (2177.8818, -1391.3579, 73.828125, 84.75, 114.5, 2) area2 = createRadarArea ( 2058.73267, -1211.01526, 23.98452, -40, 0, 0, 0, 175) area2col = createColRectangle (2082.4915, -1206.2887, 86.5, 95, 114.5, 2) setRadarAreaSize ( area, 100, 100 ) setRadarAreaSize ( area2, 100, 100 ) function wejscie(client, thePlayer) local playerTeam = getPlayerTeam(thePlayer) local r,g,b = getTeamColor(playerTeam) triggerClientEvent(thePlayer, "nwejscie", thePlayer) if (getElementType(thePlayer) == "player") then setRadarAreaFlashing ( area, true ) timer = setTimer(function(thePlayer) setRadarAreaColor ( area, r, g, b, 175 ) end, 15000, 1) end end addEventHandler("onColShapeHit", areacol, wejscie) function wyjscie(thePlayer) if (getElementType(thePlayer) == "player") then setRadarAreaFlashing ( area, false ) killTimer (timer) end end addEventHandler("onColShapeLeave", areacol, wyjscie)
-
Thanks . I have next problem! function wejscie(client, thePlayer) local playerTeam = getPlayerTeam(thePlayer) local r,g,b = getTeamColor(playerTeam) triggerClientEvent(root, "nwejscie", client) if (getElementType(thePlayer) == "player") then setRadarAreaFlashing ( area, true ) timer = setTimer(function(thePlayer) setRadarAreaColor ( area, r, g, b, 175 ) end, 15000, 1) end end addEventHandler("onColShapeHit", areacol, wejscie) This code triggered to all players, but i i want trigger to source. How?
-
Hello. I have a problem. This script give me a weapon, ok - but he doesn't check a money, please help. CLIENT: function glock19a() triggerServerEvent("glock19e", resourceRoot) end addEventHandler("onClientGUIClick", p2, glock19a, false) SERVER: addEvent("glock19e", true) function glock19() outputChatBox(money) local money = getPlayerMoney(client) if money <= 2 then giveWeapon( client, 22, 1, true) outputChatBox(money) else outputChatBox(money) end end addEventHandler("glock19e", getRootElement(), glock19)
-
Now work. Very thanks
-
Work, but does not create the explosion in front of me, but somewhere on the diagonal, ie, do not read this rotation.
-
And now don't work script. "attempt to perform arithmetic on local "meters" (a string value)
-
function funkcja(element, meters) local x,y,z = getElementPosition(element) local _, _, rotation = getElementRotation(element) x = x - math.sin(math.rad(rotation)) * meters y = y + math.cos(math.rad(rotation)) * meters return x, y, z createExplosion(x + 10, y, z, 6) end addCommandHandler("tak", funkcja) This is the edited code. But not work, "attempt to close function at line 1", but is closed
-
Hello everyone! . I making script to create explosion in front of player. But i have a problem. This is creating explosion excluding the rotation. Please help. function test(player) e = player x,y,z=getElementPosition(e) createExplosion(x + 1, y, z, 6) end addCommandHandler("tak", test)
-
Hey! I have a problem with script. This script shows the GUI for all and I want to single player showed. What is wrong? . This is just a sample script. CLIENTSIDE: addEvent("okno", true) GUIEditor = { button = {}, window = {}, label = {} } GUIEditor.window[1] = guiCreateWindow(487, 295, 417, 123, "JOB / PRACA", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.label[1] = guiCreateLabel(75, 23, 293, 16, "Czy chcesz pracować jako pracownik urzędu?", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[1], "default-bold-small") GUIEditor.label[2] = guiCreateLabel(71, 49, 293, 16, "Do you want to work as an employee of the office?", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[2], "default-bold-small") tak = guiCreateButton(9, 74, 111, 39, "YES / TAK", false, GUIEditor.window[1]) GUIEditor.button[2] = guiCreateButton(296, 75, 111, 38, "NO / NIE", false, GUIEditor.window[1]) guiSetVisible(GUIEditor.window[1], false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1], false) function otworzgui() guiSetVisible(GUIEditor.window[1], true) showCursor(true) end addEventHandler("okno", getRootElement(), otworzgui) function zgoda() blip = createBlip(1487.96643, -1727.90002, 13.38281, 6) end SERVERSIDE: markerpracy = createMarker(1486.27441, -1738.05640, 13.54688, "cylinder", 1) function guji() triggerClientEvent("okno", source) end addEventHandler("onMarkerHit", markerpracy, guji)
-
Heelo. I have a script from vehicles XML from MTA:WIKI. But... this is not working. AUTO.LUA: local xml = getResourceConfig("settings.xml") -- load XML file and get its root element local carmodel = xmlNodeGetAttribute(xml, "model") -- get attribute of root element local carX = xmlNodeGetAttribute(xml, "posX") local carY = xmlNodeGetAttribute(xml, "posY") local carZ = xmlNodeGetAttribute(xml, "posZ") local carA = xmlNodeGetAttribute(xml, "rot") createVehicle(carmodel, tonumber(carX), tonumber(carY), tonumber(carZ), 0.0, 0.0, tonumber(carA)) META.XML: SETTINGS.XML: "Manana" posX="1803" posY="1905" posZ="13" rot="90.0" /> Please help
-
Hello. At the start, I would like to point out that I am Polish and I have very poor English, so I use google translate. I wanted to see how the hack "JELLY" but so tiring that as many of you - this team MTA got banned. I'm very sorry and I really regret it, I have a server where I really have to be, otherwise it can be a very big problem. This is my first offense, and the ban passes me only for 5 days. Regards. Serial: 7C1F7DF814B98CA5508838D171872454
