Jump to content

Verify that the name is in the table !


Recommended Posts

I need help to verify, if the name is listed in the table but it is not working, thx since now !

tableNamePlayersTFO = { 
	{theBlack},
	{Alpicture},
	{Delmon}
},

MarkerTFO = createMarker ( 2772.85, -2514.28, 13.63 - 1, 'cylinder', 5.0, 255, 0, 0, 0 )
MarkerTwoTFO = createMarker ( 2767.72, -2518.99, 13.64 - 1, 'cylinder', 5.0, 255, 0, 0, 0 )
  
function SetSkinTFO(player)
	if getElementData(player,'vipskin') == true then
	else
		if getElementType ( player ) == "vehicle"  then
		else
			if getPlayerName ( player ) == ( tableNamePlayersTFO ) then
				if (getPlayerSkin(player) == 290) then
				else
					setPlayerSkin(player, 290)	
				end
			else
				local PlayerTeamTFO = getPlayerTeam ( player ) 
				local TeamNTFO = getTeamFromName ( "The First Order" ) 
				if isElementWithinMarker ( player, MarkerTFO ) or isElementWithinMarker ( player, MarkerTwoTFO )  then 
					if PlayerTeamTFO == TeamNTFO then 
						if (getPlayerSkin(player) == 288) then
						else
							setPlayerSkin(player, 288)
						end
					end 
				end
			end
		end
	end
end 
addEventHandler("onMarkerHit", MarkerTFO, SetSkinTFO)
addEventHandler("onMarkerHit", MarkerTwoTFO, SetSkinTFO)

 

Link to comment
tableNamePlayersTFO = { 
    {"theBlack"},
    {"Alpicture"},
    {"Delmon"}
},

MarkerTFO = createMarker ( 2772.85, -2514.28, 13.63 - 1, 'cylinder', 5.0, 255, 0, 0, 0 )
MarkerTwoTFO = createMarker ( 2767.72, -2518.99, 13.64 - 1, 'cylinder', 5.0, 255, 0, 0, 0 )
  
function SetSkinTFO(player)
    if getElementData(player,'vipskin') == true then
    else
        if getElementType ( player ) == "vehicle"  then
        else
            for i, v in ipairs(tableNamePlayersTFO) do 
            if getPlayerName ( player ) == ( v[1] ) then
                if (getPlayerSkin(player) == 290) then
                else
                    setPlayerSkin(player, 290)    
                end
            end
            else
                local PlayerTeamTFO = getPlayerTeam ( player ) 
                local TeamNTFO = getTeamFromName ( "The First Order" ) 
                if isElementWithinMarker ( player, MarkerTFO ) or isElementWithinMarker ( player, MarkerTwoTFO )  then 
                    if PlayerTeamTFO == TeamNTFO then 
                        if (getPlayerSkin(player) == 288) then
                        else
                            setPlayerSkin(player, 288)
                        end
                    end 
                end
            end
        end
    end
end 
addEventHandler("onMarkerHit", MarkerTFO, SetSkinTFO)
addEventHandler("onMarkerHit", MarkerTwoTFO, SetSkinTFO)

This will work 

  • Thanks 1
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...