Jump to content

whats is bad in this code?


Recommended Posts

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...