Captain Cody Posted December 12, 2015 Share Posted December 12, 2015 Trying to to make script that shows the police which players have wanted levels function wantedlevelstuff (thePlayera) local policeTeam = getTeamFromName("Police") local militaryTeam = getTeamFromName("Military") outputChatBox ( "Look for the yellow moving blips on map.", thePlayera ) local playersa = getElementsByType ( "player" ) for theKey,thePlayera in ipairs(playersa) do local levela = getPlayerWantedLevel ( thePlayera ) if ( levela > 0 ) then local wantedBlip = createBlipAttachedTo ( thePlayera, 56 ) setElementVisibleTo ( wantedBlip, root, false ) setElementVisibleTo ( wantedBlip, thePlayera, true ) end end end Attaches a blip to the person who triggers it, but no one else with wanted level Link to comment
Anubhav Posted December 13, 2015 Share Posted December 13, 2015 Are you asking this? function wantedlevelstuff (player) local policeTeam = getTeamFromName("Police") local militaryTeam = getTeamFromName("Military") if getPlayerTeam( player ) == policeTeam or getPlayerTeam( player ) == militaryTeam then outputChatBox ( "Look for the yellow moving blips on map.", player ) local playersa = getElementsByType ( "player" ) for theKey,thePlayera in ipairs(playersa) do local levela = getPlayerWantedLevel ( thePlayera ) if ( levela > 0 ) then local wantedBlip = createBlipAttachedTo ( thePlayera, 56 ) setElementVisibleTo ( wantedBlip, root, false ) setElementVisibleTo ( wantedBlip, player, true ) end end end end This checks if the player is in Police or Military team then continues. You overwrote variables so it made it confusing. Then I maade it available only to police! Link to comment
Captain Cody Posted December 13, 2015 Author Share Posted December 13, 2015 well I already had that stuff put in, removed it due to testing. But the issue is, it's not creating the blips on other players 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