Hello Guys.
I'm trying to learn how to make script.
I was making a special room for admins but it says TestRoom\script.lua:1: unexpected symbol near ´ ' ´
I need help. Here is my code:
local hqEnter = createMarker ( -1944.1850585938, 883.42474365234, 40.861415863037, 'arrow', 1, 0, 255, 0, 150 )
local hqExit = createMarker ( -1937.171875, 883.54663085938, 32.687938690186, 'arrow', 1, 0, 255, 0, 150 )
local hqAdminEnter = createMarker (-1965.48828125, 880.1640625, 21.552816390991, 'corona', 1, 0, 255, 0, 0)
local hqAdminExit = createMarker (-1966.7939453125, 880.14501953125, 21.552816390991, 'corona', 1, 0, 255, 0, 0)
local hqPartyGuns = createMarker (-1950.0562744141, 877.08581542969, 28.183406829834, 'cylinder', 1, 255, 0, 0, 150)
local hqAdminGuns = createMarker (-1980.4031982422, 879.88684082031, 20.843906402588, 'cylinder', 1, 0, 255, 0, 150)
--------------------------
function Enter( hitPlayer, matchingDimension )
local account = getPlayerAccount(hitPlayer)
aclGroups = if isObjectInACLGroup( 'user.'..getAccountName( account ), aclGetGroup( 'Member' ) ) then
setElementPosition ( hitPlayer, -1935, 884, 33 )
elseif aclGroups = if isObjectInACLGroup( 'user.'..getAccountName( account ), aclGetGroup( 'V.I.P' ) ) then
setElementPosition ( hitPlayer, -1935, 884, 33 )
elseif aclGroups = if isObjectInACLGroup( 'user.'..getAccountName( account ), aclGetGroup( 'Moderator' ) ) then
setElementPosition ( hitPlayer, -1935, 884, 33 )
elseif aclGroups = if isObjectInACLGroup( 'user.'..getAccountName( account ), aclGetGroup( 'Admin' ) ) then
setElementPosition ( hitPlayer, -1935, 884, 33 )
outputChatBox ( "Entering to the Room Test1",hitPlayer )
else
outputChatBox ( "Error Test1!",hitPlayer )
end
end
addEventHandler( "onMarkerHit", hqEnter, Enter )
function Exit( hitPlayer, matchingDimension )
setElementPosition ( hitPlayer, -1945, 884, 40 )
end
addEventHandler( "onMarkerHit", hqExit, Exit )
---------------------------------------------
function adminEnter( hitPlayer, matchingDimension )
local account = getPlayerAccount(hitPlayer)
if isObjectInACLGroup( 'user.'..getAccountName( account ), aclGetGroup( 'Admin' ) ) then
setElementPosition ( hitPlayer, -1967, 881, 22 )
outputChatBox ( "Entering to the Room Test2",hitPlayer )
else
outputChatBox ( "Error Test2!",hitPlayer )
end
end
addEventHandler( "onMarkerHit", hqAdminEnter, adminEnter )
function adminExit( hitPlayer, matchingDimension )
setElementPosition ( hitPlayer, -1962, 881, 22 )
end
addEventHandler( "onMarkerHit", hqAdminExit, adminExit )
---------------------------------------------
function partyGuns( hitPlayer, matchingDimension )
local account = getPlayerAccount(hitPlayer)
if isObjectInACLGroup( 'user.'..getAccountName( account ), aclGetGroup( 'Moderator' ) ) then
giveWeapon( hitPlayer, 29, 10000 )
giveWeapon( hitPlayer, 31, 10000 )
giveWeapon( hitPlayer, 34, 10000 )
giveWeapon( hitPlayer, 17, 10000 )
giveWeapon( hitPlayer, 46, 10000 )
giveWeapon( hitPlayer, 5, 1 )
setElementHealth ( hitPlayer, 1000 )
addEventHandler( "onMarkerHit", hqPartyGuns, partyGuns )
function adminGuns( hitPlayer, matchingDimension )
local account = getPlayerAccount(hitPlayer)
if isObjectInACLGroup( 'user.'..getAccountName( account ), aclGetGroup( 'Admin' ) ) then
giveWeapon( hitPlayer, 28, 10000 )
giveWeapon( hitPlayer, 31, 10000 )
giveWeapon( hitPlayer, 34, 10000 )
giveWeapon( hitPlayer, 39, 10000 )
giveWeapon( hitPlayer, 46, 10000 )
giveWeapon( hitPlayer, 9, 1 )
setElementHealth ( hitPlayer, 1000 )
addEventHandler( "onMarkerHit", hqAdminGuns, adminGuns )