ramzi Posted January 23, 2015 Posted January 23, 2015 hey guys i have this gate code over here,i wanted it to open for my acc name. error msg: [2015-01-22 19:03:47] WARNING: desert\gate2.lua:12: Bad argument @ 'getAccountName' [Expected account at argument 1, got boolean] [2015-01-22 19:03:49] WARNING: desert\gate2.lua:5: Bad argument @ 'getPlayerAccount' [Expected element at argument 1, got nil] Lua code: gate1 = createObject (980, -13.60, 2067.30,19, 0,0,90 ) gatecol = createColCircle (-13.60, 2067.30, -- s8) --> function OpenGates (thePlayer) if getAccountName(getPlayerAccount(player)) == "shooter" then moveObject (gate1,2000,-13.60,2067.30, 24.799 ) end end addEventHandler( "onColShapeHit", gatecol, OpenGates ) function CloseGates (thePlayer) if getAccountName(getPlayerAccount(player)) == "shooter" then moveObject (gate1,2000,-13.60, 2067.30,19 ) end end addEventHandler( "onColShapeLeave", gatecol, CloseGates )
The Don Posted January 23, 2015 Posted January 23, 2015 change if getAccountName(getPlayerAccount(player)) == "shooter" then to if getAccountName(getPlayerAccount(thePlayer)) == "shooter" then
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