-
Posts
246 -
Joined
-
Last visited
-
Days Won
6
Everything posted by XaskeL
-
function getCoordsSize(x,y,sx,sy) local data = {} if x > sx then data["max_x"] = x; data["min_x"] = sx; else data["max_x"] = sx; data["min_x"] = x; end if y > sy then data["max_y"] = y; data["min_y"] = sy; else data["max_y"] = sy; data["min_y"] = y; end return data["min_x"], data["min_y"], data["max_x"]-data["min_x"], data["max_y"]-data["min_y"] end function isElementInGameZone(element, areax, areay, sizex, sizey, maxz) local x,y,z = getElementPosition(element) local _,_, rotation = getElementRotation(element) local offset = math.rad(rotation + 90) local aX = x + (-0.3) * math.cos(offset) local aY = y + (-0.3) * math.sin(offset) if (x >= areax and x <= areax + sizex ) and ( y >= areay and y <= areay + sizey ) then setElementPosition(aX, aY, z + 0.1, false) -- borders elseif (maxz and z > maxz) then setElementPosition(x,y, maxz - 3, false) end end The functions are written which can be useful for this. I am not very good at math, so maybe something is wrong local g_GameZones = { { startx = 0, starty = 0, endx = 5, endy = 5, maxz = 30 }, } addEventHandler('onClientResourceStart', resourceRoot, function() for i, v in ipairs(g_GameZones) do local areax, areay, sizex, sizey = getCoordsSize(v.startx, v.starty, v.endx, v.endy) g_GameZones[i] = { startx = areax, starty = areay, endx = sizex, endy = sizey, maxz = v.maxz }; end end ); addEventHandler('onClientRender', root, function() local gZone = g_GameZones[1] -- zone id 1 isElementInGameZone(localPlayer, gZone.startx, gZone.starty, gZone.endx, gZone.endy, gZone.maxz) -- soft teleport end ); try
-
maybe the partition is not created for this I just write Launcher for the MTA server and I need ways to get the number of players on the server, the server name and so on from the launcher without a WEB server that I would send JSON which I should parse.
-
E7CC7EE9AF46CE1D847EB024A35E1F71 I already wrote ccw to this effect and that I am ready to provide all workable and compiled source codes. in exchange for the fact that the ban will be at least temporary
-
texture gTex0; technique { pass p0 { Texture[0] = gTex0; } } local texture = dxCreateTexture("path", "dxt3") local shader = dxCreateShader("path") dxSetShaderValue(shader, "gTex0", texture) destroyElement(texture) engineApplyShaderToWorldTexture(shader, "textureName") Sorry, I write from phone.
-
Выкрути ползунки звука на максимум и нажми ок, во время игры на сервере. Если не помогло, то перезайди в мта, выкрути в ноль и зайди на сервер а там в максимум и нажми ок. Должно помочь. Иногда на звуки в 0 идут звуки игры, пока настройки не откроешь
-
Блокировка за нагрузку на хостинг? Это вам к рухосту! Блокировка сервера за то что его ддосят? Это вам к рухосту! и прочие не приятные вещи были в мта и в сампе, так что заслужено. Был ещё случай с вашим кхм-кхм менеджером главным Екатериной, ух, веселые были времена! Сампик!
-
Help. What is it? Because of what may be crashes? One thing unites them all - MTA version 16350.8.005
-
I need to understand how to calculate the turn of the blip around the radar, as well as its position to the center of the radar
-
help me find blip coordinates on frames ex, ey this blip position 142 distance from center in radar to the brink of radar local camx,camy,_ = getElementPosition(camera) local ex,ey = 1164.468, -948.094 local t = -math.deg(math.atan2(camx - ex, camy - ey)) local r = t < 0 and t + 360 or t local movx = (math.sin(camrot-r) * 142) local movy = (math.cos(camrot-r) * 142) dxDrawImage(centerx + movx - 12, centery + movy - 12, 24, 24, 'images/icons/4.png', 0, 0, 0, white, false) Screen I absolutely do not understand math, so I hope that someone will help.
-
Help. Enough me bandiwdth ("250 Mbps bandwidth (burst 1GB) unlimited") on my server in mta? Average online 280-350-500 peoples online. I will transfering files from extrenal hosting. OVH Dedicate Server. CPU: Intel I7-4790K - 4c/8t - 4GHz /4.4GHz RAM: 16GB DDR3 1600 MHz
-
Да, но в таблице ключей больше, а условие проверки нарушено: У тебя скролл зависел от <= 7 а скорее всего должно было быть => 7 Так что проблема явно, не в событии onClientKey и bindKey как решение
-
myImage = guiCreateStaticImage(100, 100, 100, 100, "skin1.png", false) addEventHandler("onClientGUIClick", myImage, function() local txd = engineLoadTXD("skin1.txd") -- correct your path to model! (txd) engineImportTXD(txd,411) -- local dff = engineLoadDFF("skin1.dff",411) -- correct your path to model! (dff) engineReplaceModel(dff,411) end,false ); A script is a sequence of actions. Like in a movie. "The player pressed the picture -> a function has been called that has a body of actions -> replaces the model of the machine (ID 411) -> the event ends.
-
local policeVehicles = { {597, -1594.15295, 674.24622, 7.18750, 92.063659667969}, } function mashinPolice (thePlayer, seat, jacked) if not getElementData (thePlayer, "faction") == Police and getElementModel(source) == "policeVehicles" then cancelEvent() outputChatBox ( "#ffff00your not in police department faction", player,255,255,255,true) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), mashinPolice ) My code: local policeVehicles = { {597, -1594.15295, 674.24622, 7.18750, 92.063659667969}, } local isVehiclePolice = {} for i, v in ipairs(policeVehicles) do isVehiclePolice[ v[1] ] = true; end addEventHandler('onVehicleStartEnter', root, function(player, seat, jacked, door) if seat ~= 0 then return false end local model = getElementModel(source) if isVehiclePolice[model] and not getElementData(player, "faction") == Police then -- variable 'Police' is defined? outputChatBox("#ffff00your not in police department faction",player,255,255,255,true) cancelEvent() end end ); -- or not then if isVehiclePolice[model] and not getElementData(player, "faction") == Police then -- faction? replace to 'fraction' -- Police? replace to "Police" -- EXAMPLE: if isVehiclePolice[model] and not getElementData(player, "fraction") == "Police" then
-
<right name="command.logout" access="false"></right> <right name="command.register" access="false"></right> <right name="command.login" access="false"></right> <right name="command.chgmypass" access="false"></right> <acl name="Everyone"> <right name="command.logout" access="false"></right> <right name="command.register" access="false"></right> <right name="command.login" access="false"></right> <right name="command.chgmypass" access="false"></right> </acl>
-
base64Decode(teaEncode(...)) it's so easy?
-
addEventHandler('onPlayerJoin', getRootElement(), functon() fadeCamera(source,true) end ); должно помочь в server.lua (serverside)
-
I wanted to do it. I'll try later but still, I'm waiting for a mathematical way
-
5$, very userful soft Encryption models, shaders, images
-
I need to calculate the velocity of the projectile, along the axes, so that it flies where I need it. Manually defined; start point: pos vehicle, the end point is indicated by the player on the map