Jump to content

Bug


xeon17

Recommended Posts

Posted

The script :

addCommandHandler("gang", function(player, command, subcommand, ...) 
local args = {...} 
local team = getPlayerTeam(player) 
local teamMates = getPlayersInTeam ( team ) 
for _, team in ipairs(teamMates) do 
setPlayerNametagText ( team, tag ) 
 if(subcommand == "tag") then 
  if(not isElement(team)) then 
   return outputChatBox("#F4A460[GANG]#F08080 You has not a gang...", player, 0, 0, 0, true) 
  end 
  local tag = args[1] 
  if(tag) then 
   setElementData(team, "tag", tag) 
   return outputChatBox("#F4A460[GANG]#F08080 Your gang tag is  = " .. tag , player, 0, 0, 0, true) 
  else 
   setElementData(team, "tag", nil) 
   return outputChatBox("#F4A460[GANG]#F08080 Tag removed.", player, 0, 0, 0, true) 
  end 
 end 
end 
end) 
addEventHandler("onPlayerChat", root, function(message, messageType) 
    local team = getPlayerTeam(source) 
    if team then 
        local tag = getElementData(team, "tag") 
        if tag then 
            if messageType == 0 then 
                cancelEvent() 
    local r, g, b  = getPlayerNametagColor(source) 
                outputChatBox(string.format("[%s]%s: #FFFFFF %s", tag, getPlayerName(source), message), root, r, g, b, true) 
            elseif messageType == 2 then 
                cancelEvent() 
                local r, g, b  = getPlayerNametagColor(source) 
                for _, member in ipairs( getPlayersInTeam(team) ) do 
                    outputChatBox(string.format("[%s]%s: #FFFFFF %s", tag, getPlayerName(source), message), member, r, g, b, true) 
                end 
            end 
        end 
    end 
end) 
  

I edited a little my old script and got a bug :/ tried to fix , but still have this bug...

EDIT : after fix of frist bug script again have a bug. :/

[2014-05-11 15:22:50] SCRIPT ERROR: Tag\server.lua:20: unexpected symbol near ')' 

(SOLVED)

NEW BUG:

[2014-05-11 15:27:53] ERROR: Tag\server.lua:5: bad argument #1 to 'ipairs' (table expected, got boolean) 

( SOLVED)

LATEST BUG :

[2014-05-11 15:40:16] WARNING: Tag\server.lua:4: Bad argument @ 'getPlayersInTeam' 
[2014-05-11 15:40:16] ERROR: Tag\server.lua:5: bad argument #1 to 'ipairs' (table expected, got boolean) 

A unique GangWar gamemode waiting for you!
Click here for more information.

560x95_FFFFFF_FF9900_000000_000000.png

Posted

That means the player has no team, therefore, getPlayersInTeam won't work.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
That means the player has no team, therefore, getPlayersInTeam won't work.

I tested it only on me , will the setPlayerNatetagText work ? i created it only for chat, today tried for nametagtext.

A unique GangWar gamemode waiting for you!
Click here for more information.

560x95_FFFFFF_FF9900_000000_000000.png

Posted

I don't know what you are trying to do, so I don't know if it would work.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
I don't know what you are trying to do, so I don't know if it would work.

I'm try to change player name tag text to the text witch he choose , i edited the script today.. Before it only changed the text in player name on ouPutChatBox. :D extample :

/gang tag FsN

my name : [FsN]XeoN

in chat: [FsN]XeoN

A unique GangWar gamemode waiting for you!
Click here for more information.

560x95_FFFFFF_FF9900_000000_000000.png

Posted

You don't want to change his real name? only his nametag text and use that for when the player chats?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
You don't want to change his real name? only his nametag text and use that for when the player chats?

I allerdy did it for chat , i'm enter gang SAUR and type /gang tag FsN

and everyone from my gang have the tag [FsN] when he write something in chat , i'm try to change his nametagtext

when i see some player ingame i want he have same text / tag as in chatbox what i allerdy created.

sorry for my bad english :x

A unique GangWar gamemode waiting for you!
Click here for more information.

560x95_FFFFFF_FF9900_000000_000000.png

Posted

So, what is the problem? why it doesn't work?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...