Jump to content

[SOLVED] Fix a join and quit script


Brolis

Recommended Posts

Posted (edited)

Hi all again, today I want to know how to fix my resources...

When player joins, or troll or epic it shows a message as it should show, but when player or troll or epic or... leave a server, there no quit message showing.

function login() 
    if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Troll")) then 
    outputChatBox("* [Troll] " .. getPlayerName(source) .. " #FF6464has joined the game!", getRootElement(), 255, 100, 100, true) 
--  
     
    elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Epic")) then 
    outputChatBox("* [Epic] " .. getPlayerName(source) .. " #FF6464has joined the game!", getRootElement(), 255, 100, 100, true) 
     
    elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Everyone")) then 
    outputChatBox("* Player " .. getPlayerName(source) .. " #FF6464has joined the game!", getRootElement(), 255, 100, 100, true) 
  end -- The End of " if " 
   
end -- The End of " function login " 
addEventHandler("onPlayerLogin", getRootElement(), login) 

And my quit resource:

addEventHandler('onClientPlayerQuit', root, 
    function(reason) 
        outputChatBox('* ' .. getPlayerName(source) .. ' #FF6464has left the game [' .. reason .. ']', 255, 100, 100) 
    end 
) 
  
addEventHandler('onClientPlayerChangeNick', root, 
    function(oldNick, newNick) 
        outputChatBox('* ' .. oldNick .. ' #FF6464is now known as ' .. newNick, 255, 100, 100) 
    end 
) 

So, someone, please - fix my quit players script, when players quits the game, no message were showing in chat...

Where a problem is? Thanks a lot!

Edited by Guest
Posted

That's because you didn't even add it, also, your leave script should be server side as account and isObjectInACLGroup are server side functions.

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...