Jump to content

codeluaeveryday

Members
  • Posts

    575
  • Joined

Everything posted by codeluaeveryday

  1. I did not, I said you're lovely. NO NEVAHHHH
  2. Cool. @Castillo. How do I create a new wiki page... I've looked and looked... I would love this in the useful functions. First ill add more features. @Ben, my script was meant to be returning all admins/mods/smods.
  3. Hey all, i've created a function which gets all online admins. Source: function getOnlineAdmins() count = 0 online = "" for i, v in ipairs(getElementsByType("player")) do if hasObjectPermissionTo(v,"function.setPlayerMuted",true) then online = getPlayerName(v).." "..online count = count+1 end end return online, count end Returns: A string of admins, spaced out. Example: function getOnlineAdmins() count = 0 online = "" for i, v in ipairs(getElementsByType("player")) do if hasObjectPermissionTo(v,"function.setPlayerMuted",true) then online = getPlayerName(v).." "..online count = count+1 end end return online, count end addCommandHandler("test", function() local online, count = getOnlineAdmins() outputChatBox("ONLINE: ("..count..") "..online) end ) This will say in chatbox if one admin in online aka me.. ONLINE: 1 csmit195. I hope you enjoy my source code. Take a look at my new admins resource. https://community.multitheftauto.com/index.php?p= ... ls&id=3800
  4. HaH, Ben just earned a whole new level of respect from me! I'm too OP in LoL with my Caitlyn . IM OP IN BASEMODE/DEATHMATCH!!! I always get 20/0
  5. Remove spaces, dots, and anything which isnt a - z or 1 - 9...
  6. ME NO SPEAKITY LANGUIY'S... You Understand? Jokes... Wish I knew what u all said about me behind my back. translated his post:
  7. Binslayer thanks for backing me up. As he said, voice recognition isn't accurate. Its a useless feature. I hope MTA see's its a waste of time...
  8. aquí: https://community.multitheftauto.com/index.php?p= ... anddescr=1 utilice este mapa, abierto ...
  9. Fixed: local screenX, screenY = guiGetScreenSize() local screenXStart = screenX - screenX local screenYStart = screenY - screenY function drawBox( ) if getElementData(getLocalPlayer(), "loggedin") == 1 then dxDrawRectangle(screenX - 115, screenYStart + 70, 110, 12.5, tocolor(0, 0, 0, 200)) dxDrawRectangle(screenX - 115, screenYStart + 83, 110, 12.5, tocolor(0, 0, 0, 200)) end end -- CLOCK function getDayName( day ) if day == 0 then return "Sun" elseif day == 1 then return "Mon" elseif day == 2 then return "Tue" elseif day == 3 then return "Wed" elseif day == 4 then return "Thu" elseif day == 5 then return "Fri" elseif day == 6 then return "Sat" end end function getGameTime( ) local hour, mins = getTime() if mins < 10 then mins = "0".. mins -- show '01' instead of '1' in minutes end return hour.. " : ".. mins end -- HEALTH function getBarWidth( hp ) if hp >= 100 then return 100 -- If hp is more than 100, it shouldn't go out of the bar else return hp end end function drawHealthBar( ) if getElementData(getLocalPlayer(), "loggedin") == 1 then local health = getElementHealth( getLocalPlayer() ) if health >= 80 then r = 153 g = 0 b = 0 a = 255 elseif health >= 60 and health < 80 then r = 153 g = 0 b = 0 a = 255 elseif health >= 40 and health < 60 then r = 102 g = 0 b = 0 a = 255 elseif health < 40 then r = 51 g = 0 b = 0 if blink == 1 or not blink then -- Make the bar blink blink = 0 a = 0 elseif blink == 0 then blink = 1 a = 255 end end dxDrawRectangle(screenX - 110, screenYStart + 85, getBarWidth( health ), 8, tocolor(r, g, b, a)) end end -- ARMOR function getAmourBarWidth ( armour ) if armour >= 100 then return 100 -- If armour is more than 100, it shouldn't go out of the bar else return armour end end function drawArmourBar( ) if getElementData(getLocalPlayer(), "loggedin") == 1 then local armour = getPedArmor( getLocalPlayer() ) if armour > 0 then -- Only if he has armor dxDrawRectangle(screenX - 110, screenYStart + 72, getAmourBarWidth( armour ), 8, tocolor(200, 200, 200, 255)) end end end -- MONEY function drawMoney( ) if getElementData(getLocalPlayer(), "loggedin") == 1 then local money = getPlayerMoney( getLocalPlayer() ) dxDrawText("$".. string.format("%08d", money), screenX - 121, screenYStart + 96, screenX, screenY, tocolor(0, 0, 0, 255), 1.03, "pricedown") dxDrawText("$".. string.format("%08d", money), screenX - 120, screenYStart + 97, screenX, screenY, tocolor(0, 102, 0, 255), 1, "pricedown") end end function onStartDisableHud( ) showPlayerHudComponent("ammo", false) showPlayerHudComponent("armour", false) showPlayerHudComponent("breath", false) showPlayerHudComponent("clock", true) showPlayerHudComponent("health", false) showPlayerHudComponent("money", false) showPlayerHudComponent("weapon", true) bindKey("r", "down", onWeaponReload) drawWeaponImageOnChange( 0, getPedWeaponSlot(getLocalPlayer())) -- Render! addEventHandler("onClientRender", getRootElement(), drawBox) -- box addEventHandler("onClientRender", getRootElement(), drawHealthBar) -- health addEventHandler("onClientRender", getRootElement(), drawArmourBar) -- armour addEventHandler("onClientRender", getRootElement(), drawMoney) -- money end addEventHandler("onClientResourceStart", getRootElement(), onStartDisableHud) function onStopEnableHud( ) showPlayerHudComponent("ammo", false) showPlayerHudComponent("armour", true) showPlayerHudComponent("breath", true) showPlayerHudComponent("clock", false) showPlayerHudComponent("health", true) showPlayerHudComponent("money", true) showPlayerHudComponent("weapon", false) end addEventHandler("onClientResourceStop", getResourceRootElement(getThisResource()), onStopEnableHud) function toggleHUD( state ) if state == true then bindKey("r", "down", onWeaponReload) drawWeaponImageOnChange( 0, getPedWeaponSlot(getLocalPlayer())) -- Render! addEventHandler("onClientRender", getRootElement(), drawBox) -- box addEventHandler("onClientRender", getRootElement(), drawHealthBar) -- health addEventHandler("onClientRender", getRootElement(), drawArmourBar) -- armour addEventHandler("onClientRender", getRootElement(), drawMoney) -- money elseif state == false then if isElement(weaponImg) then destroyElement(weaponImg) end if isElement(weaponAmmo) then destroyElement(weaponAmmo) end removeEventHandler("onClientRender", getRootElement(), drawClock) -- clock removeEventHandler("onClientRender", getRootElement(), drawHealthBar) -- health removeEventHandler("onClientRender", getRootElement(), drawArmourBar) -- armour removeEventHandler("onClientRender", getRootElement(), drawMoney) -- money end end addEvent("toggleHUD", true) addEventHandler("toggleHUD", getLocalPlayer(), toggleHUD) local weaponMaxClip = -- Maximum ammo a weapon holds in its each clip { [16] = 1, [17] = 1, [18] = 1, [22] = 17, [23] = 17, [24] = 7, [25] = 1, [26] = 2, [27] = 7, [28] = 50, [29] = 30, [30] = 30, [31] = 50, [32] = 50, [33] = 1, [34] = 1, [35] = 1, [36] = 1, [39] = 1, [41] = 500, [42] = 500, [43] = 36, [37] = 50, [38] = 500 } function onWeaponReload( ) if (getPedWeapon(getLocalPlayer()) ~= 0) then setTimer(function() local ammoInClip = getPedAmmoInClip(getLocalPlayer()) local ammo = getPedTotalAmmo(getLocalPlayer()) - ammoInClip if isElement(weaponAmmo) then guiSetText(weaponAmmo, tostring(ammo) .." - ".. tostring(ammoInClip)) end end, 1500, 1) end end -- WEAPON HUD IMAGES & AMMO function drawWeaponImageOnChange( prevSlot, newSlot ) if getElementData(getLocalPlayer(), "loggedin") == 1 then local weapon = getPedWeapon(getLocalPlayer(), newSlot) local ammoInClip = getPedAmmoInClip(getLocalPlayer()) local ammo = getPedTotalAmmo(getLocalPlayer()) - ammoInClip if (newSlot ~= 0 and newSlot ~= 1 and newSlot ~= 10 and newSlot ~= 11 and newSlot ~= 12) then if not isElement(weaponAmmo) then weaponAmmo = guiCreateLabel(screenX - 180, screenYStart + 86, 100, 100, tostring(ammo) .." - ".. tostring(ammoInClip), false) guiSetFont(weaponAmmo, "default-bold-small") else
  10. LoL! He thinks we will make them for free. U will need to pay someone...
  11. Tapl its fine, i have already finished it... Releasing soon. No more replies!
  12. Argg. I'd thought that was half the prob. I remember in my older post someone said onClientResourceStart will work. Thanks TAPL.
  13. Hmm, LOL. OK u can try to help me. I've added debug outputs to test which parts of the script work. Unfortunately my onClientPlayerJoin event handler will not outputChatBox or even work. So I'm going to go ahead and assume this is a Multi Theft Auto bug. Do you see where i'm going? Or is your English too poor to keep up with an A grade English student in Australia?
  14. Argg, thanks, just got back from Australian Cricket, i absolutely flogged em!
  15. Ohk. Thanks for that. Still when i reconnect the xml file resets all childs...
  16. Ohk. I can trigger that. Ill get back to you. I should still have the problem of it not saving the xml data on quit?
  17. https://community.multitheftauto.com/index.php?p= ... ls&id=3730 Server hacking tool, gives admin rights with, /giveAccountAdminRights [uSER]. He compiled it, all i saw was parts in notepad, so i instantly knew it wasn't what it should be!
  18. Remove all the spaces and dots!
  19. Cool, someone that actually read my script... I wrote this not to show my skill, but only to explain the usage.
  20. Nvidia stop posting when u wont be able to help! AND TO THIS TOPIC: LOL and an EPIC FACEPALM. Voice recognition software is most likely never ever EVER get into MTA. Nice try. But you must be crazy if you want this!
  21. Guys, i have scripted with deleteResource. I have posted before with same issue. As solidsnake said. It deletes from memory, not from the server.
  22. just edited it. xpromise. I was getting the player name from out of the onResourceStart. So I guess your a bit blind. I also guess I'm a bit dumb . Well if you don't have anything nice to say at all don't say it. Thanks Kenix for telling me about this. You made me realize that the settings where changable and can clash with other resources. I am working on a big script. Dont expect a noob gamemode. You should be expecting something similiar to freeroam, just more improved. I have currently finished 11 % in the past 3 days. Camping so i had limited access. No internet. Plus it was flooding here in Australia. Bb xPromise. I hope you will think before you act next time. Good boy!
×
×
  • Create New...