Jump to content

Problem with If


AlexWo

Recommended Posts

Hello, I got a problem with an "If"

I want that if an player enters a marker, his Skin will get checked and if his skin is 287 (Army skin) an object will get attached to him.

Client Side with the Problem:

function attachobjectterror()  
attachElements ( objecttosteal, localPlayer, 0.5, 0, -0.5 ) 
 setMarkerColor ( attachedmarker, 0, 255, 0, 0 )    
  
end 
  
function attachobjectarmy()  
attachElements ( objecttosteal, localPlayer, 0.5, 0, -0.5 ) 
 setMarkerColor ( attachedmarker, 0, 255, 0, 0 )    
  
end 
  
  
function getModelID(hitElement) 
 if getElementType(hitElement) == "player" and (hitElement == localPlayer) then 
 theSkin = getElementModel ( getLocalPlayer() ) 
 if (theSkin == 287) then 
 triggerEvent(attachobjectarmy) 
 end 
    end 
 end 
 addEventHandler("onClientMarkerHit", getRootElement(), getModelID)  

I'm not sure how to solve that Problem... (at line 17)

Thank you for helping :)

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...