SoiiNoob Posted March 4, 2012 Share Posted March 4, 2012 I want to make a marker when you are inside , change you to the team Mafia (teammaffia) I tryed local mafiapickup3 = createMarker ( 1991.4399414063, 1018.1683959961, 994.890625, "cylinder", 2.0, 255, 255, 0, 170 ) function mafiamarker (hitElement, matchingDimension) local elementType = getElementType( hitElement ) setPedSkin ( thePlayer, 127 ) setPlayerTeam ( thePlayer, teammaffia ) takeAllWeapons ( thePlayer ) giveWeapon ( thePlayer, 8, 1, true ) giveWeapon ( thePlayer, 32, 9999, true ) giveWeapon ( thePlayer, 16, 100, true ) giveWeapon ( thePlayer, 24, 300, true ) setPedArmor ( thePlayer, 0 ) addEventHandler( "onMarkerHit", mafiapickup3, mafiamarker ) end Link to comment
Castillo Posted March 4, 2012 Share Posted March 4, 2012 local mafiapickup3 = createMarker ( 1991.4399414063, 1018.1683959961, 994.890625, "cylinder", 2.0, 255, 255, 0, 170 ) function mafiamarker (hitElement, matchingDimension) local elementType = getElementType( hitElement ) if (elementType == "player") then setElementModel ( hitElement, 127 ) setPlayerTeam ( hitElement, teammaffia ) takeAllWeapons ( hitElement ) giveWeapon ( hitElement, 8, 1, true ) giveWeapon ( hitElement, 32, 9999, true ) giveWeapon ( hitElement, 16, 100, true ) giveWeapon ( hitElement, 24, 300, true ) setPedArmor ( hitElement, 0 ) end end addEventHandler( "onMarkerHit", mafiapickup3, mafiamarker ) Problems: 1: You added the event handler INSIDE the function, it has to go outside. 2: You we're using a invalid player argument. 3: setPedSkin is outdated, use setElementModel instead. 4: You forgot to check if the element type was a player. Link to comment
SoiiNoob Posted March 4, 2012 Author Share Posted March 4, 2012 thanks ! now it works , but i want the marker in a interior and don't show Link to comment
Castillo Posted March 4, 2012 Share Posted March 4, 2012 You're welcome. Use setElementInterior to set a element interior. Link to comment
SoiiNoob Posted March 4, 2012 Author Share Posted March 4, 2012 yep , thanks =) fixed local mafiapickup3 = createMarker ( 1977.460937, 1026.2985839844, 994.46875, "cylinder", 2.0, 255, 255, 0, 170 ) setElementInterior (mafiapickup3 , 10, 1977.4609375, 1026.2985839844, 994.46875) setElementDimension (mafiapickup3 , 0) Link to comment
Castillo Posted March 4, 2012 Share Posted March 4, 2012 There's no need to use setElementDimension, default dimension is already 0. Link to comment
SoiiNoob Posted March 4, 2012 Author Share Posted March 4, 2012 you are right , thanks again. 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