Jump to content

KariiiM

Members
  • Posts

    1,312
  • Joined

  • Last visited

Everything posted by KariiiM

  1. This line only just returning player's account element, go to wiki and learn about setAccountData and getAccountData functions. You don't need any file to save into it, account data functions already saving your data into a sqlite file.
  2. I suggest you to start with account data's functions or xml for now.
  3. Try to avoid copying other's scripts and learn how to make yours.
  4. Replace this with your client code: local GUIEditor = { label = {}, } local newmsg = { show = false, tick = getTickCount ( ), showtime = 5000 } addEventHandler("onClientResourceStart", resourceRoot, function() yourGui = guiCreateWindow(405, 62, 682, 451, "privát beszélgetés by turbesz", false) guiWindowSetSizable(yourGui, false) close = guiCreateButton(646, 20, 26, 26, "X", false, yourGui) guiSetProperty(close, "NormalTextColour", "FFFF0000") bb = guiCreateButton(658, 33, 172, 22, "Privát beszélgetés", false) guiSetVisible(bb,true) grdPlayers = guiCreateGridList(0.0991,0.2449,0.8108,0.6968, true, yourGui) colPlayers = guiGridListAddColumn(grdPlayers, "Játékosok", 0.85) guiSetVisible(yourGui,false) GUIEditor.label[1] = guiCreateLabel(24, 22, 620, 82, "Szia, üdvözöllek a FullFunPlay egyedi Privát üzenet rendszerében! \"{SMILIES_PATH}/icon_wink.gif\" alt=\"\" title=\"Wink\" /> \n\nVálassz ki valakit, és kattints duplán (kétszer) a nevére, utána megnyillik a csevegő ablak, ahol nyugodtan, mindenki hátamögött (kivéve turbeszt persze:3) beszélhettek a pucér nagy mellű nőkről, vagy akármiről, ez whatever.", false, yourGui) guiLabelSetHorizontalAlign(GUIEditor.label[1], "left", true) -- events addEventHandler("onClientGUIClick",bb,clickButtonBB,false) addEventHandler ( "onClientGUIClick", close, Bezaras,false) end ) -- add all players to your gridlist function addPlayersToGridlist() guiGridListClear(grdPlayers) local players = getElementsByType("player") for index, player in pairs(players) do local row = guiGridListAddRow(grdPlayers) local name = getPlayerName(player) guiGridListSetItemText(grdPlayers, row,1, name, false, false) end end -- open the Gui when the player click bb button function clickButtonBB() if not guiGetVisible (yourGui) then guiSetVisible(yourGui,true) showCursor(true) addPlayersToGridlist() else guiSetVisible(yourGui,false) showCursor(false) end end -- close the gui when the player click the close button function Bezaras() if guiGetVisible (yourGui) then guiSetVisible(yourGui, false) showCursor ( false ) end end function buildChatWindow(ply) local x,y = guiGetScreenSize() local width,height = 300,250 x = x*.5 y = y*.5 chat[ply] = {} chat[ply].wnd = guiCreateWindow(337,277,395,252, getPlayerName(ply), false) chat[ply].img = guiCreateStaticImage(0.0228,0.0754,0.9544,0.8889,"image/shruk.png",true,chat[ply].wnd) chat[ply].memo = guiCreateMemo(0.043,0.1746,0.9089,0.623, "", true, chat[ply].wnd) chat[ply].edit = guiCreateEdit(0.043,0.8214,0.7089,0.1111, "", true, chat[ply].wnd) chat[ply].btnX = guiCreateButton(0.9215,0.0754,0.0557,0.0794, "X", true, chat[ply].wnd) chat[ply].btnSend = guiCreateButton(0.757,0.8135,0.2127,0.1429, "Küldés", true, chat[ply].wnd) guiSetProperty(chat[ply].img,"Disabled","true") guiMemoSetReadOnly(chat[ply].memo, true) guiWindowSetSizable(chat[ply].wnd, false) guiSetProperty(chat[ply].wnd, "RollUpEnabled", "true") guiSetProperty(chat[ply].wnd, "Dragable", "true") end function sendChatMessage(ply) outputDebugString("sendChatMessage: " .. tostring(ply)) if chat[ply] and isElement(chat[ply].wnd) then local newText = guiGetText(chat[ply].edit) if newText and string.len(newText) > 0 then local oldText = guiGetText(chat[ply].memo) if not oldText then oldText = "" end oldText = oldText .. getPlayerName(g_LocalPlayer) .. ": " .. newText .. "\n" guiSetText(chat[ply].memo, oldText) guiSetText(chat[ply].edit, "") guiMemoSetCaretIndex(chat[ply].memo, string.len(oldText)) triggerServerEvent("onGUIPrivateMessage", g_LocalPlayer, ply,newText) end end end function recieveChatMessage(ply, msg) outputDebugString("recieveChatMessage: " .. msg) if not chat[ply] then buildChatWindow(ply) end end newmsg.show = true newmsg.tick = getTickCount() guiSetText(newmsg.lbl, getPlayerName(ply) .. ": " .. msg .. "\n") guiSetText(newmsg.lbl, "Üzenet tőle " .. getPlayerName(ply) .. "\n") outputChatBox("Üzeneted érkezett. Nyomj F3-at hogy megnézd.",255,255,255,true) local sound = playSound("GatkResalh~.mp3",false) setSoundVolume(sound, 0.2) event_player_join = function() --outputDebugString("onClientPlayerJoin") addPlayersToGridlist(source) end event_player_quit = function() --outputDebugString("onClientPlayerQuit") removePlayerFromGridList(source) destroyChatWindow(source) end event_gui_doubleclick = function(button, state, absx, absy) if button == "left" and state == "up" then if source == grdPlayers then local row, col = guiGridListGetSelectedItem(grdPlayers) --outputDebugString("double clicked row: "..tostring(row)) if row == -1 or col == -1 then return end local name = guiGridListGetItemText(grdPlayers, row, col) local ply = getPlayerFromName(name) if not chat[ply] then buildChatWindow(ply) end guiBringToFront(chat[ply].wnd) end end end event_gui_accepted = function(element) local parent = getElementParent(source) if parent ~= false then local ply = getPlayerFromName(guiGetText(parent)) if ply then if element == chat[ply].edit then sendChatMessage(ply) end end end end event_render = function() if newmsg.show == true then if getTickCount() > newmsg.tick + newmsg.showtime then anims.nmfadeout:play() anims.nmtextout:play() newmsg.show = false end end end addEvent("onPrivateChatSent", true) addEventHandler("onPrivateChatSent", g_Root, recieveChatMessage) addEventHandler("onClientResourceStart", g_ResourceRoot, event_resource_start) addEventHandler("onClientResourceStop", g_ResourceRoot, event_resource_stop) addEventHandler("onClientGUIDoubleClick", g_ResourceRoot, event_gui_doubleclick) addEventHandler("onClientGUIClick", g_ResourceRoot, event_gui_click) addEventHandler("onClientGUIAccepted", g_ResourceRoot, event_gui_accepted) addEventHandler("onClientPlayerJoin", g_Root, event_player_join) addEventHandler("onClientPlayerQuit", g_Root, event_player_quit) addEventHandler("onClientRender", g_Root, event_render)
  5. You wrote all that and you don't know how to fix this problem.
  6. I wonder why you set the getPlayerMoney function's return value to number and it returns already an integer value by default. it seems like that, converting a number to a number which makes no sense. tonumber ( 104350 )
  7. Use the lua tag [lua] add your code [./lua]
  8. My post is edited, forgot to complet the explanation, thank you for reminding me
  9. I want to share with you a simple usage of the tonumber lua function, everyone knows that this tonumber function convert a number with the string form to an actual number type, But what might you don't know is, it can also convert the letters with string form to actual number. tonumber function has an optional argument named 'base', The base can be any number between ( 2 - 36 ). if you put a string with the lettre B ( upper or lower case ) it will return the number 11. Examples: tonumber ( "A", 10 ) or tonumber ( "A", 11 ) -- 10 tonumber ( "B", 12 ) -- 11 tonumber ( "C", 13 ) -- 12 tonumber ( "D", 14 ) -- 13 tonumber ( "E", 15 ) -- 14 tonumber ( "F", 16 ) -- 15 ....etc.... tonumber ( "z", 36 ) -- 35 - The lettre A outputs the number: 10 - The letter B outputs the number: 11 - The letter C outputs the number: 12 - The letter D outputs the number: 13 .......... Etc ........... Untill the letter Z, it outputs the number: 35.
  10. There's already an existed race game mode in your default resources pack.
  11. Yes Codly, I was just reminding him that's all. By the way, this line number '2' is going to output an error, you forgot to add an ')' before do for _, player in ipairs ( getElementsByType ( "player" ) ) do
  12. Depends on what you are planning to do.
  13. Putting this code dirrectly in the server side will not work correctly, you'll have to define the player element else the entire code will be failed to load.
  14. Yeah, because the function handler is defined after the event handler, and the server is reading the code from the top to the buttom.
  15. About this trick is named "Ternary Operator". local variable = (Condition and "yes") or "no" It works like that, if the condition is true then it will trigger the string "yes" otherwise will trigger "no".
  16. show your full code, this part won't help us to fix your problem.
  17. Developers has nothing to do in this case, your problem is related to scripting not to your server issues, Right section: https://forum.multitheftauto.com/viewforum.php?f=91
  18. Read this: https://wiki.multitheftauto.com/wiki/In ... ng_the_GUI
  19. It's the right section, you need to script that using GUI functions
  20. Do you mean, you wanna make a suggestion panel for your server ?
×
×
  • Create New...