Jump to content

downight

Members
  • Posts

    48
  • Joined

  • Last visited

Everything posted by downight

  1. Now everything doesn't work
  2. I've already added the same code as you guys said before but it still doesn't work because I think there is some conflict with function showUserPanel ()
  3. I want to make a close button "X" but I can't search window_Close to see the button ---SCRIPT BY -RoCk-Alex---- ---copyright -RoCk- clan outputChatBox( "#FFFF00===[HELPMANAGER BY -RoCk-ALEX]===",0,255,0,true ) outputChatBox( "#00FF00===[PRESS F9 TO OPEN IT]===",0,255,0,true ) localPlayer = getLocalPlayer() wnd_window = {} local btnClose addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource() ), function ( theResource ) --outputConsole( "wnd_showServerInfo called" ) --outputConsole( " source: ".. tostring( source ) ) --outputConsole( " resourceStarted: ".. tostring( theResource ) ) if source == getResourceRootElement( theResource ) then --outputConsole( " passed if: source == resource" ) local cmd = xmlLoadFile( "cmd.xml" ) local cmd1 = xmlNodeGetValue( cmd ) local member = xmlLoadFile( "member.xml" ) local member1 = xmlNodeGetValue( member ) local other = xmlLoadFile( "other.xml" ) local other1 = xmlNodeGetValue( other ) local server = xmlLoadFile( "server.xml" ) local server1 = xmlNodeGetValue( server ) wnd_create( cmd1, member1, other1, server1 ) end end ) function wnd_create( cmd, member, other, server ) GUIEditor_TabPanel = {} GUIEditor_Tab = {} GUIEditor_Memo = {} GUIEditor_Image = {} window = guiCreateWindow(305,119,1026,740,"Help",false) guiSetProperty(window, "CaptionColour", "FF80FF00") guiSetAlpha(window,1) guiWindowSetSizable(window,false) background = guiCreateStaticImage(0.0165,0.0200,0.9669,0.9191,"images/Black-Texture-Background-1280x800.png",true,window) guiSetAlpha(background,1) guiSetProperty(background,"Disabled","true") GUIEditor_Image[1] = guiCreateStaticImage(0.3100,0.0200,0.4000,0.4000,"images/title.png",true,window) guiSetAlpha(GUIEditor_Image[1],1) guiSetProperty(GUIEditor_Image[1],"Disabled","true") GUIEditor_TabPanel[1] = guiCreateTabPanel(0.0404,0.2457,0.921,0.6936,true,window) guiSetAlpha(GUIEditor_TabPanel[1],1) tabcmd = guiCreateTab("-RoCk-basemode Commands",GUIEditor_TabPanel[1]) guiSetAlpha(tabcmd,1) GUIEditor_Memo[1] = guiCreateMemo(0.008,0.0231,0.984,0.9583,cmd,true,tabcmd) guiSetAlpha(GUIEditor_Memo[1],1) GUIEditor_Tab[1] = guiCreateTab("-RoCk Members",GUIEditor_TabPanel[1]) guiSetAlpha(GUIEditor_Tab[1],1) GUIEditor_Memo[2] = guiCreateMemo(0.01,0.0324,0.98,0.9444,member,true,GUIEditor_Tab[1]) guiSetAlpha(GUIEditor_Memo[2],1) GUIEditor_Tab[2] = guiCreateTab("-RoCk- news",GUIEditor_TabPanel[1]) guiSetAlpha(GUIEditor_Tab[2],1) GUIEditor_Memo[3] = guiCreateMemo(0.008,0.0185,0.982,0.963,other,true,GUIEditor_Tab[2]) guiSetAlpha(GUIEditor_Memo[2],1) GUIEditor_Tab[2] = guiCreateTab("Server Info",GUIEditor_TabPanel[1]) guiSetAlpha(GUIEditor_Tab[2],1) GUIEditor_Memo[4] = guiCreateMemo(0.008,0.0185,0.982,0.963,server,true,GUIEditor_Tab[2]) guiSetAlpha(GUIEditor_Memo[4],1) guiMemoSetReadOnly(GUIEditor_Memo[1],true) guiMemoSetReadOnly(GUIEditor_Memo[2],true) guiMemoSetReadOnly(GUIEditor_Memo[3],true) guiMemoSetReadOnly(GUIEditor_Memo[4],true) window_Close = guiCreateButton(659,700,39,31,"X",false,window) guiSetFont(window_Close,"default-bold-small") guiSetProperty(window_Close, "NormalTextColour", "FF80FF00") end -- BIND THE TOUCH F9 function onresourceStart () bindKey ("F9", "down", showUserPanel) guiSetVisible (window, false) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onresourceStart) function showUserPanel () getVisible = guiGetVisible (window) playerName = getPlayerName ( getLocalPlayer() ) if (getVisible == true) then guiSetVisible (window, false) showCursor (false) playSound("open.wav") end if (getVisible == false) then guiSetVisible (window, true) showCursor (true) playSound("open.wav") end end
  4. It works man THANK YOU but I forgot to add that I want it when the map starts also lol... e/ I just enabled both scripts and does the job good lolz so you don't have to make one out of two no more I guess
  5. So i checked logs and he was using aexec command. Thanks for posts though.
  6. But I am the admin of it, bah I'm the server owner, it's just one of my teammates gave it to him. If you have any knowledge how is he doing that, I'd highly appreciate your effort
  7. I'm playing on the server and suddenly someones types some text from my nick so it looks like im typing it? Or typing /redo or any command so it looks like i am doing it. How is that possible? Someone gave admin to a strange guy and I think he is doing this but not sure how. HELP!
  8. Hi, I want to bind this (it's original, without bind): local SCREEN_WIDTH, SCREEN_HEIGHT = guiGetScreenSize() local name, author, lastTimePlayed, spawnPointCount, playedCount, modename local startTick local enabled = false local drawTime = 10000 local month = {"January","February","March","April","May","June","July","August","September","October","November","December"} function timestampToDate(stamp) local time = getRealTime(stamp) return string.format("%d %s %02d:%02d",time.monthday,month[time.month+1],time.hour,time.minute) end function handleMapInfo(mapInfo) name = mapInfo.name or "Unknown" author = mapInfo.author or "Unknown" lastTimePlayed = timestampToDate(mapInfo.lastTimePlayed) or "Unknown" spawnPointCount = tostring(mapInfo.spawnPointCount) playedCount = tostring(mapInfo.playedCount or "Unknown") modename = mapInfo.modename ~= "Destruction derby" and mapInfo.modename or "DD / DM" startTick = getTickCount() if not enabled then addEventHandler("onClientRender",getRootElement(),handleOnRender) enabled = true end end addEvent("onClientMapStarting",true) addEventHandler("onClientMapStarting",getRootElement(),handleMapInfo) function handleOnRender() local time = getTickCount() - startTick local alphaFactor if time < 1000 then alphaFactor = time / 1000 elseif time >= 1000 and time < drawTime + 1000 then alphaFactor = 1 elseif time >= drawTime + 1000 and time < drawTime + 2000 then alphaFactor = 1 - (time - (drawTime + 1000)) / 1000 elseif time >= drawTime + 2000 then enabled = false removeEventHandler("onClientRender",getRootElement(),handleOnRender) return end local maxLabelWidth = 81 local nameWidth = dxGetTextWidth(name,1,"default-bold") local authorWidth = dxGetTextWidth(author) + maxLabelWidth local lastTimePlayedWidth = dxGetTextWidth(lastTimePlayed) + maxLabelWidth local spawnPointCountWidth = dxGetTextWidth(spawnPointCount) + maxLabelWidth local playedCountWidth = dxGetTextWidth(playedCount) + maxLabelWidth local modenameWidth = dxGetTextWidth(modename) + maxLabelWidth local width = math.max(nameWidth,authorWidth,lastTimePlayedWidth,spawnPointCountWidth,playedCountWidth,modenameWidth) + 10 local height = 100 local x = SCREEN_WIDTH - width local y = SCREEN_HEIGHT / 1.3 - height / 1.3 dxDrawRectangle(x,y,width,20,tocolor(0,0,0,255*alphaFactor)) dxDrawRectangle(x,y + 20,width,height - 20,tocolor(0,0,0,200*alphaFactor)) dxDrawText(name,x,y,x+width,y+20,tocolor(97,255,19*alphaFactor),1,"default-bold","center","center") dxDrawText("Author:\nTipo:\nSpawnpoints:\ntimes played:\nlast time:",x+5,y+20,0,0,tocolor(97,255,19*alphaFactor),1,"default-bold") dxDrawText(string.format("%s\n%s\n%s\n%s\n%s",author,modename,spawnPointCount,playedCount,lastTimePlayed),x+5+maxLabelWidth,y+20,0,0,tocolor(255,255,255*alphaFactor)) end The script is shown when the map is started so it shows you proper map information: but when I tried to bind it as letter "m", It shows the "default" info (should be the same as the image above): I don't know what's going on
  9. Thank you, myonlake and WASSIm. whose code is working THANKS GUYS
  10. So I want to make something like when player quits the game the msg pops up: "Playername from [country] has left the game (reason)" but my code doesn't work. Look: local root = getRootElement() countryNames = { ["IT"]="Italy", ["MX"]="Mexico", ["SA"]="SAUDI ARBIA", ["PK"]="Pakistan", ["AF"]="Afghanistan", ["DZ"]="Algeria", ["AS"]="American samoa", ["AU"]="Australlia", ["AO"]="Anqola", ["AI"]="Anquilla", ["AQ"]="Antarctica", ["AG"]="Antigua and Barbuda", ["AR"]="Argentina", ["AM"]="Armenia", ["AW"]="Aruba", ["AT"]="Austria", ["AZ"]="Azerbaijan", ["BS"]="Bahamas", ["BH"]="Bahrain", ["BD"]="Bangladesh", ["BB"]="Barbados", ["BY"]="Belarus", ["BE"]="Belgium", ["BZ"]="Belize", ["BJ"]="Benin", ["BM"]="Bermuda", ["BT"]="Bhutan", ["BO"]="Bolivia", ["BA"]="Bosnia", ["BH"]="Herzegovina", ["BW"]="Botswana", ["BR"]="Brazil", ["IO"]="British Indian Ocean Territory", ["VG"]="British Virgin Islands", ["BN"]="Brunei", ["BG"]="Bulgaria", ["BF"]="Burkina Faso", ["MM"]="Burma (Myanmar)", ["BI"]="Burundi", ["KH"]="Cambodia", ["CM"]="Cameroon", ["CA"]="Canada", ["CV"]="Cape Verde", ["KY"]="Cayman Islands", ["CF"]="Central African Republic", ["TD"]="Chad", ["CL"]="Chile", ["CN"]="China", ["CX"]="Christmas Island", ["CC"]="Cocos (Keeling) Islands", ["CO"]="Colombia", ["KM"]="Comoros", ["CK"]="Cook Islands", ["CR"]="Costa Rica", ["HR"]="Croatia", ["CU"]="Cuba", ["CY"]="Cyprus", ["CZ"]="Czech Republic", ["CD"]="Democratic Republic of the Congo", ["DK"]="Denmark", ["DJ"]="Djibouti", ["DM"]="Dominica", ["DO"]="Dominican Republic", ["EC"]="Ecuador", ["SV"]="El Salvador", ["GQ"]="Equatorial Guinea", ["ER"]="Eritrea", ["EE"]="Estonia", ["ET"]="Ethiopia", ["FK"]="Falkland Islands", ["FO"]="Faroe Islands", ["FJ"]="Fiji", ["FI"]="Finland", ["FR"]="France", ["PF"]="French Polynesia", ["GA"]="Gabon", ["GM"]="Gambia", ["GE"]="Georgia", ["DE"]="Germany", ["GH"]="Ghana", ["GI"]="Gibraltar", ["GR"]="Greece", ["GL"]="Greenland", ["GD"]="Grenada", ["GU"]="Guam", ["GT"]="Guatemala", ["GN"]="Guinea", ["GW"]="Guinea-Bissau", ["GY"]="Guyana", ["HT"]="Haiti", ["VA"]="Holy See (Vatican City)", ["HN"]="Honduras", ["HK"]="Hong Kong", ["HU"]="Hungary", ["IS"]="Iceland", ["IN"]="India", ["ID"]="Indonesia", ["IR"]="Iran", ["IQ"]="Iraq", ["IE"]="Ireland", ["IM"]="Isle of Man", ["IL"]="Israel", ["IT"]="Italy", ["CI"]="Ivory Coast", ["JM"]="Jamaica", ["JP"]="Japan", ["JE"]="Jersey", ["JO"]="Jordan", ["KZ"]="Kazakhstan", ["KE"]="Kenya", ["KI"]="Kiribati", ["KO"]="Kosovo", ["KW"]="Kuwait", ["KG"]="Kyrgyzstan", ["LA"]="Laos", ["LV"]="Latvia", ["LB"]="Lebanon", ["LS"]="Lesotho", ["LR"]="Liberia", ["LY"]="Libya", ["LI"]="Liechtenstein", ["LT"]="Lithuania", ["LU"]="Luxembourg", ["MO"]="Macau", ["MK"]="Macedonia", ["MG"]="Madagascar", ["MW"]="Malawi", ["MY"]="Malaysia", ["MV"]="Maldives", ["ML"]="Mali", ["MT"]="Malta", ["MH"]="Marshall Islands", ["MR"]="Mauritania", ["MU"]="Mauritius", ["YT"]="Mayotte", ["MX"]="Mexico", ["FM"]="Micronesia", ["MD"]="Moldova", ["MC"]="Monaco", ["MN"]="Mongolia", ["ME"]="Montenegro", ["MS"]="Montserrat", ["MA"]="Morocco", ["MZ"]="Mozambique", ["NA"]="Namibia", ["NR"]="Nauru", ["NP"]="Nepal", ["NL"]="Netherlands", ["AN"]="Netherlands Antilles", ["NC"]="New Caledonia", ["NZ"]="New Zealand", ["NI"]="Nicaragua", ["NE"]="Niger", ["NG"]="Nigeria", ["NU"]="Niue", ["NI"]="Norfolk Island", ["KP"]="North Korea", ["MP"]="Northern Mariana Islands", ["NO"]="Norway", ["OM"]="Oman", ["PK"]="Pakistan", ["PW"]="Palau", ["PA"]="Panama", ["PG"]="Papua New Guinea", ["PY"]="Paraguay", ["PE"]="Peru", ["PH"]="Philippines", ["PN"]="Pitcairn Islands", ["PL"]="Poland", ["PT"]="Portugal", ["PR"]="Puerto Rico", ["QA"]="Qatar", ["CG"]="Republic of the Congo", ["RO"]="Romania", ["RU"]="Russia", ["RW"]="Rwanda", ["BL"]="Saint Barthelemy", ["SH"]="Saint Helena", ["KN"]="Saint Kitts and Nevis", ["LC"]="Saint Lucia", ["MF"]="Saint Martin", ["PM"]="Saint Pierre and Miquelon", ["VC"]="Saint Vincent and the Grenadines", ["WS"]="Samoa", ["SM"]="San Marino", ["ST"]="Sao Tome and Principe", ["SA"]="Saudi Arabia", ["SN"]="Senegal", ["RS"]="Serbia", ["SC"]="Seychelles", ["SL"]="Sierra Leone", ["SG"]="Singapore", ["SK"]="Slovakia", ["SI"]="Slovenia", ["SB"]="Solomon Islands", ["SO"]="Somalia", ["ZA"]="South Africa", ["KR"]="South Korea", ["ES"]="Spain", ["LK"]="Sri Lanka", ["SD"]="Sudan", ["SR"]="Suriname", ["SJ"]="Svalbard", ["SZ"]="Swaziland", ["SE"]="Sweden", ["CH"]="Switzerland", ["SY"]="Syria", ["TW"]="Taiwan", ["TJ"]="Tajikistan", ["TZ"]="Tanzania", ["TH"]="Thailand", ["TL"]="Timor-Leste", ["TG"]="Togo", ["TK"]="Tokelau", ["TO"]="Tonga", ["TT"]="Trinidad and Tobago", ["TN"]="Tunisia", ["TR"]="Turkey", ["TM"]="Turkmenistan", ["TC"]="Turks and Caicos Islands", ["TV"]="Tuvalu", ["UG"]="Uganda", ["UA"]="Ukraine", ["AE"]="United Arab Emirates", ["GB"]="United Kingdom", ["US"]="United States", ["UY"]="Uruguay", ["VI"]="US Virgin Islands", ["UZ"]="Uzbekistan", ["VU"]="Vanuatu", ["VE"]="Venezuela", ["VN"]="Vietnam", ["WF"]="Wallis and Futuna", ["WB"]="West Bank", ["EH"]="Western Sahara", ["YE"]="Yemen", ["ZM"]="Zambia", ["ZW"]="Zimbabwe" } function showHome () local quiterPlayerName = getPlayerName ( source ) local countryCode = exports["admin"]:getPlayerCountry(source) function quiterPlayer ( quitReason ) local quiterPlayerName = getPlayerName ( source ) setElementData(source,"Country",countryNames[countryCode]) outputChatBox("* " ..getPlayerName(source) .." from ".. tostring(countryNames[countryCode]) .." has left the game (" .. quitReason .. ")",getRootElement(),97,255,19) end
  11. THANK YOU MAN! I just changed a code little bit: function getPlayerFromNamePart(name) if name then for i, player in ipairs(getElementsByType("player")) do if string.find(getPlayerName(player):lower(), tostring(name):lower(), 1, true) then return player end end end return false end function saytext(thePlayer, command,argument) if argument then local player = getPlayerFromNamePart(argument) if player then outputChatBox ( "*" .. getPlayerName(thePlayer).. " is laughing out loud at " .. getPlayerName(player) .. "!", root, 255, 0, 0, true) end else outputChatBox ("*" .. getPlayerName(thePlayer).. " is laughing out loud!", root, 255, 0, 0, true) end end addCommandHandler ( "lol", saytext )
  12. Yes man. This is what I wanted! Now I just want to combine these two. /lol - Player is laughing out loud! and /lol [nick] - Player is laughing out loud at [nick]. The /lol [nick] is done but I need /lol alone to be working too somehow.
  13. But I want to make it like that Two people: downight and intmain I type /lol int and it recognizes his nick and server says: downight is laughing out loud at intmain. You know what I'm talking about?
  14. This doesn't even work And I wanted laughing out loud at [someone]
  15. I made this: function saytext(player, command) outputChatBox ( "[ "..getPlayerName(player).." ] is laughing out loud!", root, 255, 0, 0, true) end addCommandHandler ( "lol", saytext ) but I also want to have laughing out loud at [here is typed player name]. I heard it is possible with this: function getPlayerFromNamePart(name) if name then for i, player in ipairs(getElementsByType("player")) do if string.find(getPlayerName(player):lower(), tostring(name):lower(), 1, true) then return player end end end return false end I want to make it like that: someone types /lol - the message on server says [playername] is laughing out loud! and also I want /lol [playernamepart] and it says [playername] is laughing out loud at [playernamepart] for example: my nick is downight and the other person nick is intmain. I want to type just /lol int so it will automatically recognize his nick. but I don't know how to do this + make it one script out of two. Please help
×
×
  • Create New...