Jump to content

brocky

Members
  • Posts

    49
  • Joined

  • Last visited

Details

  • Gang
    ATGW
  • Location
    Bahrain
  • Occupation
    Student.
  • Interests
    Programming.

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

brocky's Achievements

Rat

Rat (9/54)

0

Reputation

  1. It doesn't works, it only displays the result of line 33. The player doesn't logs in Bad argument at logIn [expected account, got string]
  2. My login button doesn't works. local window1 = guiCreateWindow(455, 178, 710, 532, "", false) guiWindowSetSizable(window1, false) local editUsername = guiCreateEdit(167, 108, 361, 40, "", false, window1) local editPassword = guiCreateEdit(170, 197, 358, 36, "", false, window1) btnLogin = guiCreateButton(9, 434, 691, 43, "Login", false, window1) btnClose = guiCreateButton(14, 486, 686, 36, "Close", false, window1) guiSetVisible(window1, true) showCursor(true) function closeGui() if btnClose == source then guiSetVisible(window1, false) showCursor(false) end end addEventHandler("onClientGUIClick", btnClose, closeGui, false) function logToServer() account = guiGetText(editUsername) password = guiGetText(editPassword) local name = getPlayerName(getLocalPlayer()) triggerServerEvent("test", localPlayer, account, password, name) end addEventHandler("onClientGUIClick", btnLogin, logToServer, false) server side function myMoney(account, password, name) logIn (source, account, password) end addEvent("test", true) addEventHandler("test", getRootElement(), myMoney)
  3. Hey, I don't know whats wrong in this guy. any ideas? GUIEditor = { button = {}, window = {}, memo = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(563, 204, 519, 491, "Rules and Regulation", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.memo[1] = guiCreateMemo(9, 29, 500, 418, "", false, GUIEditor.window[1]) button1 = guiCreateButton(18, 449, 491, 32, "I agree", false, GUIEditor.window[1]) end ) function closeButton() if button1 == source then outputChatBox("Hey") end end addEventHandler("onClientGUIClick",button1,closeButton,false)
  4. Oh, thanks! I din't paid
  5. I have a problem with a code, Its a simple calculator to substract numbers, but the problem is that it doesn't give the required/correct answer. editbox1 = guiCreateEdit(22, 41, 135, 24, "", false, window1) editbox2 = guiCreateEdit(21, 80, 136, 24, "", false, window1) buttonSub = guiCreateButton(148, 250, 110, 26, "Subtraction", false, window1) function substraction() if buttonSub == source then num1 = guiGetText ( editbox1 ) num2 = guiGetText ( editbox1 ) local subtheAnswer = num1 - num2 outputChatBox("Subtraction answer: "..subtheAnswer) end end addEventHandler("onClientGUIClick", buttonSub, substraction, false) Hope you understood
  6. Thanks, you all helped, I read the wiki about "triggerServerEvent" and I had to add the 3rd optionals argument to send the "textPrice" element to server so that it will recognize it but Thanks to everybody.
  7. Ok, lemme try something new on it, If it didn't work then I will "EDIT" this post.
  8. First of all ! takePlayerMoney is server sided! You can't use it on client side script! 2nd is that I made an Edit to input the amount of money that you want and I call it "textPrice" and it is in Client side. Now if a player clicks buyApart then the script will take the amount of money used in "textPrice" edit. but "the server side" doesn't recognize "textPrice" because it is in Client side and thats why "takePlayerMoney" doesn't recognize "textPrice" because I defined it in client side and server side doesn't know what is it. Understood? Thats my problem and here is the debugscript 3 decision. WARNING: [script]Test\server.lua:2: Bad argument @ 'takePlayerMoney' [Expected number at argument 2, got nil]
  9. I know that, but what I am trying to say is that I want "that" number value and take it to the server side and excecute it but server side doesn't recognize it.
  10. It says "textPrice" is a string in the server-side. Can you even explain it with comments a bit?
  11. I have a problem with my code, and its like I made an edit window which is set to variable "intPrice" and now I converted using "guiGetText" to "textPrice". The problem is that I want to take the exact amount of money that the player entered in "textPrice" and the problem is that "takePlayerMoney" is server sided.How is it possible to call the "textPrice" in server side so I CAN TAKE THE MONEY. This is how I did it and it doesn't works. buttonBuy = guiCreateButton(9, 297, 130, 26, "Buy House", false, window2) intPrice = guiCreateEdit(114, 294, 178, 22, "", false, window1) textPrice = guiGetText ( intPrice ) local theMoney = tonumber ( textPrice ) function buyApart() if buttonBuy == source then playerMoney = getPlayerMoney(localPlayer) if playerMoney >= theMoney then guiSetEnabled(buttonSell, true) outputChatBox("House Bought", 24, 247, 7, true) triggerServerEvent("takingMoney", localPlayer) else outputChatBox("Insufficient cash.", 249, 10, 4 ) end end end addEventHandler("onClientGUIClick", buttonBuy, buyApart, false) Server side :- function takeMoney() takePlayerMoney(source, textPrice) end addEvent("takingMoney", true) addEventHandler("takingMoney", getRootElement(), takeMoney) Hope you understood my problem.
  12. I have problem with my code "It doesn't let you to go to the specified interior and x, y, z position. I have made a GUI with edits and for interior it is called "IntEdit" and for X it is intx , for Y it is inty, for Z it is intz. This code doesn't works. intEdit = guiCreateEdit(111, 147, 166, 22, "", false, window1) intx = guiCreateEdit(110, 170, 167, 22, "", false, window1) inty = guiCreateEdit(111, 193, 170, 21, "", false, window1) intz = guiCreateEdit(109, 214, 178, 19, "", false, window1) function buttonDo() if buttonEnter == source then setElementInterior(localPlayer, intEdit, intx, inty, intz ) end end addEventHandler("onClientGUIClick", buttonEnter, buttonDo, false)
  13. brocky

    [HELP]Gridlist

    I know that I have made many mistakes and they are epic, but I am bad in making gridlist and I need your help. addEventHandler("onClientResourceStart", resourceRoot, function() window1 = guiCreateWindow(245, 209, 309, 271, "", false) guiWindowSetSizable(window1, false) gridlist1 = guiCreateGridList(9, 21, 290, 176, false, window1) guiGridListAddColumn(gridlist1, "Weapons", 0.9) guiGridListAddRow(gridlist1) text = guiGridListSetItemText(gridlist1, 0, 1, "m4", false, false) button1 = guiCreateButton(9, 205, 290, 56, "OK", false, window1) function getWeapon() if button1 == source then if guiGridListGetSelectedItem(v[1]) then triggerServerEvent("giveMe", localPlayer) end end end addEventHandler("onClientGUIClick", button1, getWeapon, false) end )
  14. Hi, Can anyone help me in creating a small functional Gridlist. I have tried a lot but it never works out for me. Can you give me a small code of Gridlist. for example. 2 weapons in gridlist and when you click the weapon and click "ok", you will get that weapon. I need the code with some comments in detail if you can. Hope you understood. Thanks.
×
×
  • Create New...