K4stic Posted February 20, 2013 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 Giving a Fuck? Nope, That isn't in My Skill Set
K4stic Posted February 20, 2013 Author 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 Giving a Fuck? Nope, That isn't in My Skill Set
iPrestege Posted February 20, 2013 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 )
K4stic Posted February 20, 2013 Author Posted February 20, 2013 Not work Giving a Fuck? Nope, That isn't in My Skill Set
Castillo Posted February 20, 2013 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? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
K4stic Posted February 20, 2013 Author Posted February 20, 2013 yes is no work Giving a Fuck? Nope, That isn't in My Skill Set
Castillo Posted February 20, 2013 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 ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
K4stic Posted February 20, 2013 Author Posted February 20, 2013 Nothing Giving a Fuck? Nope, That isn't in My Skill Set
Castillo Posted February 20, 2013 Posted February 20, 2013 What do you mean by nothing? it has to output the occupation of the player. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
K4stic Posted February 20, 2013 Author Posted February 20, 2013 not output like not avaible Giving a Fuck? Nope, That isn't in My Skill Set
50p Posted February 20, 2013 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. - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
K4stic Posted February 20, 2013 Author 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 Giving a Fuck? Nope, That isn't in My Skill Set
albers14 Posted February 20, 2013 Posted February 20, 2013 Whats the full name of the team? And where do the element data get attached to the player?
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