enzopaul4 Posted January 30, 2017 Share Posted January 30, 2017 GUIEditor = { label = {}, edit = {}, button = {}, window = {}, combobox = {}, memo = {} } function diploma() local screenW, screenH = guiGetScreenSize() if (getElementData(player,"faction")) == 4 and ( getElementData(player, "factionleader")) then GUIEditor.window[1] = guiCreateWindow((screenW - 666) / 2, (screenH - 384) / 2, 666, 384, "Diplomă Universitate", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FF00FFFC") GUIEditor.button[1] = guiCreateButton(257, 347, 137, 27, "Ieși", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFFF0000") GUIEditor.label[1] = guiCreateLabel(10, 26, 137, 48, "Nume Elev:", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[1], 0, 255, 252) GUIEditor.memo[1] = guiCreateMemo(181, 4, 20, 20, "", false, GUIEditor.label[1]) GUIEditor.label[2] = guiCreateLabel(254, 32, 149, 31, "Descriere Diplomă:", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[2], 0, 255, 252) GUIEditor.memo[2] = guiCreateMemo(359, 24, 293, 313, "", false, GUIEditor.window[1]) GUIEditor.label[3] = guiCreateLabel(398, 343, 274, 36, "Maxim : 150 Caractere.(Pentru ajutor \n/ajutordiploma)", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[3], 0, 245, 255) GUIEditor.label[4] = guiCreateLabel(7, 71, 155, 36, "Semnătură Director:", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[4], 0, 245, 255) GUIEditor.label[5] = guiCreateLabel(10, 109, 135, 29, "Semnătură Diriginte/ă:", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[5], 0, 245, 255) GUIEditor.edit[1] = guiCreateEdit(77, 21, 130, 30, "", false, GUIEditor.window[1]) GUIEditor.edit[2] = guiCreateEdit(121, 64, 133, 32, "", false, GUIEditor.window[1]) GUIEditor.edit[3] = guiCreateEdit(135, 106, 133, 32, "", false, GUIEditor.window[1]) GUIEditor.label[6] = guiCreateLabel(11, 148, 151, 37, "TIP:", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[6], 0, 245, 255) GUIEditor.combobox[1] = guiCreateComboBox(40, 147, 140, 90, "Diplomă Mechanic", false, GUIEditor.window[1]) guiComboBoxAddItem(GUIEditor.combobox[1], "Diplomă Mechanic") guiComboBoxAddItem(GUIEditor.combobox[1], "Diplomă Medic") guiComboBoxAddItem(GUIEditor.combobox[1], "Diplomă Polițist/ă") guiComboBoxAddItem(GUIEditor.combobox[1], "Diplomă Politică") GUIEditor.button[2] = guiCreateButton(194, 150, 140, 41, "Oferă Diploma", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FF00F5FF") GUIEditor.label[7] = guiCreateLabel(10, 183, 350, 164, "\n\n((OOC , Acest sistem este încă în teste , dacă găsiți o \nproblemă nu ezitați să contactați un membru staff online!\n\n\n\n Mulțumim de înțelegere!\n\nP.S.Să nu abuzați că vă tai semnat Paul_Dima și \n Cojocaru_Daniel", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[7], "default-bold-small") guiLabelSetColor(GUIEditor.label[7], 0, 245, 255) end function arataDiploma() if not guiGetVisible(GUIEditor.window[1]) then guiSetVisible(GUIEditor.window[1],true) showCursor(true,true) end end end addCommandHandler("oferadiploma",showVehicleSelection) So .. i create this gui but if i enter the game and i write the command it isn't working , i am in the right faction and leader . Can you help me guys? I cannot find what is wrong , thank you anyway! Link to comment
Dimos7 Posted January 30, 2017 Share Posted January 30, 2017 GUIEditor = { label = {}, edit = {}, button = {}, window = {}, combobox = {}, memo = {} } function diploma() local screenW, screenH = guiGetScreenSize() if (getElementData(player,"faction")) == 4 and ( getElementData(player, "factionleader")) then GUIEditor.window[1] = guiCreateWindow((screenW - 666) / 2, (screenH - 384) / 2, 666, 384, "Diplomă Universitate", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FF00FFFC") GUIEditor.button[1] = guiCreateButton(257, 347, 137, 27, "Ieși", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFFF0000") GUIEditor.label[1] = guiCreateLabel(10, 26, 137, 48, "Nume Elev:", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[1], 0, 255, 252) GUIEditor.memo[1] = guiCreateMemo(181, 4, 20, 20, "", false, GUIEditor.label[1]) GUIEditor.label[2] = guiCreateLabel(254, 32, 149, 31, "Descriere Diplomă:", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[2], 0, 255, 252) GUIEditor.memo[2] = guiCreateMemo(359, 24, 293, 313, "", false, GUIEditor.window[1]) GUIEditor.label[3] = guiCreateLabel(398, 343, 274, 36, "Maxim : 150 Caractere.(Pentru ajutor \n/ajutordiploma)", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[3], 0, 245, 255) GUIEditor.label[4] = guiCreateLabel(7, 71, 155, 36, "Semnătură Director:", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[4], 0, 245, 255) GUIEditor.label[5] = guiCreateLabel(10, 109, 135, 29, "Semnătură Diriginte/ă:", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[5], 0, 245, 255) GUIEditor.edit[1] = guiCreateEdit(77, 21, 130, 30, "", false, GUIEditor.window[1]) GUIEditor.edit[2] = guiCreateEdit(121, 64, 133, 32, "", false, GUIEditor.window[1]) GUIEditor.edit[3] = guiCreateEdit(135, 106, 133, 32, "", false, GUIEditor.window[1]) GUIEditor.label[6] = guiCreateLabel(11, 148, 151, 37, "TIP:", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[6], 0, 245, 255) GUIEditor.combobox[1] = guiCreateComboBox(40, 147, 140, 90, "Diplomă Mechanic", false, GUIEditor.window[1]) guiComboBoxAddItem(GUIEditor.combobox[1], "Diplomă Mechanic") guiComboBoxAddItem(GUIEditor.combobox[1], "Diplomă Medic") guiComboBoxAddItem(GUIEditor.combobox[1], "Diplomă Polițist/ă") guiComboBoxAddItem(GUIEditor.combobox[1], "Diplomă Politică") GUIEditor.button[2] = guiCreateButton(194, 150, 140, 41, "Oferă Diploma", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FF00F5FF") GUIEditor.label[7] = guiCreateLabel(10, 183, 350, 164, "\n\n((OOC , Acest sistem este încă în teste , dacă găsiți o \nproblemă nu ezitați să contactați un membru staff online!\n\n\n\n Mulțumim de înțelegere!\n\nP.S.Să nu abuzați că vă tai semnat Paul_Dima și \n Cojocaru_Daniel", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[7], "default-bold-small") guiLabelSetColor(GUIEditor.label[7], 0, 245, 255) end function arataDiploma() diploma() if not guiGetVisible(GUIEditor.window[1]) then guiSetVisible(GUIEditor.window[1],true) showCursor(true,true) end end end addCommandHandler("oferadiploma",showVehicleSelection) Link to comment
enzopaul4 Posted January 31, 2017 Author Share Posted January 31, 2017 17 hours ago, Dimos7 said: GUIEditor = { label = {}, edit = {}, button = {}, window = {}, combobox = {}, memo = {} } function diploma() local screenW, screenH = guiGetScreenSize() if (getElementData(player,"faction")) == 4 and ( getElementData(player, "factionleader")) then GUIEditor.window[1] = guiCreateWindow((screenW - 666) / 2, (screenH - 384) / 2, 666, 384, "Diplomă Universitate", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FF00FFFC") GUIEditor.button[1] = guiCreateButton(257, 347, 137, 27, "Ieși", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFFF0000") GUIEditor.label[1] = guiCreateLabel(10, 26, 137, 48, "Nume Elev:", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[1], 0, 255, 252) GUIEditor.memo[1] = guiCreateMemo(181, 4, 20, 20, "", false, GUIEditor.label[1]) GUIEditor.label[2] = guiCreateLabel(254, 32, 149, 31, "Descriere Diplomă:", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[2], 0, 255, 252) GUIEditor.memo[2] = guiCreateMemo(359, 24, 293, 313, "", false, GUIEditor.window[1]) GUIEditor.label[3] = guiCreateLabel(398, 343, 274, 36, "Maxim : 150 Caractere.(Pentru ajutor \n/ajutordiploma)", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[3], 0, 245, 255) GUIEditor.label[4] = guiCreateLabel(7, 71, 155, 36, "Semnătură Director:", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[4], 0, 245, 255) GUIEditor.label[5] = guiCreateLabel(10, 109, 135, 29, "Semnătură Diriginte/ă:", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[5], 0, 245, 255) GUIEditor.edit[1] = guiCreateEdit(77, 21, 130, 30, "", false, GUIEditor.window[1]) GUIEditor.edit[2] = guiCreateEdit(121, 64, 133, 32, "", false, GUIEditor.window[1]) GUIEditor.edit[3] = guiCreateEdit(135, 106, 133, 32, "", false, GUIEditor.window[1]) GUIEditor.label[6] = guiCreateLabel(11, 148, 151, 37, "TIP:", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[6], 0, 245, 255) GUIEditor.combobox[1] = guiCreateComboBox(40, 147, 140, 90, "Diplomă Mechanic", false, GUIEditor.window[1]) guiComboBoxAddItem(GUIEditor.combobox[1], "Diplomă Mechanic") guiComboBoxAddItem(GUIEditor.combobox[1], "Diplomă Medic") guiComboBoxAddItem(GUIEditor.combobox[1], "Diplomă Polițist/ă") guiComboBoxAddItem(GUIEditor.combobox[1], "Diplomă Politică") GUIEditor.button[2] = guiCreateButton(194, 150, 140, 41, "Oferă Diploma", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FF00F5FF") GUIEditor.label[7] = guiCreateLabel(10, 183, 350, 164, "\n\n((OOC , Acest sistem este încă în teste , dacă găsiți o \nproblemă nu ezitați să contactați un membru staff online!\n\n\n\n Mulțumim de înțelegere!\n\nP.S.Să nu abuzați că vă tai semnat Paul_Dima și \n Cojocaru_Daniel", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[7], "default-bold-small") guiLabelSetColor(GUIEditor.label[7], 0, 245, 255) end function arataDiploma() diploma() if not guiGetVisible(GUIEditor.window[1]) then guiSetVisible(GUIEditor.window[1],true) showCursor(true,true) end end end addCommandHandler("oferadiploma",showVehicleSelection) Isn't working.. thank you anyway Link to comment
Dimos7 Posted January 31, 2017 Share Posted January 31, 2017 GUIEditor = { label = {}, edit = {}, button = {}, window = {}, combobox = {}, memo = {} } function diploma() local screenW, screenH = guiGetScreenSize() if (getElementData(player,"faction")) == 4 and ( getElementData(player, "factionleader")) then GUIEditor.window[1] = guiCreateWindow((screenW - 666) / 2, (screenH - 384) / 2, 666, 384, "Diplomă Universitate", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FF00FFFC") GUIEditor.button[1] = guiCreateButton(257, 347, 137, 27, "Ieși", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFFF0000") GUIEditor.label[1] = guiCreateLabel(10, 26, 137, 48, "Nume Elev:", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[1], 0, 255, 252) GUIEditor.memo[1] = guiCreateMemo(181, 4, 20, 20, "", false, GUIEditor.label[1]) GUIEditor.label[2] = guiCreateLabel(254, 32, 149, 31, "Descriere Diplomă:", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[2], 0, 255, 252) GUIEditor.memo[2] = guiCreateMemo(359, 24, 293, 313, "", false, GUIEditor.window[1]) GUIEditor.label[3] = guiCreateLabel(398, 343, 274, 36, "Maxim : 150 Caractere.(Pentru ajutor /ajutordiploma)", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[3], 0, 245, 255) GUIEditor.label[4] = guiCreateLabel(7, 71, 155, 36, "Semnătură Director:", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[4], 0, 245, 255) GUIEditor.label[5] = guiCreateLabel(10, 109, 135, 29, "Semnătură Diriginte/ă:", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[5], 0, 245, 255) GUIEditor.edit[1] = guiCreateEdit(77, 21, 130, 30, "", false, GUIEditor.window[1]) GUIEditor.edit[2] = guiCreateEdit(121, 64, 133, 32, "", false, GUIEditor.window[1]) GUIEditor.edit[3] = guiCreateEdit(135, 106, 133, 32, "", false, GUIEditor.window[1]) GUIEditor.label[6] = guiCreateLabel(11, 148, 151, 37, "TIP:", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[6], 0, 245, 255) GUIEditor.combobox[1] = guiCreateComboBox(40, 147, 140, 90, "Diplomă Mechanic", false, GUIEditor.window[1]) guiComboBoxAddItem(GUIEditor.combobox[1], "Diplomă Mechanic") guiComboBoxAddItem(GUIEditor.combobox[1], "Diplomă Medic") guiComboBoxAddItem(GUIEditor.combobox[1], "Diplomă Polițist/ă") guiComboBoxAddItem(GUIEditor.combobox[1], "Diplomă Politică") GUIEditor.button[2] = guiCreateButton(194, 150, 140, 41, "Oferă Diploma", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FF00F5FF") GUIEditor.label[7] = guiCreateLabel(10, 183, 350, 164, "\n\n((OOC , Acest sistem este încă în teste , dacă găsiți o \nproblemă nu ezitați să contactați un membru staff online!\n\n\n\n Mulțumim de înțelegere!\n\nP.S.Să nu abuzați că vă tai semnat Paul_Dima și \n Cojocaru_Daniel", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[7], "default-bold-small") guiLabelSetColor(GUIEditor.label[7], 0, 245, 255) end function arataDiploma() diploma() if not guiGetVisible(GUIEditor.window[1]) then guiSetVisible(GUIEditor.window[1],true) showCursor(true) end end end addCommandHandler("oferadiploma",arataDiploma) Link to comment
pa3ck Posted January 31, 2017 Share Posted January 31, 2017 Wherever you have "player" change it to localPlayer, I can't see you defined it anywhere. localPlayer is the same as getLocalPlayer(), it's just a predefined variable that comes with MTA.Or if you don't want to change it, put this line to the top of your script: local player = localPlayer Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now