- 
                
Posts
62 - 
                
Joined
 - 
                
Last visited
 
Everything posted by ~Air
- 
	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)
 - 
	Yes, it shows like this: #FF4500test instead of: test or #00FF00test instead of: test just for example.
 - 
	It fixxed the errors, but it still doesn't show the colorcoded Status.
 - 
	@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!
 - 
	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
 - 
	It does get the Status from the player.
 - 
	This has nothing to do with that TAPL, I just need help to get it to show 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
 - 
	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")
 - 
	Debugscript doesn't output anything.
 - 
	bump.
 - 
	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)
 - 
	Also the EventHandler?
 - 
	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 ?
 - 
	What should I use instead?
 - 
	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)
 - 
	Oh.. yeah sorry im so dumb, but thanks. I'll fix it by myself.
 - 
	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.
 - 
	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)
 
