Jump to content

fairyoggy

Members
  • Posts

    269
  • Joined

  • Last visited

Everything posted by fairyoggy

  1. I just need to check the current language of the player in his windows(Language bar in windows) For example, initially the user has English - a message will appear - English As soon as you switch to another language, another message will appear
  2. but how to get the current language in the user's language layout?
  3. How do i get player current language layout? For example, a player has an English layout: A message will appear in the chat - English layout If the player switches to another language layout, A message will appear in the chat - other layout
  4. Used dgs tools and there is such an opportunity: https://wiki.multitheftauto.com/wiki/DgsEditSetWhiteList but how to use the same for gui edit ?
  5. solved my problem with the first option, thanks
  6. onClientPlayerVoiceStart how to ban this command if the player is not logged in (guest) ?
  7. How to create a command that will show getElementData(target, "name") by login? I mean if you type /find Alex Find a player with a login "Alex" and get he's elementData("name") and will appear message with he's nick But the player is not on the server UPDATE: I found this but how to use it on offline players? https://wiki.multitheftauto.com/wiki/GetPlayerFromAccountName
  8. fairyoggy

    guiGetText

    Hello! How do I check for a character in edits? I mean, need to check if there is a sign "@" in this edit or no Example: type in edit "hello" - appear message - invalid type in edit "hello@" - appear message - complete
  9. @IIYAMA dbExec( dbSecurityConnection, ' CREATE TABLE if not exists `housing` (`houseID` INT PRIMARY KEY AUTOINCREMENT)' ) used this option, but got this error: Why? Indicated that it (INT PRIMARY KEY) The second option throws an error with syntax.
  10. How to fix it? can't use (AUTO_INCREMENT) dbSecurityConnection = dbConnect( 'sqlite', '123.db') dbExec( dbSecurityConnection, ' CREATE TABLE if not exists `housing` (`houseID` INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(houseID)) ' ) it's 2 line in code above
  11. Above code: 1) Used map on f11 2) Left-clicking on the map creates a red mark 3) Coordinate(x) are recorded in edit (in the same way and (y) coordinate record on edit.) How to use a similar method, but for my map(map.png)? I mean, I created a window with a staticimage(map.png) and how to use the same method, but for this picture instead of the map on f11 ?
  12. Still need help on this.
  13. in my code that this displays in the chat of administrators online but I need a list of administrators online in gridlist For each administrator a separate row. Example: There are 3 administrators on the server in a gridlist will create 3 rows with their names.
  14. How do I list online administrators in a grid list? For each administrator a new row. I have such a code through a chat command, but how to make a glidlist function refreshListAdmin() count = 0 online = "" for i, v in ipairs(getElementsByType("player")) do if hasObjectPermissionTo(v,"function.setPlayerMuted",true) then online = getPlayerName(v).." "..online count = count+1 end end return online, count end addEvent("refreshListAdmin", true) addEventHandler("refreshListAdmin", root, refreshListAdmin) addCommandHandler("admins", function(playerSource) admins, count = refreshListAdmin() outputChatBox("#1e90ffAdmins : #FFFFFF"..admins.."",playerSource,255,85,0,true) end )
  15. Everything works perfectly. thank
  16. @#x1AhMeD-09 The first two lines are the local player, the one who wrote the message Third line, this is another player wrote a message and I see another player’s message like on the third line How to fix it?
  17. No, you did not understand. Everything is in order here, I just need another player to be able to see this text Now it works only for the user who sends the message
  18. How to make a chat in memo? --client if ( source == Button[44] ) then local message = guiGetText(editAdmin) local name = getPlayerName(localPlayer) local servertime = getRealTime () local hours = (servertime.hour) local minutes = string.format("%02d", servertime.minute) local second = string.format("%02d", servertime.second) if message == "" then playSoundFrontEnd(2) return end guiSetText(memo_admin, guiGetText(memo_admin).."["..hours..":"..minutes..":"..second.."] "..getPlayerName ( localPlayer )..": "..message ) guiSetText(editAdmin, "") end I did something similar for just one player. How to make messages be added and visible to all users who enter the memo? I understand that need to do something on the server side, but I don’t know how to fix it. Help
  19. local sx, sy = guiGetScreenSize() function centerWindow(center_window) local screenW,screenH=guiGetScreenSize() local windowW,windowH=guiGetSize(center_window,false) local x,y = (screenW-windowW)/2,(screenH-windowH)/2 guiSetPosition(center_window,x,y,false) end wndTpMap = guiCreateWindow(0,0,700,700,"Teleport map",false) centerWindow(wndTpMap) mapBlip = guiCreateStaticImage(40, 30, 610, 610, 'map.png', false, wndTpMap) close_TpMap = guiCreateButton(520,655,130,20,"Cancel",false,wndTpMap) wndTpMapX = guiCreateEdit(40,655,150,20,"",false,wndTpMap) wndTpMapY = guiCreateEdit(200,655,150,20,"",false,wndTpMap) wndTpMapZ = guiCreateEdit(360,655,150,20,"",false,wndTpMap) local targetBlipIcon = 41 local screenSize = Vector2(guiGetScreenSize()) local wasLeftMouseButtonPressed, wasRightMouseButtonPressed, targetBlip = false, false local function handleMapTargetBlip() if not isPlayerMapVisible() then showCursor(false, false) wasLeftMouseButtonPressed, wasRightMouseButtonPressed = false, false return end if not isCursorShowing() then showCursor(true, false) end local isLeftMouseButtonPressed = getKeyState("mouse1") if isLeftMouseButtonPressed and isLeftMouseButtonPressed ~= wasLeftMouseButtonPressed then local cursorPos, mapMin, mapMax = Vector2(getCursorPosition()) cursorPos.x, cursorPos.y = cursorPos.x * screenSize.x, cursorPos.y * screenSize.y do local mx, my, Mx, My = getPlayerMapBoundingBox() mapMin = Vector2(mx, my) mapMax = Vector2(Mx, My) end if cursorPos.x >= mapMin.x and cursorPos.y >= mapMin.y and cursorPos.x <= mapMax.x and cursorPos.y <= mapMax.y then local relPos = Vector2((cursorPos.x - mapMin.x) / (mapMax.x - mapMin.x), (cursorPos.y - mapMin.y) / (mapMax.y - mapMin.y)) local worldPlanePos = Vector2(6000 * (relPos.x - 0.5), 3000 - (relPos.y * 6000)) local worldPos = Vector3(worldPlanePos.x, worldPlanePos.y, getGroundPosition(worldPlanePos.x, worldPlanePos.y, 3000)) if not targetBlip then targetBlip = createBlip(worldPos, targetBlipIcon) else setElementPosition(targetBlip, worldPos) guiSetText(wndTpMapX,worldPlanePos.x) end end end local isRightMouseButtonPressed = getKeyState("mouse2") if targetBlip then if isRightMouseButtonPressed and isRightMouseButtonPressed ~= wasRightMouseButtonPressed then destroyElement(targetBlip) targetBlip = nil end end wasLeftMouseButtonPressed, wasRightMouseButtonPressed = isLeftMouseButtonPressed, isRightMouseButtonPressed end addEventHandler("onClientRender", root, handleMapTargetBlip) Now it's put a red mark on the map with a left click. How to use it in the picture? "mapBlip = guiCreateStaticImage(40, 30, 610, 610, 'map.png', false, wndTpMap)" Now it works for the map on f11 but i need for "mapBlip"
  20. fairyoggy

    XML file

    I understood this, but I need an example of how to use this in the code to change the selected line. I wouldn’t ask it a second time, if that was enough
  21. fairyoggy

    XML file

    How to use it correctly? Example: There are 2 lines <report vreamya="1" Name="1" Jaloba="1" Admin="1" Otvet="1"/> <report vreamya="1" Name="2" Jaloba="1" Admin="1" Otvet="1"/> How to find exactly the 2nd line and make changes in it? I mean, how to find the 2nd line and change it, for example, Jaloba = "2" And the second line will be <report vreamya="1" Name="2" Jaloba="2" Admin="1" Otvet="1"/>
  22. fairyoggy

    XML file

    I mean, the original file loads normally, but when you add a new record, it is saved to the file, but the updated file does not output to the gridlist. If you restart the script, a new record will appear, but if you add another new one then it will not be displayed in the gridlist(but in file saved successfully) See my code above. How to fix it?
×
×
  • Create New...