CobbTheWarriorsRPG Posted December 10, 2012 Share Posted December 10, 2012 I make this script (Reading the wiki) for the VIP,When a user vip start this command they should be have a 100% armor but when i start the resource and i start the comand i dont have the armor,Whats is bad in the code? viparmor.lua function givePlayerArmor ( player, command ) local accountname = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ( "user.".. accountname, aclGetGroup ( "vip" ) ) then setPlayerArmor ( player, 100 ) end addCommandHandler ( "addarmor", givePlayerArmor ) Link to comment
Castillo Posted December 10, 2012 Share Posted December 10, 2012 You have a missing 'end' to close the 'if' statement. Link to comment
CobbTheWarriorsRPG Posted December 10, 2012 Author Share Posted December 10, 2012 So Castillo,The code must be function givePlayerArmor ( player, command ) local accountname = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ( "user.".. accountname, aclGetGroup ( "vip" ) ) then setPlayerArmor ( player, 100 ) end end addCommandHandler ( "addarmor", givePlayerArmor ) Link to comment
AhmadQTR Posted December 10, 2012 Share Posted December 10, 2012 Don't waste your time waiting Castillo to reply just test it and if you don't know what is wrong just debugscript 3 and keep trying and if you didn't know post it here. ^ And yes the code must be like that. Link to comment
Callum Posted December 10, 2012 Share Posted December 10, 2012 You may find it easier to code if it's correctly indented; function givePlayerArmor(player,command) local accountname = getAccountName(getPlayerAccount(player)) if isObjectInACLGroup("user."..accountname,aclGetGroup("vip")) then setPlayerArmor(player,100) end end addCommandHandler("addarmor",givePlayerArmor) Link to comment
CobbTheWarriorsRPG Posted December 10, 2012 Author Share Posted December 10, 2012 Tranks a lot,But how can i put only you can use the addarmor command whit the space of 5 minutes? setTimer? Link to comment
Castillo Posted December 10, 2012 Share Posted December 10, 2012 You can use: getTickCount More efficient than a timer. 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