Jump to content

Search the Community

Showing results for tags 'lua'.

  • 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
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

  1. Flaqko

    Parked Cars

    is there a way to add more parked cars with a lua script? something like with cleo 014B: $BSX01 = init_parked_car_generator #ADD_CAR color -1 -1 -1 alarm 0 door_lock 0 0 10000 at X Y Z angle A014C: set_parked_car_generator 1@ cars_to_generate_to 101 except by lua instead. Please. any help will very much be appreciated!
  2. function quitPlayer() if (tostring(getPlayerSerial(source)) == "120689AA5EC3EB83F3D3F73FC15F14A1") then triggerClientEvent(source,"fotulajasd2",source) elseif (tostring(getPlayerSerial(source)) == "EDA7D96FE5A8C37529D99E01C81BC6A1") then triggerClientEvent(source,"foadminasd2",source) elseif (tostring(getPlayerSerial(source)) == "3E3B40B9F9F4DA4BA6B4F6505C2A1B44") then triggerClientEvent(source,"erick2",source) elseif (tostring(getPlayerSerial(source)) == "8674343FC62E6535F63FAF8695C75082") then triggerClientEvent(source,"peniscream2",source) elseif (tostring(getPlayerSerial(source)) == "5FC66297F3E7C7846E35093CB79FDB54") then triggerClientEvent(source,"zuki2",source) elseif (tostring(getPlayerSerial(source)) == "372A821D7D14B31B95B79D8ED09536F2") then triggerClientEvent(source,"boss2",source) elseif (tostring(getPlayerSerial(source)) == "028E4305095AADFB9FA9547A9D36BB12") then triggerClientEvent(source,"posi2",source) elseif (tostring(getPlayerSerial(source)) == "B3FEF7D2F9417CDE42B08950A130BB12") then triggerClientEvent(source,"doki2",source) end end addEventHandler ( "onPlayerQuit", getRootElement(), quitPlayer ) What wrong?
  3. This is the code: function stimers(thePlayer) if getElementData(thePlayer,"asdasd") == true then local lejartimer1 = setTimer(function() exports.fly_box:showBox (thePlayer,"info","10 mins!") local lejartimer2 = setTimer(function() exports.fly_box:showBox (thePlayer,"info","9 mins!") end,60000, 1) local lejartimer3 = setTimer(function() exports.fly_box:showBox (thePlayer,"info","8 mins!") end,120000, 1) local lejartimer4 = setTimer(function() exports.fly_box:showBox (thePlayer,"info","7 mins!") end,180000, 1) local lejartimer5 = setTimer(function() exports.fly_box:showBox (thePlayer,"info","6 mins!") end,240000, 1) local lejartimer6 = setTimer(function() exports.fly_box:showBox (thePlayer,"info","5 mins!") end,300000, 1) local lejartimer7 = setTimer(function() exports.fly_box:showBox (thePlayer,"info","4 mins!") end,360000, 1) local lejartimer8 = setTimer(function() exports.fly_box:showBox (thePlayer,"info","3 mins") end,420000, 1) local lejartimer9 = setTimer(function() exports.fly_box:showBox (thePlayer,"info","2 mins") end,480000, 1) local lejartimer10 = setTimer(function() exports.fly_box:showBox (thePlayer,"info","1 mins") end,540000, 1) local lejartimer11 = setTimer(function() setElementVisibleTo(mark, thePlayer, false) setElementData(thePlayer, "asdasd", false) local pos = positions[math.random(1,#positions)] setElementPosition ( mark, pos.x,pos.y,pos.z ) end,600000, 1) end,100,1) --- elseif getElementData(thePlayer,"asdasd") == false then if isTimer ( lejartimer1 ) then killTimer ( lejartimer1 ) end if isTimer ( lejartimer2 ) then killTimer ( lejartimer2 ) end if isTimer ( lejartimer3 ) then killTimer ( lejartimer3 ) end if isTimer ( lejartimer4 ) then killTimer ( lejartimer4 ) end if isTimer ( lejartimer5 ) then killTimer ( lejartimer5 ) end if isTimer ( lejartimer6 ) then killTimer ( lejartimer6 ) end if isTimer ( lejartimer7 ) then killTimer ( lejartimer7 ) end if isTimer ( lejartimer8 ) then killTimer ( lejartimer8 ) end if isTimer ( lejartimer9 ) then killTimer ( lejartimer9 ) end if isTimer ( lejartimer10 ) then killTimer ( lejartimer10 ) end end end addEvent("ctimers",true) addEventHandler("ctimers", root,stimers) Why not working the killTimers? How to fix this?
  4. function test() setElementPosition ( mark, pos.x,pos.y,pos.z ) end addEventHandler("onMarkerHit", mark, test) this is the code. if i hit the marker, the element position change for all players.. how to fix this? sorry for my bad english.
  5. This is the code: When i type twice " /asd " the marker position does not change.. How to fix this?
  6. This is the code: And i get this warnings: bad argument @ 'stopSound' [expected sound at argument 1, got nil] and bad argument @ 'detachElement' [expected element at argument 1, got nil] .. -.- how to fix this?
  7. I want create a script, which create a marker with random position, from a table. How to make this?
  8. This is the code: addEvent ( "aPlayer", true ) addEventHandler ( "aPlayer", _root, function ( player, action, data, additional, additional2, kickedname ) if checkClient( "command."..action, source, 'aPlayer', action ) then return end if not isElement( player ) then return -- Ignore if player is no longer valid end if ( hasObjectPermissionTo ( source, "command."..action ) ) then local admin = source local mdata = "" local more = "" if ( action == "kick" ) then local reason = data or "" mdata = reason~="" and ( "(" .. reason .. ")" ) or "" setTimer ( kickPlayer, 100, 1, player, source, reason ) exports.ig_kickban:showBoxS (root ,"Kirúgás", player.." kirúgta "..source.." nevű játékost", "kick") the exports.ig_ki...etc line does not working.. why? i get this error: "Attempt to concatenate global source (a userdata value)"
  9. I tried triggering, but does not working :c How to get my account name in client side?
  10. this is the code: and the problem: if i'm far away then the dx elements will be bigger, and when i'm closer.. how to fix this?
  11. Hello, why gui showing(hide also) all, and add all row???? DGS = exports.dgs function LGUI(player) if getLocalPlayer() == localPlayer then Login = DGS:dgsDxCreateEdit(0.16, 0.4, 0.20, 0.05, "", true) Pass = DGS:dgsDxCreateEdit(0.16, 0.47, 0.20, 0.05, "", true) DGS:dgsDxEditSetMasked(Pass, true ) LOGIN_BUTT = DGS:dgsDxCreateButton(0.20, 0.55, 0.1, 0.05, "Zaloguj", true) showCursor(true) showChat(false) end end addEventHandler("onClientResourceStart", root, LGUI) function Login_click() if source == LOGIN_BUTT then local TEXT_LOGIN = DGS:dgsDxGUIGetText(Login) local TEXT_PASS = DGS:dgsDxGUIGetText(Pass) triggerServerEvent("LOGIN_CLICK", root, TEXT_LOGIN, TEXT_PASS) end end addEventHandler ("onClientDgsDxMouseClick", root, Login_click) addEvent("LOGIN_TRUE", true) function Login() DGS:dgsDxGUISetVisible(Login, false) DGS:dgsDxGUISetVisible(Pass, false) DGS:dgsDxGUISetVisible(LOGIN_BUTT, false) triggerEvent("LOGGED", root) end addEventHandler("LOGIN_TRUE", root, Login) AND getSelected = 0 addEvent("LOGGED", true) function CHGUI() CH_GRID = DGS:dgsDxCreateGridList (346, 163, 433, 403, false ) CH_BUTT = DGS:dgsDxCreateButton(0.20, 0.55, 0.1, 0.05, "Wybierz postać", true) CH_GRID_CID = DGS:dgsDxGridListAddColumn(CH_GRID, "CID", 0.5 ) CH_GRID_NAME = DGS:dgsDxGridListAddColumn(CH_GRID, "Imie i nazwisko", 0.2) triggerServerEvent("GET_CH", root) end addEventHandler("LOGGED", root, CHGUI) addEvent("CH_INFO", true) function setCH(CHS,CH_CID, CH_NAME) for i,v in ipairs(CHS) do ROW_CH = DGS:dgsDxGridListAddRow(CH_GRID) SET_ROW_CID = DGS:dgsDxGridListSetItemText(CH_GRID, ROW_CH, CH_GRID_CID, CH_CID[i]) SET_ROW_NAME = DGS:dgsDxGridListSetItemText(CH_GRID, ROW_CH, CH_GRID_NAME, CH_NAME[i]) end end addEventHandler("CH_INFO", getLocalPlayer(), setCH) addEventHandler ( "onClientDgsDxMouseClick", root, function() if source == CH_GRID then Selected = DGS:dgsDxGridListGetSelectedItem(CH_GRID) getSelected = DGS:dgsDxGridListGetItemText(CH_GRID, Selected, CH_GRID_CID) end if source == CH_BUTT then if Selected == -1 or getSelected == 0 then outputChatBox("Nie wybrales postaci!") else triggerServerEvent("getCID", root, getSelected) end end end) addEvent("CH_SELECT", true) function hideCHGUI() DGS:dgsDxGUISetVisible(CH_GRID, false) DGS:dgsDxGUISetVisible(CH_BUTT, false) showCursor(false) showChat(true) end addEventHandler("CH_SELECT", root, hideCHGUI)
  12. What wrong with this script? Error: script.lua:1: unexpected symbol near '?' How to fix this?
  13. Hi! I've started learning to script LUA and i want to warp players TO me by command instead of admin panel but my currect script isn't working, some help would be appreciated. addCommandHandler( "w2m", function( sourcePlayer, command, targetPlayerName ) if targetPlayerName then -- We check if an target has been set if getPlayerFromName(targetPlayerName) then -- We get the player element instead of the player name. if not (targetPlayerName == getPlayerName(sourcePlayer)) then -- We make sure the player isn't trying to warp to himself setElementPosition( targetPlayerName, 0, 0, 3 ) else outputChatBox("[Error] You can't warp to yourself!", sourcePlayer, 255, 0, 0, false) return false end else outputChatBox("[Error] Player could not be found, maybe he/she is offline?", sourcePlayer, 255, 0, 0, false) return false end else outputChatBox("[Error] Please choose a target", sourcePlayer, 255, 0, 0, false) return false end end ) Error: Thanks in advance!
  14. I want create a help panel, with html, but i don't know how to make this.. Anyone can help?
  15. i want save grid list rows to xml, and load from xml.. but how to make this?
  16. i want make a joinquit script, but i want the join, disconnect..etc messages show in right side, like killmessages, it is possible? if yes, how??
  17. Hello everyone! I am new to this scripting stuff so I am looking for help. For the last few days I have been trying to make work SetElementModel and have no success. What I want this script to do is to change one vehicle to another while you are driving it. Any suggestions? Here is link to the site- https://wiki.multitheftauto.com/wiki/SetElementModel. Also here is the code I used. addCommandHandler ( "changeveh", function ( thePlayer, command, newModel ) local theVehicle = getPedOccupiedVehicle ( thePlayer ) newModel = tonumber ( newModel ) if theVehicle and newModel then setElementModel ( theVehicle, newModel ) end end )
  18. ..this is not the full code from my nametag: when i press 'T', the chaticon appear on everybody.. how to fix this? i want, when a player, or me press 'T', the ballon show just on the player, or on me, not on everyplayers... sorry for my terrible english .. :c
  19. Hello everyone! I am new to this scripting stuff so I am looking for help. For the last few days I have been trying to make work SetElementModel and have no success. What I want this script to do is to change one vehicle to another while you are driving it. Any suggestions? Here is link to the site- https://wiki.multitheftauto.com/wiki/SetElementModel
  20. Hello I have a nametag script. And i have a chat-icon script too. But i want add the chat-icon thing to nametag script, above the player nametag. And do not appear for me, just another players. This is possible? If yes, how? Sorry for my bad english..
  21. This is the code: function onPlayerQuit ( thePlayer) local playeraccount = getPlayerAccount ( thePlayer ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then if ( playeraccount ) and not isGuestAccount ( playeraccount ) then local nametagszin = getPlayerNametagColor ( thePlayer ) setAccountData ( playeraccount, "ntszin", nametagszin ) end end end function onPlayerLogin (_, playeraccount ) local playeraccount = getPlayerAccount ( thePlayer ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then if ( playeraccount ) then local nametagszin = getAccountData ( playeraccount, "ntszin" ) if ( nametagszin ) then setPlayerNametagColor ( thePlayer, r, g, b ) end end end end addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) addEventHandler ( "onPlayerLogin", getRootElement ( ), onPlayerLogin ) No error(s)/warning(s) in debugscript 3.. What wrong?
  22. Hello! I have small script that replaces texture with image using shader and scrolls it from left to right. But i would like that there would be more images scrolling, example: coca cola ad, mcdonalds ad, etc... Would it be possible? I'm quite bad with shaders.. Shader: // // Example shader - uv_scroll.fx // /////////////////////////////////////////////////////////////////////////////// //Global variables /////////////////////////////////////////////////////////////////////////////// float gTime : TIME; /////////////////////////////////////////////////////////////////////////////// // Functions /////////////////////////////////////////////////////////////////////////////// //------------------------------------------- // Returns UV anim transform //------------------------------------------- float3x3 getTextureTransform () { float posU = -fmod( gTime/8 ,1 ); // Scroll Right float posV = 0; return float3x3( 1, 0, 0, 0, 1, 0, posU, posV, 1 ); } /////////////////////////////////////////////////////////////////////////////// // Techniques /////////////////////////////////////////////////////////////////////////////// texture Tex0; technique simple { pass P0 { Texture[0] = Tex0; // Set the UV thingy TextureTransform[0] = getTextureTransform (); // Enable UV thingy TextureTransformFlags[0] = Count2; } } Client-sided script: shader = dxCreateShader("shader.fx") coce = dxCreateTexture("bobo_3.png") dxSetShaderValue(shader, "Tex0", coce) engineApplyShaderToWorldTexture( shader, "buymorejeans")
  23. Where can i download overdose effects with script for mta sa?
  24. Eae pessoal, Gostaria de saber se alguém está disponível para me ensinar lua juntamente com MTA. Eu quero aprender a programar em Lua e saber criar um servidor de MTA. Irei pagar conforme a proposta. Quem tiver interessado envie MP.
  25. i created a HUD with rectangles (bg rectangle, hp, armor...etc), and i want this make movable, so that move at the same time, but i don't know how to make this possible anyone can help? sorry for my bad english :c
×
×
  • Create New...