1LoL1 Posted August 31, 2015 Share Posted August 31, 2015 Hello i created VIP code and i want to /setvip but player must be in the server and this can only "Admin". function vip(thePlayer, command) local VIP = aclGetGroup("VIP") local player = getAccountName(getPlayerAccount(thePlayer)) aclGroupAddObject (VIP, "user."..player) givePlayerMoney(thePlayer, 1) outputChatBox("test", thePlayer, 255, 255, 255, true) end addCommandHandler("setvip", vip) please can anyone help me or get me example or functions? Link to comment
iMr.SFA7 Posted August 31, 2015 Share Posted August 31, 2015 function vip(thePlayer, command,account) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("admin")) then local VIP = aclGetGroup("VIP") local account = getAccountName(getPlayerAccount(account)) if ( account ) then aclGroupAddObject (VIP, "user."..account) givePlayerMoney(thePlayer, 1) outputChatBox("test", thePlayer, 255, 255, 255, true) end end end addCommandHandler("setvip", vip) setvip add script to acl Console Group Link to comment
1LoL1 Posted August 31, 2015 Author Share Posted August 31, 2015 function vip(thePlayer, command,account) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("admin")) then local VIP = aclGetGroup("VIP") local account = getAccountName(getPlayerAccount(account)) if ( account ) then aclGroupAddObject (VIP, "user."..account) givePlayerMoney(thePlayer, 1) outputChatBox("test", thePlayer, 255, 255, 255, true) end end end addCommandHandler("setvip", vip) setvip add script to acl Console Group thanks but not work. Link to comment
Areion Posted August 31, 2015 Share Posted August 31, 2015 The script needs admin rights as well edit your acl and add this resource to admin example : Also if you're using it like this /setvip 'Account name' then the code has to be like this : function vip(thePlayer, command,accountname) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Admin")) then local VIP = aclGetGroup("VIP") local account = getAccount(accountname) if ( account ) then aclGroupAddObject (VIP, "user."..accountname) if getAccountPlayer(account) then givePlayerMoney(getAccountPlayer(account), 1) end outputChatBox("Account '"..accountname.."' has been successfully added to VIP.", thePlayer, 255, 255, 255, true) end end end addCommandHandler("setvip", vip) Link to comment
iMr.SFA7 Posted August 31, 2015 Share Posted August 31, 2015 thanks but not work. your admin group name "Admin" or "admin" ? Link to comment
Areion Posted August 31, 2015 Share Posted August 31, 2015 Mr.SFA7 Your script couldnt wok anyway... local account = getAccountName(getPlayerAccount(account)) Makes no sense as 'account' is a string value Link to comment
1LoL1 Posted August 31, 2015 Author Share Posted August 31, 2015 (edited) thanks but not work. your admin group name "Admin" or "admin" ? "Admin" and i mean when i setvip to player only player will see outputChatBox not i. Edited August 31, 2015 by Guest Link to comment
iMr.SFA7 Posted August 31, 2015 Share Posted August 31, 2015 add script to admin group function vip(thePlayer, command,account) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Admin")) then if ( account ) then local VIP = aclGetGroup("VIP") local name = getAccountName ( account ) aclGroupAddObject (VIP, "user."..name) givePlayerMoney(thePlayer, 1) outputChatBox("test", thePlayer, 255, 255, 255, true) end end end addCommandHandler("setvip", vip) Link to comment
1LoL1 Posted August 31, 2015 Author Share Posted August 31, 2015 its added.. i mean /setvip test and player test will see "outputChatBox" when i added to me i will see outputChatBox and when i'am in "VIP" i can't give next VIP, money Link to comment
Areion Posted August 31, 2015 Share Posted August 31, 2015 function vip(thePlayer, command,tplayer) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Admin")) then local VIP = aclGetGroup("VIP") local tplayer = getPlayerFromName(tplayer) if ( tplayer ) and isGuestAccount(getPlayerAccount(tplayer) ~= true then acladd = aclGroupAddObject (VIP, "user."..getAccountName(getPlayerAccount(tplayer)) if (acladd) then givePlayerMoney(tplayer, 1) outputChatBox("test passed.", tplayer, 255, 255, 255, true) else outputChatBox(getPlayerName(tplayer).." is already VIP.", thePlayer, 255, 0, 0, true) end else outputChatBox("Player not online or not logged in.", thePlayer, 255, 0, 0, true) end end end addCommandHandler("setvip", vip) Alright so you have to enter the player's name now not the account name, like a player is called "test" you type /setvip test and the player gets added to the ACL group VIP gets 1$ and an output, if the account has been added already or the player doesnt exist / is not logged in you'll get an error output. 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