Jump to content

Area51 rocket script [HELP]


Sande

Recommended Posts

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

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
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...