Jump to content

onPlayerQuit


.:HyPeX:.

Recommended Posts

Hello, i was wondering, can i make all my scripts think a player has left the server like this?
  
function FakeQuit(player, command, newNick) 
triggerEvent("onPlayerQuit", player) 
end 
addCommandHandler("fquit", FakeQuit,false, false) 
  

Thanks

HyPeX

Yes it's possible, but don't forget to pass the quit reason too :P maybe some script need it.

Link to comment

I've working it out, still havent tested becouse i'm making a whole script with various usefull commands..

  
function FakeQuit(player, command, text) 
local pacc = getPlayerAccount( player ) 
if (isObjectInACLGroup ( "user.".. pacc, aclGetGroup("LxG"))) then 
outputChatBox("#00aaff[EasyCMD]: Account Accepted!", player, 255,255,255,true) 
else 
outputChatBox("#00aaff[EasyCMD]: You cant use this!", player, 255,255,255, true) 
return end 
local named = getAccountData(player, "fname") 
if named then 
setPlayerName(player, "named") 
triggerEvent("onPlayerQuit", player, Quit) 
outputChatBox("#00aaff[EasyCMD]: Name set to: ".. named .."", player, 255,255,255, true) 
else 
outputChatBox("#00aaff[EasyCMD]: Please set a Fake name first!", player, 255,255,255, true) 
return 
end 
  
end 
addCommandHandler("fquit", Announce,FakeQuit,false) 
  
  
function FakeName(player, command, fnewnick) 
local playeracc = getPlayerAccount( player ) 
local newname = string.gsub(fnewnick, "%d", "") 
if newnick then 
setAccountData(playeracc, "fname", newname) 
local nick = newname 
outputChatBox("#00aaff[EasyCMD]: Your nickName was now changed to: #ffffff".. newname, player, 255,255,255, true) 
else 
outputChatBox("#00aaff[EasyCMD]: Your current nickName is: #ffffff".. named, player, 255,255,255,true) 
end 
end 
addCommandHandler("fname", FakeName, false, false) 

Link to comment

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