Jump to content

~Air

Members
  • Posts

    62
  • Joined

  • Last visited

Everything posted by ~Air

  1. Still doesn't work 4O4
  2. Hey guys, I got again a problem. So a player that hasn't got a chatcolor and writes in the teamchat, the message will be displayed to everyone. Only if a player has got a chatcolor the message will be only shown on the teamchat. Could someone help me please? local function teamChat(message, messageType) if messageType == 2 then cancelEvent() local acc = getPlayerAccount(source) if not isGuestAccount(acc) then if getAccountData(acc,"chatc") and getElementData(source, "Vip") == true then local color = getAccountData(acc,"chatc") local team = getPlayerTeam ( source ) if ( not team ) then return end for _, team in ipairs ( getPlayersInTeam ( team ) ) do outputChatBox("(TEAM): " ..getPlayerName(source)..": "..color..""..message, team, 255, 255, 255, true ) end else outputChatBox("(TEAM): " ..getPlayerName(source)..": #FFFFFF"..message, team, 255, 255, 255, true ) end else outputChatBox("(TEAM): "..getPlayerName(source)..": #FFFFFF"..message, team, 255, 255, 255, true ) end outputServerLog("CHAT: "..getPlayerName(source)..": "..message) end end addEventHandler("onPlayerChat", root, teamChat)
  3. ~Air

    Colorcodes

    Thanks it worked!
  4. ~Air

    Colorcodes

    Yes, it shows like this: #FF4500test instead of: test or #00FF00test instead of: test just for example.
  5. ~Air

    Colorcodes

    It fixxed the errors, but it still doesn't show the colorcoded Status.
  6. ~Air

    Colorcodes

    Still same error.
  7. ~Air

    Colorcodes

    @Dealman: I posted the new error, it isn't the thing with the string anymore. It's the one with expected element at argument 1. BTW: I already tried source instead of player still same error!
  8. ~Air

    Colorcodes

    Sorry for bump. I tried something new: dxDrawText(getPlayerStatus(player), x+522, y-5 + (c - 1) * 20, x + 425+35, y + (c) * 20, tocolor(0,0,0, 255), 1, "default-bold", "center", "center", false, false, true) -- dxDrawText(getPlayerStatus(player), x+522+2, y-5+2 + (c - 1) * 20, x + 425+35, y + (c) * 20, tocolor(255,255,255, 255), 1, "default-bold", "center", "center", false, false, true) function getPlayerStatus (player) local admin = getElementData(player,"Status") if admin then return admin else return "Guest" end end But this is my error: (The line with getAccountData) expected element at argument 1
  9. ~Air

    Colorcodes

    It does get the Status from the player.
  10. ~Air

    Colorcodes

    This has nothing to do with that TAPL, I just need help to get it to show colorcodes.
  11. ~Air

    Colorcodes

    Changed it to this: dxDrawText(getElementData(element[2],"Status"), x+522, y-5 + (c - 1) * 20, x + 425+35, y + (c) * 20, tocolor(0,0,0, 255), 1, "default-bold", "center", "center", false, false, false, true) -- dxDrawText(getElementData(element[2],"Status"), x+522+2, y-5+2 + (c - 1) * 20, x + 425+35, y + (c) * 20, tocolor(255,255,255, 255), 1, "default-bold", "center", "center", false, false, false, true) But now I get an error: Expected string at argument 1
  12. ~Air

    Colorcodes

    Hey guys, I got one problem I made a text on my scoreboard but when I type a Status with colorcode it just shows it with the colorcode in the nametags but not in the scoreboard. I hope you could help me. That is just a part of my script, so that nobody can steal it. dxDrawText(getElementData(element[2],"Status"), x+522, y-5 + (c - 1) * 20, x + 425+35, y + (c) * 20, tocolor(0,0,0, 255), 1, "default-bold", "center", "center") -- dxDrawText(getElementData(element[2],"Status"), x+522+2, y-5+2 + (c - 1) * 20, x + 425+35, y + (c) * 20, tocolor(255,255,255, 255), 1, "default-bold", "center", "center")
  13. Debugscript doesn't output anything.
  14. That's my script, but I can see it anyway. local function teamChat(message, messageType) if messageType == 2 then cancelEvent() local acc = getPlayerAccount(source) if not isGuestAccount(acc) then if getAccountData(acc,"chatc") and getElementData(source, "Vip") == true then local color = getAccountData(acc,"chatc") local team = getPlayerTeam ( source ) if ( not team ) then return end for _, team in ipairs ( getPlayersInTeam ( team ) ) do outputChatBox("(TEAM): " ..getPlayerName(source)..": "..color..""..message, team, 255, 255, 255, true ) end else outputChatBox("(TEAM): " ..getPlayerName(source)..": #FFFFFF"..message, team, 255, 255, 255, true ) end else outputChatBox("(TEAM): "..getPlayerName(source)..": #FFFFFF"..message, team, 255, 255, 255, true ) end outputServerLog("CHAT: "..getPlayerName(source)..": "..message) end end addEventHandler("onPlayerChat", root, teamChat)
  15. for _, team in ipairs ( getPlayersInTeam ( team ) ) do outputChatBox("(TEAM): " ..getPlayerName(source)..": "..color..""..message, root, 255, 255, 255, true ) end --> to: for _, team in ipairs ( getPlayersInTeam ( team ) ) do outputChatBox("(TEAM): " ..getPlayerName(source)..": "..color..""..message, team, 255, 255, 255, true ) end ?
  16. Here is my new code: it's still the same problem: everyone can see it. local function playerChat(message, messageType) if messageType == 2 then cancelEvent() local acc = getPlayerAccount(source) if not isGuestAccount(acc) then if getAccountData(acc,"chatc") and getElementData(source, "Vip") == true then local color = getAccountData(acc,"chatc") local team = getPlayerTeam ( source ) if ( not team ) then return end for _, team in ipairs ( getPlayersInTeam ( team ) ) do outputChatBox("(TEAM): " ..getPlayerName(source)..": "..color..""..message, root, 255, 255, 255, true ) end else outputChatBox("(TEAM): " ..getPlayerName(source)..": #FFFFFF"..message, root, 255, 255, 255, true ) end else outputChatBox("(TEAM): "..getPlayerName(source)..": #FFFFFF"..message, root, 255, 255, 255, true ) end outputServerLog("CHAT: "..getPlayerName(source)..": "..message) end end addEventHandler("onPlayerChat", root, playerChat)
  17. Oh.. yeah sorry im so dumb, but thanks. I'll fix it by myself.
  18. Sorry, that I didn't write it in the topic So the problem is if you press Y (messageType == 2) everyone can read this message if he isn't in a team or in an another team.
  19. Hey guys, I am back with an another problem but I don't know what's false, there is no error. Here is the code: -- Teamchat local function playerChat(message, messageType) if messageType == 2 then cancelEvent() local acc = getPlayerAccount(source) if not isGuestAccount(acc) then if getAccountData(acc,"chatc") and getElementData(source, "Vip") == true then local color = getAccountData(acc,"chatc") outputChatBox("(TEAM): " ..getPlayerName(source)..": "..color..""..message, root, 255, 255, 255, true ) else outputChatBox("(TEAM): " ..getPlayerName(source)..": #FFFFFF"..message, root, 255, 255, 255, true ) end else outputChatBox("(TEAM): "..getPlayerName(source)..": #FFFFFF"..message, root, 255, 255, 255, true ) end outputServerLog("CHAT: "..getPlayerName(source)..": "..message) end end addEventHandler("onPlayerChat", root, playerChat)
×
×
  • Create New...