Search the Community

Showing results for tags 'help'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • Open Source Contributors
    • Suggestions
  • General MTA
    • News
    • Media
    • Site/Forum/IRC/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • community.mtasa.com
    • Scripting
    • Maps
    • Resources
    • Other Creations
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash
  • Private Bugtracker

Found 180 results

  1. السلام عليكم ورحمة الله وبركاتة | كيف حال الشباب ان شاء الله بخير انا اليوم وانا عادل على مودات لاحظت زر لا هو اكس دي ولا ايش مدري ما له صورة ولا شي كنت بدي اغير مكانو بس ما عرفت ممكن مساعدة اكواد الزر التي تم ايجادها local MainMenu = { {"Go",true,255,255,255}, {"Kill",false,255,255,255}, } لو تشرحولي وش نوع الزر ذا وتشرحولي كيف التعديل عليه وألخ .. بكون ممتن لكم كثيررر ارجو الرد السريع
  2. Hello everyone, I've been scouring the gta forum links but unfortunately I could not find this farce. What is my problem? Well my problem is that I already learned to do basically everything but my interior gets extremely dark in the game. Explanation I use Google SketchUp to draw and texturize my models .. then expropt like 3ds. So I get to use 3ds max to get my dff file and col. And I use G-TXD to get my txd. And then I create the script to replace (replaceModel) and there I go in the game and everything works correctly but it is not clear Print
  3. Hey, MTA forum. I just started playing MTA:SA again on my new PC. When I joined a race, one map loaded where i could see nothing but purple fog. I assumed it was just part of the map or perhaps that one was bugged. No other maps had that problem. Later, I joined a freeroam server. There were no issues. I left that one for the default MTA:SA server. It was fine for a few minutes, and then suddenly, everything is covered in dark green fog. What the hell? I don't see anyone complaining, so I assume it's only on my end. Anyone ever have this problem? If so, know how to fix it? Ty! <3
  4. Hello there Humans , a week or 2 ago i downloaded a resource from the resource community (https://community.multitheftauto.com/index.php?p=resources), And it's a Groundpickups resource, it was outdated, like bugs appeared when i started using it and testing it, i thought by myself, let's fix these render bugs and outdated functions, alright, about 1 week later i got it fixed, i uploaded it to the resource community, BAM.. no problem!.. But like an hour or 2 later, ccw (an administrator) suspended it, while it's nearly the same piece of code like as that of GroundPickups, and i look'd at the reason why it got suspended, well.. 'CallServerFunction' was that reason why it got suspended!. And then i thought by myself, well.. if this is insecure against hackers and such, then why is the original GroundPickups not suspended (i send a message about it to ccw, he suspended it now). But, now the following thing is, i now want to secure the 'callServerFunction', But i don't even know and never used this type of function's before, so now to anyone who wil help me out, thanks for the help, Now the script itself, i've try'ed some stuff and to merge the example's of 'callServerFunction' into the groundpickups script, but without success >.< (There's 1 Export in the meta.xml, just for the info it's: <export function = "createGroundWeapon" type = "server" /> ) So this is the script right before i started trying to add a secure method for this function: client.lua (Client-Side Script): screenWidth, screenHeight = guiGetScreenSize() -- Get the screen resolution shrifteg = (0.015 * screenHeight) / 9 localPlayer = getLocalPlayer() currentGround = nil elementgg = {} gta4markers = true weaponmarkercolors = { [0] = {255,255,255}, [1] = {100,100,255}, [2] = {0,230,0}, [3] = {0,150,0}, [4] = {255,255,0}, [5] = {255,204,0}, [6] = {150,0,150}, [7] = {255,0,255}, [8] = {0,0,255}, [9] = {204,255,255}, [10] = {255,100,100}, [11] = {255,255,255}, [12] = {255,255,255} } slots = { [1] = 0, [2] = 1,[3] = 1,[4] = 1,[5] = 1,[6] = 1,[7] = 1,[8] = 1,[9] = 1, [24] = 2,[23] = 2,[22] = 2, [25] = 3,[26] = 3,[27] = 3, [29] = 4,[32] = 4,[28] = 4, [30] = 5,[31] = 5, [33] = 6,[34] = 6, [35] = 7,[36] = 7,[37] = 7,[38] = 7, [16] = 8,[17] = 8,[18] = 8,[39] = 8, [41] = 9,[42] = 9,[43] = 9, [10] = 10,[11] = 10,[12] = 10,[13] = 10,[14] = 10,[15] = 10, [44] = 11,[45] = 11,[46] = 11, [40] = 12 } weaponsIDS = { --0 [1] = 331, --1 [2] = 333, [3] = 334, [4] = 335, [5] = 336, [6] = 337, [7] = 338, [8] = 339, [9] = 341, --2 [22] = 346, [23] = 347, [24] = 348, --3 [25] = 349, [26] = 350, [27] = 351, --4 [28] = 352, [29] = 353, [32] = 372, --5 [30] = 355, [31] = 356, --6 [33] = 357, [34] = 358, --7 [35] = 359, [36] = 360, [37] = 361, [38] = 362, --8 [16] = 342, [17] = 343, [18] = 344, [39] = 363, --9 [41] = 365, [42] = 366, [43] = 367, --10 [10] = 321, [11] = 322, [12] = 323, [13] = 324, [14] = 325, [15] = 326, --11 [44] = 368, [45] = 369, [46] = 371, --12 [40] = 364 } function client_createGroundWeapon(groundweapon) if(elementgg[groundweapon] == nil) then local temp = createColSphere(tonumber(getElementData(groundweapon, "posX")),tonumber(getElementData(groundweapon, "posY")),tonumber(getElementData(groundweapon, "posZ"))+0.5, 1) --[[local temp = createColCuboid(tonumber(getElementData(groundweapon, "posX"))-0.5, tonumber(getElementData(groundweapon, "posY"))-0.5, tonumber(getElementData(groundweapon, "posZ"))-1, 1,1,2)]] setElementData(temp, "colshape.groundweapon", groundweapon) setElementData(temp, "colshape.weaponid", tonumber(getElementData(groundweapon, "weaponid"))) setElementData(temp, "colshape.ammo", tonumber(getElementData(groundweapon, "ammo"))) setElementData(temp, "colshape.clip", tonumber(getElementData(groundweapon, "clip"))) elementgg[groundweapon] = temp local slot = slots[tonumber(getElementData(groundweapon, "weaponid"))] --createObject local object = createObject(weaponsIDS[tonumber(getElementData(groundweapon, "weaponid"))], tonumber(getElementData(groundweapon, "posX")),tonumber(getElementData(groundweapon, "posY")),tonumber(getElementData(groundweapon, "posZ")), tonumber(getElementData(groundweapon, "rotX")),tonumber(getElementData(groundweapon, "rotY")),tonumber(getElementData(groundweapon, "rotZ"))) setObjectStatic(object, true) setElementCollisionsEnabled(object, false) setElementInterior(object, tonumber(getElementData(groundweapon, "interior"))) setElementDimension(object, tonumber(getElementData(groundweapon, "dimension"))) setElementData(temp, "colshape.object", object) --createMarker local marker = createMarker(tonumber(getElementData(groundweapon, "posX")), tonumber(getElementData(groundweapon, "posY")), tonumber(getElementData(groundweapon, "posZ"))+0.05, "corona", 0.5, weaponmarkercolors[slot][1],weaponmarkercolors[slot][2], weaponmarkercolors[slot][3], 20) setElementInterior(marker, tonumber(getElementData(groundweapon, "interior"))) setElementDimension(marker, tonumber(getElementData(groundweapon, "dimension"))) setElementData(temp, "colshape.marker", marker) local x,y,z = getElementPosition(localPlayer) if(getDistanceBetweenPoints2D(x,y,tonumber(getElementData(groundweapon, "posX")),tonumber(getElementData(groundweapon, "posY"))) < 0.25) then local_activate(temp, localPlayer,true) end end end function client_destroyGroundWeapon(groundweapon) local col = elementgg[groundweapon] local object = getElementData(col, "colshape.object") local marker = getElementData(col, "colshape.marker") if(isElement(object)) then destroyElement(object) end if(isElement(marker)) then destroyElement(marker) end if(isElement(col)) then destroyElement(col) end elementgg[groundweapon] = nil end function pickupCurrentWeapon() if(isElement(currentGround)) then local weaponid = getElementData(currentGround, "colshape.weaponid") local ammo = getElementData(currentGround, "colshape.ammo") local clip = getElementData(currentGround, "colshape.clip") if(getPedWeapon(localPlayer, slots[weaponid]) ~= 0) then dropWeapon(slots[weaponid]) end if(ammo) then local groundweapon = getElementData(currentGround, "colshape.groundweapon") callServerFunction("destroyElement", groundweapon) callServerFunction("giveWeapon", localPlayer, weaponid, ammo, true) callServerFunction("setWeaponAmmo", localPlayer, weaponid, ammo, clip) for i,p in ipairs(getElementsByType("colshape")) do if(isElementWithinColShape(localPlayer, p) == true) then local_activate(p, localPlayer,true) else if( not isElementWithinColShape(localPlayer, p) ) then break end end end end end end function dropWeapon(slot) if(slot > 0) then local weaponid = getPedWeapon(localPlayer, slot) if(weaponid ~= 0) then callServerFunction("takeWeapon", localPlayer, weaponid) local x,y,z = getElementPosition(localPlayer) local hit, hitX, hitY, hitZ, as = processLineOfSight(x, y, z, x, y, -3000, true, false, false, true, false, false, false, false) if(hit) then z = hitZ else z = z - 0.95 end callServerFunction("createGroundWeapon", weaponid, getPedTotalAmmo(localPlayer), getPedAmmoInClip(localPlayer), x,y,z, 97.3,120,math.random(0,359),getElementInterior(localPlayer),getElementDimension(localPlayer)) end end end function local_activate(shape, element,dimension) if(element == localPlayer) then --local groundweapon = getElementData(shape, "colshape.groundweapon") --local object = getElementData(shape, "colshape.object") --local marker = getElementData(shape, "colshape.marker") currentGround = shape end end addEventHandler("onClientResourceStart", getRootElement(), function(startedRes) if(startedRes == getThisResource()) then bindKey("k", "down", "pickup/swap weapon") bindKey("l", "down", "drop weapon") else for i,p in pairs(getElementsByType("groundweapon")) do --getResourceRootElement(startedRes) client_createGroundWeapon(p) end end end ) addEventHandler("onClientResourceStop", getResourceRootElement(), function(startedRes) for i,p in pairs(getElementsByType("groundweapon")) do client_destroyGroundWeapon(p) end end ) addEventHandler("onClientRender", getRootElement(), function() if(isElement(currentGround)) then local weaponid = getElementData(currentGround, "colshape.weaponid") local ammo = getElementData(currentGround, "colshape.ammo") sx,sy = screenWidth/2, screenHeight/2 local str = "false" dxDrawRectangle(sx-80, sy-20, 160, 75, tocolor(0, 0, 0, 128)) if(getPedWeapon(localPlayer, slots[weaponid]) ~= 0) then str = "swap weapons" dxDrawImage(sx-13, sy+13, 26, 26, "img/swap.png") dxDrawImage(sx+20, sy-10, 50, 50, "img/" .. weaponid .. ".png") dxDrawImage(sx-70, sy-10, 50, 50, "img/" .. getPedWeapon(localPlayer, slots[weaponid]) .. ".png") dxDrawText(tostring(ammo), sx+45, sy+45, sx+45, sy+45, tocolor(255,255,255,255), 1, "default-bold", "center", "center") dxDrawText(tostring(getPedTotalAmmo(localPlayer, slots[weaponid])) .. " (you)", sx-45, sy+45, sx-45, sy+45, tocolor(255,255,255,255), 1, "default-bold", "center", "center") else str = "pickup weapon" dxDrawImage(sx-25, sy-10, 50, 50, "img/" .. tonumber(weaponid) .. ".png") dxDrawText(tostring(ammo), sx, sy+45, sx, sy+45, tocolor(255,255,255,255), 1, "default-bold", "center", "center") end dxDrawText("Use 'k' to " .. str, sx, sy-20, sx, sy-20, tocolor(255,255,50,255), 1, "default-bold", "center", "center") end end ) addEventHandler("onClientPlayerWasted", localPlayer, function() dropWeapon(getPedWeaponSlot(localPlayer)) end ) addEventHandler("onClientElementDestroy", getRootElement(), function() if(getElementType(source) == "groundweapon") then client_destroyGroundWeapon(source) end end ) addEventHandler("onClientColShapeHit", getResourceRootElement(), function(element,dimension) local_activate(source, element,dimension) end ) addEventHandler("onClientColShapeLeave", getResourceRootElement(), function(element,dimension) if(element == localPlayer) then currentGround = nil for i,p in ipairs(getElementsByType("colshape")) do if(isElementWithinColShape(localPlayer, p) == true) then local_activate(p, localPlayer,true) else if( not isElementWithinColShape(localPlayer, p) ) then break end end end end end ) addCommandHandler("pickup/swap weapon", function() pickupCurrentWeapon() end) addCommandHandler("drop weapon", function() dropWeapon(slots[getPedWeapon(localPlayer)]) end) function callServerFunction(funcname, ...) local arg = { ... } if (arg[1]) then for key, value in next, arg do if (type(value) == "number") then arg[key] = tostring(value) end end end -- If the serverside event handler is not in the same resource, replace 'resourceRoot' with the appropriate element triggerServerEvent("onClientCallsServerFunction", resourceRoot , funcname, unpack(arg)) end function callClientFunction(funcname, ...) local arg = { ... } if (arg[1]) then for key, value in next, arg do arg[key] = tonumber(value) or value end end loadstring("return "..funcname)()(unpack(arg)) end addEvent("onServerCallsClientFunction", true) addEventHandler("onServerCallsClientFunction", resourceRoot, callClientFunction) server.lua (Server-Side Script): function createGroundWeapon(weaponid, ammo, clip, posX, posY, posZ, rotX, rotY, rotZ, interior, dimension) local temp = createElement("groundweapon") setElementData(temp, "weaponid", weaponid) setElementData(temp, "ammo", ammo) setElementData(temp, "clip", clip) setElementData(temp, "posX", posX) setElementData(temp, "posY", posY) setElementData(temp, "posZ", posZ) setElementData(temp, "rotX", rotX) setElementData(temp, "rotY", rotY) setElementData(temp, "rotZ", rotZ) setElementData(temp, "interior", interior) setElementData(temp, "dimension", dimension) for i,p in ipairs(getElementsByType("player")) do callClientFunction(p, "client_createGroundWeapon", temp) end return temp end addEventHandler("onResourceStop", getResourceRootElement(), function(startedRes) if(startedRes == getThisResource()) then for i,p in pairs(getElementsByType("groundweapon")) do destroyElement(p) end end end ) function callServerFunction(funcname, ...) local arg = { ... } if (arg[1]) then for key, value in next, arg do arg[key] = tonumber(value) or value end end loadstring("return "..funcname)()(unpack(arg)) end addEvent("onClientCallsServerFunction", true) addEventHandler("onClientCallsServerFunction", resourceRoot , callServerFunction) function callClientFunction(client, funcname, ...) local arg = { ... } if (arg[1]) then for key, value in next, arg do if (type(value) == "number") then arg[key] = tostring(value) end end end triggerClientEvent(client, "onServerCallsClientFunction", resourceRoot, funcname, unpack(arg or {})) end Like always, Thanks for any Answers and/or Solutions you people come up with!.. Gr.xboxxxxd EDIT: If you want to, just make it in someway possible to replace all the call function's into events or somthing,
  5. Вообщем суть проблемы в следующем: Машины в гараже не перекрашиваются,стикеры не клеятся. Пробовал разные модели, разбирал Txd файлы, ошибок в дебаге нет. Незнаю уместно ли. Но может кто знает , ктото юзал этот мод. Вообщем интересно будет услышатьрешение проблемы.
  6. Help

    always when im uploading my scripts here https://luac.mtasa.com/ saying to large then error or files cant read
  7. registering proplem

    function registerPlayer(username,password,passwordConfirm) if not (username == "") then if not (password == "") then if not (passwordConfirm == "") then if password == passwordConfirm then local account = getAccount (username,password) if (account == false) then local accountAdded = addAccount(tostring(username),tostring(password)) if (accountAdded) then outputChatBox ("#FF0000* #00FF00You have sucessfuly registered! [Username: #FFFFFF" .. username .. " #00FF00| Password: #FFFFFF" .. password .. "#00FF00 ]",source,255,255,255,true ) else triggerClientEvent(source,"set_warning_text",getRootElement(),"Register","An unknown error has occured! Please choose a different username/password and try again.") end else triggerClientEvent(source,"set_warning_text",getRootElement(),"Register","An account with this username already exists!") end else triggerClientEvent(source,"set_warning_text",getRootElement(),"Register","Passwords do not match!") end else triggerClientEvent(source,"set_warning_text",getRootElement(),"Register","Please confirm your password!") end else triggerClientEvent(source,"set_warning_text",getRootElement(),"Register","Please enter a password!") end else triggerClientEvent(source,"set_warning_text",getRootElement(),"Register","Please enter a username you would like to register with!") end end addEvent("onRequestRegister",true) addEventHandler("onRequestRegister",getRootElement(),registerPlayer) wheni press the register key the debug says that the resource can't add account as in : local accountAdded = addAccount(tostring(username),tostring(password))
  8. Scripting NEED HELP

    Hi Everyone! Can someone help me, how can I make that, if a fire is created it outputs the chatbox the fire's position (example: "The LSPD is on fire" or "The Hospital is on fire" . The Script Files: FireC.lua local fireElement = {} addEvent("FireServer.rootFireCreate",true) addEventHandler("FireServer.rootFireCreate",getRootElement(),function(rand) local fire = createFire(FirePositions[rand][1], FirePositions[rand][2], FirePositions[rand][3], FirePositions[rand][4], FirePositions[rand][5], FirePositions[rand][6]) fireElement[#fireElement + 1] = fire end) addEventHandler ("onClientResourceStart", getRootElement(), function (res) if res ~= getThisResource() then return end triggerServerEvent("FireServer.loadMe", localPlayer, localPlayer) end) function draw() for k,v in ipairs(getElementsByType("object")) do if getElementData(v, "Fire->object") then local x, y ,z = getElementPosition(v) local wx, wy, wz = getScreenFromWorldPosition(x , y, z+1) if wx and wy then local playerx, playery, playerz = getElementPosition(getLocalPlayer()) if getDistanceBetweenPoints3D(playerx, playery, playerz, wx, wy, wz) <= 5 then dxDrawRectangle(wx-200/2,wy,200,30,tocolor(0,0,0,255/2)) dxDrawRectangle(wx-200/2+5,wy+5,190,20,tocolor(124, 197, 118,255/2)) end end end end end addEventHandler("onClientRender", root, draw) FireG.lua FirePositions = { -- X, Y, Z, Range(FireSize) [1] = {2114.1240234375, -1756.2508544922, 13.3984375, 800}, } FireS.lua local loadedPlayers = {} local fireBar = {} FireServer = {} function FireServer.start(player) loadedPlayers[#loadedPlayers + 1] = player end addEvent("FireServer.loadMe", true) addEventHandler("FireServer.loadMe", root, FireServer.start) function FireServer.FireCreate() if math.random(1, 3) == 2 then local rand = math.random(#FirePositions) if fireBar[rand] then return end for k,v in pairs(loadedPlayers) do triggerClientEvent(v, "FireServer.rootFireCreate", v, rand) fireBar[rand] = createObject(1337, FirePositions[rand][1], FirePositions[rand][2], FirePositions[rand][3] - 1) setElementAlpha(fireBar[rand], 0) setElementCollisionsEnabled(fireBar[rand], false) setElementData(fireBar[rand], "Fire->object", true) end end end setTimer(FireServer.FireCreate, 1000, 0)
  9. [HELP]block vehicle.txd

    Hello, i have a question it's possible to block a file "GTA - San Andreas\models\generic\vehicle.txd" ? i want make it to always orginal in my own server.
  10. Click on Object NEED HELP

    Hi everyone! Can someone help me that, if I click on specified object, then run a function named "startit1"
  11. Problem

    Hello. I encountered some problems. I don't know is it bug or what. So first of all about falling and dying. When I jump off the building and my character dies on the ground, it still shows falling animation. Its very annoying. It would be cool if someone make a script that fixes this bug, or maybe an update of Multi Theft Auto. Next one is when I explode helicopter It shows wreck of helicopter - its alright. But when there is inside (entered) player and I explode with a bazooka or any other weapon the helicopter disappears and only shows dead body of the player. So I hope for fix bye
  12. Wasted script

    Can someone help me out with script ? I need script that when my player dies it will show WASTED text like in original GTA san andreas
  13. Just a question

    Hello , I have a question . How to get this coordinates in mta san andreas ? - mx, my, mz, tarx, tary, tarz , rot
  14. Need help,

    Hello , I have quick question. How to add more weapon properties ?? Because when I try to add flag 0x000010 it doesn't work. So how ? addEventHandler("onResourceStart", resourceRoot, -- resourceRoot == the resource that just started (this resource) function () setWeaponProperty("ak-47", "poor", "flags", 0x000020) end)
  15. help

    bindKey("F1", "down", function() if getElementData(localPlayer,"Stats") < 2 and getElementInterior(localPlayer) == 0 and getElementDimension(localPlayer) == 0 then if not isInColExport () then guiSetVisible(Window_VS, not guiGetVisible(Window_VS)) guiSetVisible (Window_CHK, false) showCursor(guiGetVisible(Window_VS)) end end end) triggerServerEvent("onOpenGui", localPlayer) what's the wrong at this script supports English and Arabic help
  16. I need a scripter for my Turkish Roleplay Server project.Req: - Must know UCP scripting.- Must do what I wantContact :Phone : +905386809975Steam : Dr.RushmeSkype : live:emrah_butuk01Instagram : benimadimjesus(I need a webmaster too :P)
  17. I need a scripter for my Turkish Roleplay Server project. Req: - Must know UCP scripting. - Must do what I want Contact : Phone : +905386809975 Steam : Dr.Rushme Skype : live:emrah_butuk01 Instagram : benimadimjesus (I need a webmaster too :P)
  18. i have this code: setTimer(function() local arfolyam = math.random(200,5130) outputChatBox("Jelenlegi árfolyam: "..arfolyam) end, 500, 0) GUIEditor.window[1] = guiCreateWindow(0.35, 0.31, 0.31, 0.28, "Aranykereskedés", true) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.label[1] = guiCreateLabel(0.02, 0.59, 0.95, 0.14, "Az arany jelenlegi árfolyama: "..arfolyam, true, GUIEditor.window[1]) but i get this error in debugscript 3: attempt to concatenate global 'arfolyam' ( a nil value) what wrong? how to fix this?
  19. Map Editor not working properly

    Greetings community, My Map Editor started throw a error in console but when I connect to server it is all loaded up but I am missing that bottom left bar and editor wont load any map so I cant edit map or create new ones. So then I saw error in console "ERROR: edf\edf.lua:220: editor_main: couldn't load edf file" But I dont make changes to edf file... So I dont know why it start throwing that error. Can someone help me with this? Thanks and have a good day or night (Idk what time it is in your country...) :).
  20. i got this error, but the script working fine... -.- bad argument #1 to 'len' (string expected, got boolean) how to fix this? code: function currentSongName() local radio_title = getElementData(resourceRoot, "radio.title") if string.len(radio_title) >= x*0.0625 then radio_title = string.sub(radio_title, 1, 80)..".." end for i, shading in pairs ( offsetShadings ) do dxDrawText("Radio: "..radio_title, xD+shading[1], yD+shading[2], xD, yD+textHeight, tocolor ( 0, 0, 0, 255 ), scale, font, "left", "center", false, false, true, true) end dxDrawText("Radio: #ffffff"..radio_title, xD, yD, xD, yD+textHeight, tocolor ( 70, 215, 0, 255 ), scale, font, "left", "center", false, false, true, true) end addEventHandler('onClientRender', root, currentSongName)
  21. [HELP]Weapon Event

    Is there an event that runs when the player changes weapons or looks like this?
  22. New Weapons

    Does anyone have a script that does this, or do you know how to make these new weapons? If yes please teach me !!
  23. [HELP] a string value

    Hey dear forum users , i got pio's koth map and resource but it doesn't works. Client: -- resource root local resourceRoot = getResourceRootElement() local rootElement = getRootElement() -- variables local KOTHPoints = 0 local screenWidth, screenHeight = guiGetScreenSize() -- function: addKOTHPoint function addKOTHPoint(player) KOTHPoints = KOTHPoints+1 end addEvent("onPlayerScoreKOTHPoint", true) addEventHandler("onPlayerScoreKOTHPoint", resourceRoot, addKOTHPoint) -- displaying player points function displayKOTHPoints() dxDrawText(KOTHPoints, screenWidth*12/13+3, screenHeight*6/7-2, screenWidth*0.99+3, screenHeight, tocolor(0, 0, 0, 255), 4, "arial", "right") dxDrawText(KOTHPoints, screenWidth*12/13, screenHeight*6/7, screenWidth*0.99, screenHeight, tocolor(240, 240, 0, 255), 4, "arial", "right") dxDrawText("Points", screenWidth*12/13+3, screenHeight*6/7+38, screenWidth*0.99+3, screenHeight, tocolor(0, 0, 0, 255), 2.4, "arial", "right") dxDrawText("Points", screenWidth*12/13, screenHeight*6/7+40, screenWidth*0.99, screenHeight, tocolor(240, 240, 0, 255), 2.4, "arial", "right") end addEventHandler("onClientRender", rootElement, displayKOTHPoints) -- remove points display after game addEventHandler("onClientResourceStop", resourceRoot, function() removeEventHandler("onClientRender", rootElement, displayKOTHPoints) end) -- show results at the end function showResults(source, resultTable) local results = 15 if #resultTable < 15 then results = #resultTable end function displayResults() for i=1,results do local text = i.." "..getPlayerName(resultTable[i][1]).." ("..resultTable[i][2].." points)" dxDrawText(text, screenWidth/13+1, screenHeight/4-1+i*17, screenWidth, screenHeight, tocolor(0, 0, 0, 255)) dxDrawText(text, screenWidth/13, screenHeight/4+i*17, screenWidth, screenHeight, tocolor(255, 255, 255, 255)) end end addEventHandler("onClientRender", rootElement, displayResults) setTimer(function() removeEventHandler("onClientRender", rootElement, displayResults) end, 15000, 1) end addEvent("onKOTHEnd", true) addEventHandler("onKOTHEnd", resourceRoot, showResults) Server: local playersAmount = #getDeadPlayers() + #getAlivePlayers() -- settings local pointingTime = (5000/playersAmount)+200*(playersAmount/(playersAmount+21)) local hillPoints = math.floor(playersAmount*1.5) +2 -- resource root local resourceRoot = getResourceRootElement() local rootElement = getRootElement() -- hill element local hills = getElementsByType("hill") -- event: onHillDestroy addEvent("onHillDestroy") addEventHandler("onHillDestroy", resourceRoot, function() hillBlip = getElementData(source, "hillblip") destroyElement(hillBlip) destroyElement(source) end) -- points reset function resetKOTHPoints(player) setElementData(player, "checkpoint", 0) setElementData(player, "race rank", "") end function resetPlayersKOTHPoints() local players = getElementsByType("player") for k, player in ipairs(players) do resetKOTHPoints(player) end end addEventHandler("onResourceStart", resourceRoot, resetPlayersKOTHPoints) addEventHandler("onPlayerJoin", resourceRoot, resetKOTHPoints) -- points granting function startTakingPoints(theElement) if (getElementType(theElement) == "player") then pointingTimer = setTimer(function(source) if (source ~= nil) then if (isElementWithinMarker(theElement, source)) then playerKOTHPoints = getElementData(theElement, "checkpoint") markerPoints = getElementData(source, "checkpoint") setElementData(theElement, "checkpoint", playerKOTHPoints+1) setElementData(source, "checkpoint", markerPoints-1) triggerClientEvent(theElement, "onPlayerScoreKOTHPoint", resourceRoot, theElement) if (markerPoints <= 1) then triggerEvent("onHillDestroy", source) end else if (pointingTimer ~= nil) then killTimer(pointingTimer) end end else killTimer(pointingTimer) end end, pointingTime, hillPoints, source) function stopScoring() if (isTimer(pointingTimer)) then killTimer(pointingTimer) removeEventHandler("onHillDestroy", resourceRoot, stopScoring) end end addEventHandler("onHillDestroy", resourceRoot, stopScoring) end end -- function: createHill function createHill(posX, posY, posZ, size, points) theHill = createMarker(posX, posY, posZ+1, "corona", size, 240, 240, 0) hillBlip = createBlipAttachedTo(theHill, 56) setElementData(theHill, "checkpoint", points) setElementData(theHill, "hillblip", hillBlip) addEventHandler("onMarkerHit", theHill, startTakingPoints) end -- initializing KOTH mode function startKOTH() call(getResourceFromName("Scoreboard"), "scoreboardAddColumn", "checkpoint") function placeNewHill() newHill = hills[math.random(1, table.getn(hills))] local posX = getElementData(newHill, "posX") local posY = getElementData(newHill, "posY") local posZ = getElementData(newHill, "posZ") createHill(posX, posY, posZ, 5, hillPoints) end addEventHandler("onHillDestroy", resourceRoot, placeNewHill) placeNewHill() end addEventHandler("onResourceStart", resourceRoot, startKOTH) -- clearing after the game function removeAnything() --call(getResourceFromName("Scoreboard"), "scoreboardRemoveColumn", "checkpoint") end addEventHandler("onResourceStop", resourceRoot, removeAnything) -- creating a result table function checkForResults() local players = getElementsByType("player") local sorted = {} local i = 1 for k, player in ipairs(players) do local points = getElementData(player, "checkpoint") sorted[i] = {player, points} for j=i-1,1,-1 do if (sorted[i][2] > sorted[j][2]) then sorted[j+1] = sorted[j] sorted[j] = {player, points} else break end end i = i+1 end for i=table.getn(sorted),2,-1 do --setPlayerIsFinished(sorted[i], true) --call(getResourceFromName("Race"), "setPlayerIsFinished", theElement) triggerEvent("onPlayerFinishDD", sorted[i][1], i) killPed(sorted[i][1]) end triggerEvent("onPlayerWinDD", sorted[1][1]) triggerClientEvent("onKOTHEnd", resourceRoot, sorted[1][1], sorted) end addEvent("onPostFinish", true) addEventHandler("onPostFinish", rootElement, checkForResults) Error at client line 44: atttempt to perform aritmethic on global 'playerKOTHPoints' <a string value> can anyone help me ?
  24. Render a 3D-map

    Hello. How can render a 3D-map for radar? Examples: http://i.playground.ru/i/13/48/41/00/file/content/fxlynsb0.png http://img15.hostingpics.net/pics/5430340e6bbff866149242c9e6af77a5ffb59c.jpg
  25. cant connect to CIT server HELP!!

    okay, i downloaded MTA yesterday and joined server :CIT Cops 'n' Robbers, Gang Wars, Civilians | cit2.net | EN/AR/RU/+8 more languages IP : 91.121.96.47:27016 i registerd in it then when i went off my brother registerd too and played but when he made the account he named it headlord4 he started with my account name (zezothelord) idk how but afterthat he changed it and he went off then i tried to login found my account named headlord4 :0 but changed it back to zezothelord when i went off and my brother came back he couldnt login his account it said ur password is wrong but he was putting his password right then he made another account and same things happened untill he tried to put hhis password 10times and now we both cant login