Thivenin Posted August 5, 2013 Share Posted August 5, 2013 hai, I need again help.... like everyday ^^ local allowedTeams = { ["USOC Member"] = true } firstObject = createObject ( 974, 1153.8, -1766.09, 18.39 ) secoundObject = createObject ( 974, 1154.69, -1766.09, 18.39 ) local open = false function USOCDoor () local playerTeam = getPlayerTeam ( source ) if getTeamName ( playerTeam ) == "USOC Member" then if open then moveObject ( firstObject, 3000, 1153.8, -1766.09, 18.39 ) moveObject ( secoundObject, 3000, 1154.69, -1766.09, 18.39 ) open = true else if not open then moveObject ( firstObject, 3000, 1153.8, -1766.09, 0 ) moveObject ( secoundObject, 3000, 1154.69, -1766.09, 0 ) end end end end addCommandHandler ( "USOCdoor", USOCDoor ) that should open/close the door if we do /USOCdoor and only if we are in USOC Member team but I have 2 error : Bad argument @ 'getPlayerTeamName' Bad argument @ 'getTeamName' I tried alot of thing, nothing working Link to comment
EstrategiaGTA Posted August 5, 2013 Share Posted August 5, 2013 Try this. local allowedTeams = { ["USOC Member"] = true } firstObject = createObject ( 974, 1153.8, -1766.09, 18.39 ) secoundObject = createObject ( 974, 1154.69, -1766.09, 18.39 ) local open = false function USOCDoor () local playerTeam = getPlayerTeam ( source ) if (getTeamName ( playerTeam ) == "USOC Member") then if open then moveObject ( firstObject, 3000, 1153.8, -1766.09, 18.39 ) moveObject ( secoundObject, 3000, 1154.69, -1766.09, 18.39 ) open = true else if not open then moveObject ( firstObject, 3000, 1153.8, -1766.09, 0 ) moveObject ( secoundObject, 3000, 1154.69, -1766.09, 0 ) end end end end addCommandHandler ( "USOCdoor", USOCDoor ) Link to comment
Vision Posted August 5, 2013 Share Posted August 5, 2013 local allowedTeams = { [ "USOC Member" ] = true } firstObject = createObject ( 974, 1153.8, -1766.09, 18.39 ) secoundObject = createObject ( 974, 1154.69, -1766.09, 18.39 ) local open = false function USOCDoor ( source ) local team = getPlayerTeam ( source ) if ( team and allowedTeams [ getTeamName ( team ) ] ) then if ( open ) then moveObject ( firstObject, 3000, 1153.8, -1766.09, 18.39 ) moveObject ( secoundObject, 3000, 1154.69, -1766.09, 18.39 ) open = false else moveObject ( firstObject, 3000, 1153.8, -1766.09, 0 ) moveObject ( secoundObject, 3000, 1154.69, -1766.09, 0 ) open = true end end end addCommandHandler ( "USOCdoor", USOCDoor ) Link to comment
Thivenin Posted August 5, 2013 Author Share Posted August 5, 2013 u.u SAUR player are good scripter ^^ first one doesn't work, same errors but secound one works, thanks you very much I finished my long script wich I'm doing since thursday 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