Sande Posted July 14, 2013 Share Posted July 14, 2013 Can someone fix this? getPlayerTeam doens´t working. IDK why. function hit ( pla, dim, hitElement ) if getElementType ( pla ) == "player" then local vehicle = getPedOccupiedVehicle ( pla ) if vehicle or not vehicle then local armyTeam = getTeamFromName ( "Army" ) if ( armyTeam ) then outputChatBox ( "Tervetuloa valtion alueelle, "..getPlayerName(pla).."!", pla, 0, 150, 0 ) else setElementData ( pla, "inRestrictedArea", "true" ) triggerClientEvent ( pla, "destroyTrepassor", g_root, pla ) outputChatBox ( "***Valtion Tukikohta***", pla, 255, 0, 0 ) outputChatBox ( "* "..getPlayerName(pla).." on astunut valtion tukikohtaan, Ohjukset on laukaistu!", g_root, 255, 0, 0 ) end end end end addEventHandler ( "onColShapeHit", g_base_col, hit ) Link to comment
iMr.3a[Z]eF Posted July 14, 2013 Share Posted July 14, 2013 (edited) where is the ColShape And here if vehicle or not vehicle then do you want to check if is the player inside the vehicle? Edited July 14, 2013 by Guest Link to comment
JuniorMelo Posted July 14, 2013 Share Posted July 14, 2013 Test function hit ( pla, dim, hitElement ) if getElementType ( pla ) == "player" then local vehicle = getPedOccupiedVehicle ( pla ) if vehicle or not vehicle then Team = getPlayerTeam ( pla ) TeamName = getTeamFromName ( "Army" ) if ( Team ) == TeamName then outputChatBox ( "Tervetuloa valtion alueelle, "..getPlayerName(pla).."!", pla, 0, 150, 0 ) else setElementData ( pla, "inRestrictedArea", "true" ) triggerClientEvent ( pla, "destroyTrepassor", g_root, pla ) outputChatBox ( "***Valtion Tukikohta***", pla, 255, 0, 0 ) outputChatBox ( "* "..getPlayerName(pla).." on astunut valtion tukikohtaan, Ohjukset on laukaistu!", g_root, 255, 0, 0 ) end end end end addEventHandler ( "onColShapeHit", g_base_col, hit ) Link to comment
Sande Posted July 14, 2013 Author Share Posted July 14, 2013 Test function hit ( pla, dim, hitElement ) if getElementType ( pla ) == "player" then local vehicle = getPedOccupiedVehicle ( pla ) if vehicle or not vehicle then Team = getPlayerTeam ( pla ) TeamName = getTeamFromName ( "Army" ) if ( Team ) == TeamName then outputChatBox ( "Tervetuloa valtion alueelle, "..getPlayerName(pla).."!", pla, 0, 150, 0 ) else setElementData ( pla, "inRestrictedArea", "true" ) triggerClientEvent ( pla, "destroyTrepassor", g_root, pla ) outputChatBox ( "***Valtion Tukikohta***", pla, 255, 0, 0 ) outputChatBox ( "* "..getPlayerName(pla).." on astunut valtion tukikohtaan, Ohjukset on laukaistu!", g_root, 255, 0, 0 ) end end end end addEventHandler ( "onColShapeHit", g_base_col, hit ) Thanks, this working 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