.:HyPeX:. Posted November 20, 2013 Posted November 20, 2013 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
xXMADEXx Posted November 20, 2013 Posted November 20, 2013 I've never tried doing an event like that, but I guess you could try, although I don't think that it'll work.
myonlake Posted November 20, 2013 Posted November 20, 2013 I am quite sure it won't work because of the fact that's it's a security vulnerability if it was possible.
TAPL Posted November 20, 2013 Posted November 20, 2013 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 maybe some script need it.
.:HyPeX:. Posted November 21, 2013 Author Posted November 21, 2013 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)
TAPL Posted November 21, 2013 Posted November 21, 2013 At line 4 you need the account name not the account so you have to use getAccountName. Also at line 9, getAccountData require account not player element. Also at line 12, you need string for Quit (if it wasn't a defined variable). Also at line 26, newnick is not defined anywhere.
.:HyPeX:. Posted November 21, 2013 Author Posted November 21, 2013 Well i would've got outputed those errors anyways on testing, but thanks
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now