opnaiC Posted May 23, 2016 Share Posted May 23, 2016 Hey, when a player hits the marker it doesnt output "Вы здесь не работаете!". But why ? Can anybody help me ? function fbskin(thePlayer) local fac = getElementData(thePlayer,"Faction") local rank = getElementData(thePlayer,"Rank") if (fac == 4) then if (rank == 0) then setElementModel(thePlayer,117) elseif (rank == 1) then setElementModel(thePlayer,163) elseif (rank == 2) then setElementModel(thePlayer,164) elseif (rank == 3) then setElementModel(thePlayer,286) elseif (rank == 4) then setElementModel(thePlayer,166) elseif (rank == 5) then setElementModel(thePlayer,165) end else outputChatBox ( "Вы здесь не работаете!", player, 0,191,255 ) end addEventHandler( "onMarkerHit", fbpickup, fbskin ) end Link to comment
ViRuZGamiing Posted May 23, 2016 Share Posted May 23, 2016 function fbskin(thePlayer) local fac = getElementData(thePlayer,"Faction") local rank = getElementData(thePlayer,"Rank") if (fac == 4) then if (rank == 0) then setElementModel(thePlayer,117) elseif (rank == 1) then setElementModel(thePlayer,163) elseif (rank == 2) then setElementModel(thePlayer,164) elseif (rank == 3) then setElementModel(thePlayer,286) elseif (rank == 4) then setElementModel(thePlayer,166) elseif (rank == 5) then setElementModel(thePlayer,165) end else outputChatBox ( "Вы здесь не работаете!", player, 0,191,255 ) end end addEventHandler( "onMarkerHit", fbpickup, fbskin) Link to comment
opnaiC Posted May 23, 2016 Author Share Posted May 23, 2016 function fbskin(thePlayer) local fac = getElementData(thePlayer,"Faction") local rank = getElementData(thePlayer,"Rank") if (fac == 4) then if (rank == 0) then setElementModel(thePlayer,117) elseif (rank == 1) then setElementModel(thePlayer,163) elseif (rank == 2) then setElementModel(thePlayer,164) elseif (rank == 3) then setElementModel(thePlayer,286) elseif (rank == 4) then setElementModel(thePlayer,166) elseif (rank == 5) then setElementModel(thePlayer,165) end else outputChatBox ( "Вы здесь не работаете!", player, 0,191,255 ) end end addEventHandler( "onMarkerHit", fbpickup, fbskin) And where is the difference ? Link to comment
ViRuZGamiing Posted May 23, 2016 Share Posted May 23, 2016 The eventhandler was inside the function so you had to call the function first to add the event. Link to comment
opnaiC Posted May 23, 2016 Author Share Posted May 23, 2016 The eventhandler was inside the function so you had to call the function first to add the event. I know but It wont work already tested... Link to comment
ViRuZGamiing Posted May 23, 2016 Share Posted May 23, 2016 Is this the entire code? where is 'fbpickup' defined? are there any errors (in console or debugscript 3) Link to comment
BEN. Posted May 23, 2016 Share Posted May 23, 2016 try this function fbskin(thePlayer) local fac = getElementData(thePlayer,"Faction") local rank = getElementData(thePlayer,"Rank") if (fac == 4) then if (rank == 0) then setElementModel(thePlayer,117) elseif (rank == 1) then setElementModel(thePlayer,163) elseif (rank == 2) then setElementModel(thePlayer,164) elseif (rank == 3) then setElementModel(thePlayer,286) elseif (rank == 4) then setElementModel(thePlayer,166) elseif (rank == 5) then setElementModel(thePlayer,165) end else outputChatBox ( "Вы здесь не работаете!", thePlayer, 0,191,255 ) end end addEventHandler( "onMarkerHit", fbpickup, fbskin) Link to comment
ViRuZGamiing Posted May 23, 2016 Share Posted May 23, 2016 I totally overlooked that player instead of thePlayer. Link to comment
opnaiC Posted May 23, 2016 Author Share Posted May 23, 2016 I totally overlooked that player instead of thePlayer. I will try it out tomorrow also I want to ask you what is the exactly difference between "player" and "thePlayer"? Link to comment
ViRuZGamiing Posted May 23, 2016 Share Posted May 23, 2016 I totally overlooked that player instead of thePlayer. I will try it out tomorrow also I want to ask you what is the exactly difference between "player" and "thePlayer"? you defined thePlayer not 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