Jump to content

TheGamingMann

Members
  • Posts

    54
  • Joined

  • Last visited

TheGamingMann's Achievements

Snitch

Snitch (10/54)

0

Reputation

  1. I FEEL SO DUMB... I spelt type wrong in my meta... Fixed it.
  2. function cancelEvent() cancelEvent() setElementHealth(getRootElement(), 100) outputChatBox("Test") end addEventHandler("onClientPlayerDamage", getRootElement(), cancelEvent) Thats the new code. None of those in the function are running. Here is my meta.xml "TheGamingMann" name="Server Info" version="1.0" description="Sets the server info on resource start."/>
  3. I am not quite sure what is going on. But my script keeps giving me this error and its not working. Here's my code: function cancelDamage() cancelEvent() end addEventHandler("onClientDamage", getLocalPlayer(), cancelDamage) This is a client side script as well.
  4. AHHH! I got it thanks. I forgot to change the argument on the event handler to root. My bad. Thanks man.
  5. Thanks for the quick reply but I tried it and it doesn't seem to work. The vehicle stay on when I disconnect and reconnect.
  6. Hey guys I am making a function that will shut a vehicles engine off when the player leaves the server. This i not working at the moment. Any help would be appreciated. function engineOffLeave() if (getPedOccupiedVehicle(source) == true) then local vehicle = getPedOccupiedVehicle(source) if (getVehicleEngineState(source) == true) then setVehicleEngineState(source, false) end end end addEventHandler("onPlayerQuit", root, engineOffLeave) Thanks guys.
  7. Thanks man that worked. Thank you so much for helping. There are so many friendly people on here. Have a good night/day.
  8. Those are just test messages. the problem I am having is it sends the message globally if there is no player by the name in the server.
  9. Hello. I am attempting to make a custom PM system but I am having some issues. I get no errors but it sends the pm to me no matter what... I am confused. *EDIT* So I figured this out the PM works... it sends right but it sends to global when there is no one in the server with that name. or partial name... still really confused. function privateMessageTwo(player, command, sentTo, ...) if (command == "pm") then local messageTable = {...} local message = table.concat(messageTable, " ") local sendTo = getPlayerFromPartialName(sentTo, player) if (sendTo ~= "") then if (message ~= "") then outputChatBox("#00FF00[PM FROM]#FFFFFF"..getPlayerName(player).."#BDBDBD: "..message, sendTo, 255, 255, 255, true) outputChatBox("#00FF00[PM TO]#FFFFFF"..getPlayerName(sendTo).."#BDBDBD: "..message, player, 255, 255, 255, true) else outputChatBox("Failed No Message") end else outputChatBox("Failed No Name") end else outputChatBox("Failed No Command") end end addCommandHandler("pm", privateMessageTwo) function getPlayerFromPartialName(name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end end end
  10. Thanks man. I didn't notice that spelling mistake I feel like such a noob now lol. My bad. But thanks again man.
  11. Not I am trying to update the players load count like deliver count when they login. Currently it does not update the score board so it stays blank until they deliver a load.
  12. People don't like to help others with leaked RP scripts. I am not sure if they are yours or not but guessing by the way that you don't know what resource to look at I think its leaked. So I would not be willing to help you. Sorry. I am not sure about others but I think most people would say they wont help you with leaked scripts.
  13. Hey guys again. I got the system to work now I am just trying to update the scoreboard with the players load count when they login. It does not seem to show up on the scoreboard until a load is complete. Any help will be greatly appreciated. s_login.lua function loginHandler(password) local account = getAccount(getPlayerName(source)) if (account ~= false) then local loggedIn = logIn(source, account, password) if (loggedIn ~= false) then outputChatBox(" ", source) outputChatBox(" ", source) outputChatBox(" ", source) outputChatBox(" ", source) outputChatBox(" ", source) outputChatBox(" ", source) outputChatBox(" ", source) outputChatBox(" ", source) outputChatBox(" ", source) outputChatBox(" ", source) outputChatBox("Welcome back "..getPlayerName(source):gsub('#%x%x%x%x%x%x', '')..".", source, 18, 11, 150) triggerClientEvent("hideLoginWindow", source) else outputChatBox(" ", source) outputChatBox(" ", source) outputChatBox(" ", source) outputChatBox(" ", source) outputChatBox(" ", source) outputChatBox(" ", source) outputChatBox(" ", source) outputChatBox(" ", source) outputChatBox(" ", source) outputChatBox(" ", source) outputChatBox("Invalid password entered.", source) end else if (password ~= "" and password ~= nil) then local accountAdded = addAccount(getPlayerName(source), password) if (accountAdded) then outputChatBox("Thank you for registering "..getPlayerName(source):gsub('#%x%x%x%x%x%x', '')..".", source, 112, 0, 0) outputChatBox("If you click 'Submit' again you can login.", source, 112, 0, 0) end else outputChatBox("You must enter a password.", source) end end end addEvent("accLogReg", true) addEventHandler("accLogReg", root, loginHandler) function saveAccount() local playerAcc = getPlayerAccount(source) local playerCash = getPlayerMoney(source) setAccountData(playerAcc, "hdt.cash", playerCash) end addEventHandler("onPlayerQuit", getRootElement(), saveAccount) function loadAccount() local playerAcc = getPlayerAccount(source) if (playerAcc) then local playerCash = getAccountData(playerAcc, "hdt.cash") local playerLoads = getAccountData(playerAcc, "hdt.loads") if (playerCash) then setPlayerMoney(source, playerCash) end if (playerLoads) then setElemntData(source, "Completed Loads", playerLoads) else setElementData(source, "Completed Loads", 0) end end end addEventHandler("onPlayerLogin", getRootElement(), loadAccount) I think that is the only file that matters. If you don't think so let me know and I can get your more. Thanks.
  14. Sorry for the long reply. I was a little busy. I got it working now due to your code. Thanks man.
×
×
  • Create New...