K4stic Posted February 20, 2013 Share Posted February 20, 2013 (edited) --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 February 20, 2013 by Guest Link to comment
TAPL Posted February 20, 2013 Share Posted February 20, 2013 I didn' understand anything at all. Link to comment
K4stic Posted February 20, 2013 Author Share Posted February 20, 2013 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
iPrestege Posted February 20, 2013 Share Posted February 20, 2013 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
Castillo Posted February 20, 2013 Share Posted February 20, 2013 If I understood correctly, if you use this: if ( getTeamName ( getPlayerTeam ( thePlayer ) ) == "Civilian Workers" ) and ( getElementData( thePlayer , "Occupation" ) == "Delivery" ) then it doesn't work? Link to comment
Castillo Posted February 20, 2013 Share Posted February 20, 2013 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
Castillo Posted February 20, 2013 Share Posted February 20, 2013 What do you mean by nothing? it has to output the occupation of the player. Link to comment
K4stic Posted February 20, 2013 Author Share Posted February 20, 2013 not output like not avaible Link to comment
50p Posted February 20, 2013 Share Posted February 20, 2013 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
K4stic Posted February 20, 2013 Author Share Posted February 20, 2013 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
albers14 Posted February 20, 2013 Share Posted February 20, 2013 Whats the full name of the team? And where do the element data get attached to the player? 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