Jump to content

Guys serius help pls[NOT SOLVED]


K4stic

Recommended Posts

--Server side

function onVehicleEnter ( thePlayer ) 
    if ( not delses [ getElementModel ( source ) ] ) then 
        return 
    end 
  
    if ( not getPlayerTeam ( thePlayer ) ) then 
        return 
    end 
  
    if ( getTeamName ( getPlayerTeam ( thePlayer ) ) == "Civilian Workers" ) and ( getElementData( thePlayer , "Occupation" ) == "Delivery" ) then 
    --if ( getTeamName ( getPlayerTeam ( thePlayer ) ) == "Delivery" ) then 
        getNewdelLocation ( thePlayer ) 
    end 
end 
addEventHandler ( "onVehicleEnter", root, onVehicleEnter ) 

Problem: then i use this

if ( getTeamName ( getPlayerTeam ( thePlayer ) ) == "Civilian Workers" ) and ( getElementData( thePlayer , "Occupation" ) == "Delivery" ) then 

is not working but then i use

if ( getTeamName ( getPlayerTeam ( thePlayer ) ) == "Delivery" ) then 

it works what to do to be work with 1 wariant

sorry for my bad English

Edited by Guest
Link to comment

i won use this to be work =>

if ( getTeamName ( getPlayerTeam ( thePlayer ) ) == "Civilian Workers" ) and ( getElementData( thePlayer , "Occupation" ) == "Delivery" ) then 

and no this =>

if ( getTeamName ( getPlayerTeam ( thePlayer ) ) == "Delivery" ) then 

Link to comment

function onVehicleEnter ( thePlayer ) 
    if ( not delses [ getElementModel ( source ) ] ) then 
        return 
    end  
    if ( not getPlayerTeam ( thePlayer ) ) then 
        return 
    end 
if  ( getElementData( thePlayer , "Occupation" ) == "Delivery" ) then 
    if ( getTeamName ( getPlayerTeam ( thePlayer ) ) == "Delivery" ) then 
        getNewdelLocation ( thePlayer ) 
           end 
      end 
  end 
addEventHandler ( "onVehicleEnter", root, onVehicleEnter ) 
Link to comment

Use this and see what it outputs:

function onVehicleEnter ( thePlayer ) 
    if ( not delses [ getElementModel ( source ) ] ) then 
        return 
    end 
  
    if ( not getPlayerTeam ( thePlayer ) ) then 
        return 
    end 
  
    outputChatBox ( "Occupantion: ".. tostring ( getElementData( thePlayer , "Occupation" ) ) ) 
    if ( getTeamName ( getPlayerTeam ( thePlayer ) ) == "Civilian Workers" ) and ( getElementData( thePlayer , "Occupation" ) == "Delivery" ) then 
    --if ( getTeamName ( getPlayerTeam ( thePlayer ) ) == "Delivery" ) then 
        getNewdelLocation ( thePlayer ) 
    end 
end 
addEventHandler ( "onVehicleEnter", root, onVehicleEnter ) 

Link to comment

SKIPPER, it looks like you mixed up team name with element data. Look at the scoreboard and check if the team name is correct, then check what data is held on "Occupation" of the player. It's just simple debugging that will lead you to the success.

If you said:

....
if ( getTeamName ( getPlayerTeam ( thePlayer ) ) == "Civilian Workers" ) and ( getElementData( thePlayer , "Occupation" ) == "Delivery" ) then 

is not working but then i use

if ( getTeamName ( getPlayerTeam ( thePlayer ) ) == "Delivery" ) then 

it works what to do to be work with 1 wariant

sorry for my bad English

the second if statement works that means player is in "Delivery" team. Debug, debug, debug.

Link to comment

this is new one then i make the team Civilian and the Occupation Delivery

if ( getTeamName ( getPlayerTeam ( thePlayer ) ) == "Civilian Workers" ) and ( getElementData( thePlayer , "Occupation" ) == "Delivery" ) then 

this is the old one who i used then wos team Delivery

if ( getTeamName ( getPlayerTeam ( thePlayer ) ) == "Delivery" ) then 

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