Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. That's what I thought. Topic locked.
  2. Bueno, me parece que aca todos se fueron del tema principal, no veo el punto de este tema. Tema cerrado.
  3. It looks like you got it incomplete, since it has a missing server side part.
  4. You can make your own log system, but it may be harder to implement it than fixing your script errors.
  5. Well, you could just disable it.
  6. if ( string.find ( guiGetText ( chatLabel ), "/" ) ) then local cleanCommand = string.gsub ( guiGetText ( chatLabel ), "/", "" ) local params = { } if string.find ( guiGetText ( chatLabel ), " " ) then params = split ( cleanCommand, " " ) end triggerServerEvent ( "executeCommand", localPlayer, cleanCommand, unpack ( params ) ) Try that.
  7. You want to put it down the screen? on the center?
  8. DId you make that script?
  9. Castillo

    help

    You must use the event: onZombieWasted then you must trigger to the client side, with: triggerClientEvent
  10. addEventHandler("onClientRender", root, function() local it = getPlayerName(localPlayer):gsub ("#%x%x%x%x%x%x","") local score = tostring ( tonumber ( getElementData ( localPlayer, "Score" ) ) or 0 ) local money = getPlayerMoney(localplayer) local x, y = guiGetScreenSize() dxDrawRectangle(0/x, 725/y, 1024, 43, tocolor(0, 155, 255, 160), true) --x 0, y 725 dxDrawText("Nick: "..it, 90, 730, 362, 759, tocolor(0, 0, 0, 255), 1.00, "pricedown", "left", "bottom", false, false, true, false, false) dxDrawText("Nick: "..it, 90, 728, 362, 757, tocolor(0, 0, 0, 255), 1.00, "pricedown", "left", "bottom", false, false, true, false, false) dxDrawText("Nick: "..it, 88, 730, 360, 759, tocolor(0, 0, 0, 255), 1.00, "pricedown", "left", "bottom", false, false, true, false, false) dxDrawText("Nick: "..it, 88, 728, 360, 757, tocolor(0, 0, 0, 255), 1.00, "pricedown", "left", "bottom", false, false, true, false, false) dxDrawText("Nick: "..it, 89, 729, 361, 758, tocolor(255, 255, 255, 255), 1.00, "pricedown", "left", "bottom", false, false, true, false, false) dxDrawText(" Score: "..score, 367, 730, 639, 759, tocolor(0, 0, 0, 255), 1.00, "pricedown", "left", "bottom", false, false, true, false, false) dxDrawText(" Score: "..score, 367, 728, 639, 757, tocolor(0, 0, 0, 255), 1.00, "pricedown", "left", "bottom", false, false, true, false, false) dxDrawText(" Score: "..score, 365, 730, 637, 759, tocolor(0, 0, 0, 255), 1.00, "pricedown", "left", "bottom", false, false, true, false, false) dxDrawText(" Score: "..score, 365, 728, 637, 757, tocolor(0, 0, 0, 255), 1.00, "pricedown", "left", "bottom", false, false, true, false, false) dxDrawText(" Score: "..score, 366, 729, 638, 758, tocolor(255, 255, 255, 255), 1.00, "pricedown", "left", "bottom", false, false, true, false, false) dxDrawText("Pieniadze: "..money.." $", 643, 730, 915, 759, tocolor(0, 0, 0, 255), 1.00, "pricedown", "left", "bottom", false, false, true, false, false) dxDrawText("Pieniadze: "..money.." $", 643, 728, 915, 757, tocolor(0, 0, 0, 255), 1.00, "pricedown", "left", "bottom", false, false, true, false, false) dxDrawText("Pieniadze: "..money.." $", 641, 730, 913, 759, tocolor(0, 0, 0, 255), 1.00, "pricedown", "left", "bottom", false, false, true, false, false) dxDrawText("Pieniadze: "..money.." $", 641, 728, 913, 757, tocolor(0, 0, 0, 255), 1.00, "pricedown", "left", "bottom", false, false, true, false, false) dxDrawText("Pieniadze: "..money.." $", 642, 729, 914, 758, tocolor(255, 255, 255, 255), 1.00, "pricedown", "left", "bottom", false, false, true, false, false) end )
  11. You can't, but you could create your own.
  12. Castillo

    /admins

    addCommandHandler getElementsByType ( "player" ) getPlayerAccount getAccountName isObjectInACLGroup outputChatBox
  13. What do you mean by "upgrade"?
  14. Castillo

    Need help,

    I learnt by trial & error and used the forum/friends for questions.
  15. Got it, you are adding the event handler for the onClientGUIClick over and over again. addEventHandler("onClientRender",getRootElement(), function () local x,y = guiGetScreenSize() dxDrawText("PTP 0.12 BETA", x*0.75,y*0.9, 1270, 923, tocolor(255, 255, 255, 255), 2.00, "pricedown", "left", "top", false, false, true, false, false) end ); addEvent("setPlayersCamera",true); addEventHandler("setPlayersCamera",getRootElement(), function () local matrix = setCameraMatrix(1572.1561279297,-1808.7569580078,76.464111328125,1475.1350097656,-1677.6148681641,13.301302909851); setTimer(getRandomCameraPos,10000,1); setTime(5,30); setWeather(1); setCloudsEnabled(false); showCursor(true); end); function getRandomCameraPos() if getElementData(getLocalPlayer(),"login") == "notLoggedIn" then local randomPos = math.random(5) if randomPos == 1 then setCameraMatrix(1028.6870117188,-2036.8507080078,109.07088470459,1172.0684814453,-2036.7298583984,68.401649475098); setTime(5,30); setTimer(getRandomCameraPos,10000,1); elseif randomPos == 2 then setCameraMatrix(220.54316711426,-2030.2954101563,46.9792137146,134.67477416992,-1884.3803710938,2.1879935264587); setTime(5,30); setTimer(getRandomCameraPos,10000,1); elseif randomPos == 3 then setCameraMatrix(1931.7719726563,1192.240234375,97.54972076416,2142.6896972656,1271.0296630859,15.921746253967); setTime(5,30); setTimer(getRandomCameraPos,10000,1); elseif randomPos == 4 then setCameraMatrix(2131.0710449219,921.58319091797,55.947288513184,2016.5047607422,1038.0780029297,10.486658096313); setTime(5,30); setTimer(getRandomCameraPos,10000,1); elseif randomPos == 5 then setCameraMatrix(1572.1561279297,-1808.7569580078,76.464111328125,1475.1350097656,-1677.6148681641,13.301302909851); setTime(5,30); setTimer(getRandomCameraPos,10000,1); end; end; end; GUIEditor = { tab = {}, tabpanel = {}, edit = {}, button = {}, window = {}, label = {}, checkbox = {} } addEvent("showStartGUI",true); addEventHandler("showStartGUI",getRootElement(), function () local sW,sH = guiGetScreenSize() local lpW,lpH = 263, 295 GUIEditor.window[1] = guiCreateWindow(sW/2-lpW/2, sH/2-lpH/2, lpW, lpH, "Welcome to PTP", false); guiWindowSetSizable(GUIEditor.window[1], false); guiSetAlpha(GUIEditor.window[1], 0.00); GUIEditor.tabpanel[1] = guiCreateTabPanel(9, 25, 244, 356, false, GUIEditor.window[1]); GUIEditor.tab[1] = guiCreateTab("Login", GUIEditor.tabpanel[1]); GUIEditor.edit[1] = guiCreateEdit(7, 49, 227, 34, "", false, GUIEditor.tab[1]); GUIEditor.label[1] = guiCreateLabel(7, 36, 227, 13, "Username", false, GUIEditor.tab[1]); guiSetFont(GUIEditor.label[1], "default-bold-small"); guiLabelSetHorizontalAlign(GUIEditor.label[1], "center", false); GUIEditor.label[2] = guiCreateLabel(7, 13, 227, 13, "Please login to have all functions!", false, GUIEditor.tab[1]); guiSetFont(GUIEditor.label[2], "default-bold-small"); guiLabelSetHorizontalAlign(GUIEditor.label[2], "center", false); GUIEditor.edit[2] = guiCreateEdit(7, 107, 227, 34, "", false, GUIEditor.tab[1]); guiEditSetMasked(GUIEditor.edit[2], true); GUIEditor.checkbox[1] = guiCreateCheckBox(7, 42, 15, 15, "", false, false, GUIEditor.edit[2]); GUIEditor.label[3] = guiCreateLabel(7, 93, 227, 13, "Password", false, GUIEditor.tab[1]); guiSetFont(GUIEditor.label[3], "default-bold-small"); guiLabelSetHorizontalAlign(GUIEditor.label[3], "center", false); GUIEditor.checkbox[2] = guiCreateCheckBox(7, 151, 15, 15, "", true, false, GUIEditor.tab[1]); GUIEditor.label[4] = guiCreateLabel(26, 150, 153, 16, "Remember me", false, GUIEditor.tab[1]); guiSetFont(GUIEditor.label[4], "default-bold-small"); GUIEditor.button[1] = guiCreateButton(9, 185, 229, 46, "Login and Play", false, GUIEditor.tab[1]); guiSetFont(GUIEditor.button[1], "default-bold-small"); guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA"); GUIEditor.tab[2] = guiCreateTab("Register", GUIEditor.tabpanel[1]); GUIEditor.label[5] = guiCreateLabel(5, 12, 234, 15, "Username", false, GUIEditor.tab[2]); guiSetFont(GUIEditor.label[5], "default-bold-small"); guiLabelSetHorizontalAlign(GUIEditor.label[5], "center", false); GUIEditor.edit[3] = guiCreateEdit(7, 27, 227, 35, "", false, GUIEditor.tab[2]); GUIEditor.label[6] = guiCreateLabel(5, 72, 234, 15, "Password", false, GUIEditor.tab[2]); guiSetFont(GUIEditor.label[6], "default-bold-small"); guiLabelSetHorizontalAlign(GUIEditor.label[6], "center", false); GUIEditor.edit[4] = guiCreateEdit(7, 87, 227, 35, "", false, GUIEditor.tab[2]); GUIEditor.edit[5] = guiCreateEdit(7, 148, 227, 35, "", false, GUIEditor.tab[2]); GUIEditor.label[7] = guiCreateLabel(5, 132, 234, 15, "Password Confirmation", false, GUIEditor.tab[2]); guiSetFont(GUIEditor.label[7], "default-bold-small"); guiLabelSetHorizontalAlign(GUIEditor.label[7], "center", false); GUIEditor.button[2] = guiCreateButton(11, 191, 218, 42, "Register", false, GUIEditor.tab[2]); guiSetFont(GUIEditor.button[2], "default-bold-small"); guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFAAAAAA"); addEventHandler("onClientGUIClick",GUIEditor.button[1],loginFunctionClient,false); addEventHandler("onClientGUIClick",GUIEditor.button[2],registerFunctionClient,false); guiSetInputEnabled(true); local alpha = 0.00; setTimer(function() alpha = alpha + 0.02; guiSetAlpha(GUIEditor.window[1],alpha); end, 50, 50); end); function loginFunctionClient() local username = guiGetText(GUIEditor.edit[1]); local password = guiGetText(GUIEditor.edit[2]); if string.len(username) >= 4 and string.len(username) <= 36 then if string.len(password) >= 4 and string.len(password) <= 36 then triggerServerEvent("loginIntoAccount",getLocalPlayer(),username,password); saveLoginToXML(); else outputChatBox("#00CC00[PTP]#FFFFFF Invalid password length! Minimum: 4, Maximum: 36 !",0,0,0,true); end; else outputChatBox("#00CC00[PTP]#FFFFFF Invalid username length! Minimum: 4, Maximum: 36 !",0,0,0,true); end; end; function registerFunctionClient() local username = guiGetText(GUIEditor.edit[3]); local password = guiGetText(GUIEditor.edit[4]); local passwordconfirm = guiGetText(GUIEditor.edit[5]); if string.len(username) >= 4 and string.len(username) <= 36 then if string.len(password) >= 4 and string.len(password) <= 36 then if string.len(passwordconfirm) >= 4 and string.len(passwordconfirm) <= 36 then triggerServerEvent("registernewAccount",getLocalPlayer(),username,password,passwordconfirm); else outputChatBox("#00CC00[PTP]#FFFFFF Invalid passwordconfirm length! Minimum: 4, Maximum: 36 !",0,0,0,true); end; else outputChatBox("#00CC00[PTP]#FFFFFF Invalied password length! Minimum: 4, Maximum: 36 !",0,0,0,true); end; else outputChatBox("#00CC00[PTP]#FFFFFF Invalid username length! Minimum: 4, Maximum: 36 !",0,0,0,true); end; end; addEvent("fadeLoginGuiOut",true); addEventHandler("fadeLoginGuiOut",getRootElement(), function() outputChatBox("holiker") local alpha = 1.00; setTimer(function() alpha = alpha - 0.02; guiSetAlpha(GUIEditor.window[1],alpha); end, 50, 50); setTimer(function() destroyElement(GUIEditor.window[1]) fadeCamera(true) end, 3500, 1); triggerServerEvent("spawnPlayerForSkinChange",getLocalPlayer()); end); function saveLoginToXML() local username = guiGetText(GUIEditor.edit[1]); local password = guiGetText(GUIEditor.edit[2]); local xmlFile = xmlLoadFile("accountdata.xml"); if not xmlFile then xmlFile = xmlCreateFile("accountdata.xml","settings"); end; xmlNodeSetAttribute(xmlFile,"username",tostring(username)); xmlNodeSetAttribute(xmlFile,"password",tostring(password)); xmlNodeSetAttribute(xmlFile,"saved","true"); xmlSaveFile(xmlFile); xmlUnloadFile(xmlFile); end; addEvent("showFractionMenu",true); addEventHandler("showFractionMenu",getRootElement(), function () local x, y = guiGetScreenSize() local x2,y2 = 599, 178 PTP_Window_Fraction = guiCreateWindow(x/2-x2/2, 0, x2, y2, "PTP 0.12 BETA Fraction Menu", false) guiWindowSetSizable(PTP_Window_Fraction, false) guiSetAlpha(PTP_Window_Fraction,0.00) guiSetVisible(PTP_Window_Fraction,true) local alpha = 0.00 setTimer(function() alpha = alpha + 0.02 guiSetAlpha(PTP_Window_Fraction, alpha) end, 50, 50) GUIEditor.label[1] = guiCreateLabel(19, 21, 557, 15, "You can choose between different fractions. Please choose your fraction now!", false, PTP_Window_Fraction) guiSetFont(GUIEditor.label[1], "default-bold-small") guiLabelSetHorizontalAlign(GUIEditor.label[1], "center", false) GUIEditor.label[2] = guiCreateLabel(203, 50, 100, 15, "President Status:", false, PTP_Window_Fraction) guiSetFont(GUIEditor.label[2], "default-bold-small") GUIEditor.label[3] = guiCreateLabel(181, 65, 122, 15, "Vicepresident Status:", false, PTP_Window_Fraction) guiSetFont(GUIEditor.label[3], "default-bold-small") GUIEditor.label[4] = guiCreateLabel(307, 50, 84, 15, "AVIABLE", false, PTP_Window_Fraction) guiSetFont(GUIEditor.label[4], "default-bold-small") guiLabelSetColor(GUIEditor.label[4], 35, 255, 0) GUIEditor.label[5] = guiCreateLabel(307, 65, 84, 15, "UNAVIABLE", false, PTP_Window_Fraction) guiSetFont(GUIEditor.label[5], "default-bold-small") guiLabelSetColor(GUIEditor.label[5], 248, 6, 6) GUIEditor.button[1] = guiCreateButton(9, 129, 109, 39, "President", false, PTP_Window_Fraction) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") GUIEditor.button[2] = guiCreateButton(128, 129, 109, 39, "Vicepresident", false, PTP_Window_Fraction) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFAAAAAA") GUIEditor.button[3] = guiCreateButton(247, 129, 109, 39, "Security", false, PTP_Window_Fraction) guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FFAAAAAA") GUIEditor.button[4] = guiCreateButton(366, 129, 109, 39, "Terrorist", false, PTP_Window_Fraction) guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FFAAAAAA") GUIEditor.button[5] = guiCreateButton(487, 129, 104, 39, "Civilian", false, PTP_Window_Fraction) guiSetProperty(GUIEditor.button[5], "NormalTextColour", "FFAAAAAA") GUIEditor.label[6] = guiCreateLabel(104, 104, 381, 15, "Skin will be randomly picked up!", false, PTP_Window_Fraction) guiSetFont(GUIEditor.label[6], "default-bold-small") guiLabelSetHorizontalAlign(GUIEditor.label[6], "center", false) addEventHandler("onClientRender",getRootElement(),checkFraction) showCursor(true) end); addCommandHandler("skin",function() triggerEvent("showFractionMenu",getLocalPlayer()) end); -- DEBUG addEventHandler("onClientGUIClick",getRootElement(), function () if source == GUIEditor.button[1] then if guiGetText(GUIEditor.label[4]) == "AVAILABLE" then triggerServerEvent("spawnNewPresident",getLocalPlayer()) elseif guiGetText(GUIEditor.label[4]) == "NOT AVAILABLE" then outputChatBox("#00CC00[PTP]#FFFFFF President is currently not available!",0,0,0,true) end elseif source == GUIEditor.button[2] then if guiGetText(GUIEditor.label[5]) == "AVAILABLE" then -- elseif guiGetText(GUIEditor.label[5]) == "NOT AVAILABLE" then outputChatBox("#00CC00[PTP]#FFFFFF Vicepresident is currently not available!",0,0,0,true) end elseif source == GUIEditor.button[3] then triggerServerEvent("spawnNewSecurity",getLocalPlayer()) elseif source == GUIEditor.button[4] then -- elseif source == GUIEditor.button[5] then -- end end) function checkFraction()
  16. Can you post the whole client side?
  17. El tipo de element es "vehicle" no "theVehicle", ademas de que te faltan parenthesis, uno antes de getElementsByType y el otro para cerrarlo.
×
×
  • Create New...