opnaiC Posted May 23, 2016 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
ViRuZGamiing Posted May 23, 2016 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)
opnaiC Posted May 23, 2016 Author 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 ?
ViRuZGamiing Posted May 23, 2016 Posted May 23, 2016 The eventhandler was inside the function so you had to call the function first to add the event.
opnaiC Posted May 23, 2016 Author 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...
ViRuZGamiing Posted May 23, 2016 Posted May 23, 2016 Is this the entire code? where is 'fbpickup' defined? are there any errors (in console or debugscript 3)
BEN. Posted May 23, 2016 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)
ViRuZGamiing Posted May 23, 2016 Posted May 23, 2016 I totally overlooked that player instead of thePlayer.
opnaiC Posted May 23, 2016 Author 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"?
ViRuZGamiing Posted May 23, 2016 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
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