Xeno Posted January 22, 2012 Posted January 22, 2012 function checkRank(player) local account = getPlayerAccount(player) if (account) then if (isGuestAccount(account)) then outputChatBox("hello") end This gives me a bad arguement at "getPlayerAccount".. Please help me, Thanks, Xeno.
Castillo Posted January 22, 2012 Posted January 22, 2012 function checkRank(player) local account = getPlayerAccount(player) if (account and isGuestAccount(account)) then outputChatBox("hello") end end Show us how you execute "checkRank" function. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Xeno Posted January 22, 2012 Author Posted January 22, 2012 This is how I execute it: function checkRank(player) local account = getPlayerAccount(player) if (account and isGuestAccount(account)) then setElementData(player, "Rank","Login") local kills = tonumber(getElementData(player,"Zombie kills")) elseif (kills >= 25 and kills <= 49) then setElementData(player, "Rank","Rookie") end end addEventHandler("onPlayerLogout", getRootElement(), checkRank) addEventHandler("onPlayerLogin", getRootElement(), checkRank) addEventHandler("onPlayerJoin", getRootElement(), checkRank) I ran into some problems: 12:attempted to compare number with nil and... Bad argument at getPlayerAccount
Castillo Posted January 22, 2012 Posted January 22, 2012 function checkRank() local account = getPlayerAccount(source) if (account and isGuestAccount(account)) then setElementData(source, "Rank","Login") return end local kills = tonumber(getElementData(source,"Zombie kills")) if (kills >= 25 and kills <= 49) then setElementData(source, "Rank","Rookie") end end addEventHandler("onPlayerLogout", getRootElement(), checkRank) addEventHandler("onPlayerLogin", getRootElement(), checkRank) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Castillo Posted January 22, 2012 Posted January 22, 2012 You're welcome. 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