bonsoir ,
j'ai crée un panel et je souhaiterez que les bouton crée fonctionne par exemple le bouton fermer marche mais quand j'essaye de faire marcher la fonction reparer pour fix mon vehicule si je rajoute addcommandHandler ("repair", repair) sa marche mais si je fait addEventHandler("onClientGUIClik", GUIEditor_Button[8], false) rien ne se passe . je comprend pas, je debute dans le script et la je galere vraiment si vous pouviez me donner un coup de main sa serait sympa je met mon Script.lua en dessous.
GUIEditor_Window = {}
GUIEditor_Button = {}
GUIEditor_Window[1] = guiCreateWindow(417, 179, 646, 356, "mecano", false)
GUIEditor_Button[1] = guiCreateButton(26, 39, 111, 20, "amortisseur +1", false, GUIEditor_Window[1])
GUIEditor_Button[2] = guiCreateButton(26, 69, 111, 20, "amortisseur +2", false, GUIEditor_Window[1])
GUIEditor_Button[3] = guiCreateButton(26, 99, 111, 20, "amortisseur +3", false, GUIEditor_Window[1])
GUIEditor_Button[4] = guiCreateButton(26, 129, 111, 20, "amortisseur -1", false, GUIEditor_Window[1])
GUIEditor_Button[5] = guiCreateButton(26, 159, 111, 20, "amortisseur -2", false, GUIEditor_Window[1])
GUIEditor_Button[6] = guiCreateButton(26, 189, 111, 20, "amortisseur -3", false, GUIEditor_Window[1])
GUIEditor_Button[7] = guiCreateButton(25, 244, 112, 41, "immatriculation", false, GUIEditor_Window[1])
GUIEditor_Button[8] = guiCreateButton(24, 301, 113, 38, "reparer", false, GUIEditor_Window[1])
GUIEditor_Button[9] = guiCreateButton(193, 40, 35, 29, "avg +1", false, GUIEditor_Window[1])
GUIEditor_Button[10] = guiCreateButton(193, 139, 35, 29, "arg +1", false, GUIEditor_Window[1])
GUIEditor_Button[11] = guiCreateButton(238, 139, 35, 29, "arg -1", false, GUIEditor_Window[1])
GUIEditor_Button[12] = guiCreateButton(238, 40, 35, 29, "avg -1", false, GUIEditor_Window[1])
GUIEditor_Button[13] = guiCreateButton(319, 40, 35, 29, "avd -1", false, GUIEditor_Window[1])
GUIEditor_Button[14] = guiCreateButton(364, 40, 35, 29, "avd +1", false, GUIEditor_Window[1])
GUIEditor_Button[15] = guiCreateButton(364, 139, 35, 29, "ard +1", false, GUIEditor_Window[1])
GUIEditor_Button[16] = guiCreateButton(319, 139, 35, 29, "ard -1", false, GUIEditor_Window[1])
GUIEditor_Button[17] = guiCreateButton(191, 213, 208, 31, "reprogramation stage 1", false, GUIEditor_Window[1])
GUIEditor_Button[18] = guiCreateButton(191, 260, 208, 31, "reprogramation stage 2", false, GUIEditor_Window[1])
GUIEditor_Button[19] = guiCreateButton(191, 308, 208, 31, "reprogramation stage 3", false, GUIEditor_Window[1])
GUIEditor_Button[20] = guiCreateButton(491, 41, 122, 28, "xenon", false, GUIEditor_Window[1])
GUIEditor_Button[21] = guiCreateButton(491, 79, 122, 28, "origine", false, GUIEditor_Window[1])
GUIEditor_Button[22] = guiCreateButton(491, 121, 122, 28, "hold school", false, GUIEditor_Window[1])
GUIEditor_Button[23] = guiCreateButton(527, 321, 100, 18, "fermer", false, GUIEditor_Window[1])
GUIEditor_Button[24] = guiCreateButton(485, 183, 27, 20, "1", false, GUIEditor_Window[1])
GUIEditor_Button[25] = guiCreateButton(522, 183, 27, 20, "2", false, GUIEditor_Window[1])
GUIEditor_Button[26] = guiCreateButton(559, 183, 27, 20, "3", false, GUIEditor_Window[1])
GUIEditor_Button[27] = guiCreateButton(596, 183, 27, 20, "4", false, GUIEditor_Window[1])
GUIEditor_Button[28] = guiCreateButton(596, 213, 27, 20, "8", false, GUIEditor_Window[1])
GUIEditor_Button[29] = guiCreateButton(559, 213, 27, 20, "7", false, GUIEditor_Window[1])
GUIEditor_Button[30] = guiCreateButton(522, 213, 27, 20, "6", false, GUIEditor_Window[1])
GUIEditor_Button[31] = guiCreateButton(485, 213, 27, 20, "5", false, GUIEditor_Window[1])
GUIEditor_Button[32] = guiCreateButton(485, 243, 27, 20, "9", false, GUIEditor_Window[1])
GUIEditor_Button[33] = guiCreateButton(485, 273, 27, 20, "13", false, GUIEditor_Window[1])
GUIEditor_Button[34] = guiCreateButton(522, 273, 27, 20, "14", false, GUIEditor_Window[1])
GUIEditor_Button[35] = guiCreateButton(559, 273, 27, 20, "15", false, GUIEditor_Window[1])
GUIEditor_Button[36] = guiCreateButton(596, 273, 27, 20, "16", false, GUIEditor_Window[1])
GUIEditor_Button[37] = guiCreateButton(522, 243, 27, 20, "10", false, GUIEditor_Window[1])
GUIEditor_Button[38] = guiCreateButton(559, 243, 27, 20, "11", false, GUIEditor_Window[1])
GUIEditor_Button[39] = guiCreateButton(596, 243, 27, 20, "12", false, GUIEditor_Window[1])
guiSetFont(GUIEditor_Button[1], "sans")
guiWindowSetSizable(GUIEditor_Window[1], false)
guiSetVisible(GUIEditor_Window[1], false)
showCursor(false)
function enableVehicleControl()
if guiGetVisible(GUIEditor_Window[1]) == false then
guiSetVisible(GUIEditor_Window[1], true)
showCursor(true)
else
guiSetVisible(GUIEditor_Window[1], false)
showCursor(false)
end
end
addCommandHandler("tds", enableVehicleControl)
bindKey("f4", "down", enableVehicleControl)
function closeButton()
guiSetVisible(GUIEditor_Window[1], false)
showCursor(false)
end
addEventHandler("onClientGUIClick", GUIEditor_Button[23], closeButton, false)
function repair()
getVehicleDamage = tonumber math.random = getVehicleProcentage
takePlayerMoney (thePlayer, 50, true )
setVehicleFixed
= outputChatBox("You have payed 50$ for your repair", getRootElement(), 125, 125, 0 )
end
addEventHandler("onClientGUIClick", GUIEditor_Button[8], repair, false)