CobbTheWarriorsRPG Posted December 10, 2012 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 )
Castillo Posted December 10, 2012 Posted December 10, 2012 You have a missing 'end' to close the 'if' statement. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
CobbTheWarriorsRPG Posted December 10, 2012 Author 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 )
AhmadQTR Posted December 10, 2012 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. Nobody is perfect , I'm nobody. Skype : ahmad.nasser37
Callum Posted December 10, 2012 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) Retired
CobbTheWarriorsRPG Posted December 10, 2012 Author 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?
Castillo Posted December 10, 2012 Posted December 10, 2012 You can use: getTickCount More efficient than a timer. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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