joedajoester Posted October 20, 2011 Share Posted October 20, 2011 I tried making this script for when someone goes up to the admin base gate and it outputs a client side message. g_base_col = createColCuboid ( 3109.0913085938, -842.58416748047, 28.436388015747, 250, 280, 20 ) if isObjectInACLGroup ( "user." .. playername, aclGetGroup ( "Admin" ) ) then function hit ( pla, dim ) if getElementType ( pla ) == "player" then local vehicle = getPedOccupiedVehicle ( pla ) if vehicle or not vehicle then localPlayerName = getPlayerName(getLocalPlayer()) outputChatBox ( "Welcome to the admin base,"..localPlayerName ) else setElementData ( pla, "inArea", "true" ) triggerClientEvent ( pla, "destroyTrepassor", g_root, pla ) outputChatBox ( "You must be part of the staff to enter", pla, 255, 0, 0 ) end end end addEventHandler ( "onColShapeHit", g_base_col, hit ) function leave ( pla, dim ) if getElementType ( pla ) == "player" then local vehicle = getPedOccupiedVehicle ( pla ) if vehicle or not vehicle then outputChatBox ( "Good Bye!", pla, 0, 250, 0 ) else setElementData ( pla, "inRestrictedArea", "false" ) triggerClientEvent ( pla, "destroyTimers", g_root, pla ) outputDebugString ( "*"..getPlayername(pla).." has left col shape" ) end end end end addEventHandler ( "onColShapeLeave", g_base_col, leave ) The error i get is: attempt to concatenate global'playerName' a nil value Thanks for any help Link to comment
JR10 Posted October 20, 2011 Share Posted October 20, 2011 g_base_col = createColCuboid ( 3109.0913085938, -842.58416748047, 28.436388015747, 250, 280, 20 ) function hit ( pla, dim ) if getElementType ( pla ) == "player" then local playername = getPlayerName(player) if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(pla)), aclGetGroup ( "Admin" ) ) then local vehicle = getPedOccupiedVehicle ( pla ) if vehicle then outputChatBox ( "Welcome to the admin base,"..playername ) end setElementData ( pla, "inArea", "true" ) triggerClientEvent ( pla, "destroyTrepassor", g_root, pla ) outputChatBox ( "You must be part of the staff to enter", pla, 255, 0, 0 ) end end end addEventHandler ( "onColShapeHit", g_base_col, hit ) function leave ( pla, dim ) if getElementType ( pla ) == "player" then if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(pla)), aclGetGroup ( "Admin" ) ) then local vehicle = getPedOccupiedVehicle ( pla ) if vehicle or not vehicle then outputChatBox ( "Good Bye!", pla, 0, 250, 0 ) end else setElementData ( pla, "inRestrictedArea", "false" ) triggerClientEvent ( pla, "destroyTimers", g_root, pla ) outputDebugString ( "*"..getPlayerName(pla).." has left col shape" ) end end end addEventHandler ( "onColShapeLeave", g_base_col, leave ) Link to comment
joedajoester Posted October 20, 2011 Author Share Posted October 20, 2011 Thank for your reply, but i tried this script and nothing happens. I get no error but nothing happens with this script. Please help me someone. Link to comment
Charlie_Jefferson Posted October 21, 2011 Share Posted October 21, 2011 g_base_col = createColCuboid ( 3109.0913085938, -842.58416748047, 28.436388015747, 250, 280, 20 ) function hit ( pla, dim, thePlayer ) if isObjectInACLGroup ( "user." .. thePlayer, aclGetGroup ( "Admin" ) ) then getElementType ( pla ) == "player" local vehicle = getPedOccupiedVehicle ( pla ) if vehicle or not vehicle then localPlayerName = getPlayerName(getLocalPlayer()) outputChatBox ( "Welcome to the admin base,"..localPlayerName ) else setElementData ( pla, "inArea", "true" ) triggerClientEvent ( pla, "destroyTrepassor", g_root, pla ) outputChatBox ( "You must be part of the staff to enter", pla, 255, 0, 0 ) end end end addEventHandler ( "onColShapeHit", g_base_col, hit ) function leave ( pla, dim ) if getElementType ( pla ) == "player" then local vehicle = getPedOccupiedVehicle ( pla ) if vehicle or not vehicle then outputChatBox ( "Good Bye!", pla, 0, 250, 0 ) else setElementData ( pla, "inRestrictedArea", "false" ) triggerClientEvent ( pla, "destroyTimers", g_root, pla ) outputDebugString ( "*"..getPlayername(pla).." has left col shape" ) end end end end addEventHandler ( "onColShapeLeave", g_base_col, leave ) 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