Callum1243 Posted July 9, 2016 Share Posted July 9, 2016 In game, these two commands when entered will not show up: function giveKey(player,command,arg) local playera = getPlayerFromPartOfName ( arg ) if playera then local myAccount = getPlayerAccount(player) local myAccountName = getAccountName(myAccount) local account = getPlayerAccount(playera) setAccountData ( account,"key"..myAccountName,true) outputChatBox("You have given a key to"..getPlayerName(playera),player) else outputChatBox("Cannot find player, make sure you use /giveKey 'player'") end end addCommandHandler ( "giveKey", giveKey ) function removeKey(player,command,arg) local playera = getPlayerFromPartOfName ( arg ) if playera then local myAccount = getPlayerAccount(player) local myAccountName = getAccountName(myAccount) local account = getPlayerAccount(playera) setAccountData ( account,"key"..myAccountName,false) outputChatBox("You have removed a key to"..getPlayerName(playera),player) else outputChatBox("Cannot find player, make sure you use /revokeKey 'player'") end end addCommandHandler ( "revokeKey", removeKey ) Why? There are no errors within the control panel. Link to comment
aka Blue Posted July 9, 2016 Share Posted July 9, 2016 ¿When entered? ¿Do you mean onPlayerLogin or onPlayerJoin? Link to comment
Callum1243 Posted July 9, 2016 Author Share Posted July 9, 2016 When they are logged in, it still wont show. Link to comment
Walid Posted July 9, 2016 Share Posted July 9, 2016 Try this should work function giveKey(player,command,arg) local account = getPlayerAccount(player) if account and not isGuestAccount(account) then local myAccountName = getAccountName(account) if arg then local playera = getPlayerFromName ( arg ) if playera then local pAccount = getPlayerAccount(playera) setAccountData (pAccount,"key"..myAccountName,true) outputChatBox("You have given a key to"..getPlayerName(playera),player) else outputChatBox("Cannot find player, make sure you use /giveKey 'player'") end end end end addCommandHandler ( "giveKey", giveKey ) function removeKey(player,command,arg) local account = getPlayerAccount(player) if account and not isGuestAccount(account) then local myAccountName = getAccountName(account) if arg then local playera = getPlayerFromPartOfName ( arg ) if playera then local pAccount = getPlayerAccount(playera) setAccountData (pAccount,"key"..myAccountName,false) outputChatBox("You have removed a key to"..getPlayerName(playera),player) else outputChatBox("Cannot find player, make sure you use /revokeKey 'player'") end end end end addCommandHandler ( "revokeKey", removeKey ) Link to comment
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