Jump to content

outputChatBox


Plate

Recommended Posts

hola como se podria hacer para que en este script aparesca el nombre del player que lo agrego al team y el nombre del que fue agregado ?

addEvent("grupos",true) 
function grupos(player, groupname) 
    local account = getPlayerAccount(player) 
    if ( not isGuestAccount ( account ) ) then 
        local group = aclGetGroup ( groupname ) 
        if ( group ) then 
            local isInACLGroup = isObjectInACLGroup ( "user." .. getAccountName ( account ), group) 
            if ( not isInACLGroup ) then 
                aclGroupAddObject ( group, "user."..getAccountName ( account ) ) 
local pname = getPlayerName(player) 
        setPlayerTeam ( player, USS ) 
                          outputChatBox(tostring(pname) .." has added '".. getPlayerName(player  .."' to " .. groupname .. ".", getRootElement(), 0, 255 ,255 ) 
            elseif ( isInACLGroup ) then 
                aclGroupRemoveObject ( group, "user."..getAccountName ( account ) ) 
local pname2 = getPlayerName(player) 
                outputChatBox (tostring(pname2) .." has removed " ..getPlayerName(player).. " from " .. groupname .. ".", getRootElement(), 0, 255 ,255 ) 
setPlayerTeam(player, nil) 
            end 
        else 
            outputChatBox ( "El " .. groupname .. " No existe.", source, 255, 0 ,0 ) 
        end 
    else 
        outputChatBox ( "El jugador no esta logeado.", source, 255, 100 ,100 ) 
    end 
end 
addEventHandler("grupos", getRootElement(), grupos) 

Link to comment
  outputChatBox(tostring(pname) .." has added '".. getPlayerName(player  .."' to " .. groupname .. ".", getRootElement(), 0, 255 ,255 ) 

Te falta un parentesis en getPlayerName, ademas podrias usar directamente "pname", ya que la definiste anteriormente.

Link to comment
  • Recently Browsing   0 members

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