Jump to content

HELP ME WITH BUG IN SCOREBOARD


Recommended Posts

That's because your code has some errors.

It's missing an end to close the if statement and also to close the function spawnPolice.

I suppose the code:

   triggerClientEvent ( "onPlayerChooseTeam", getRootElement(), teamName ) 
       end 
     end 

Is a part from the function spawnPolice.

Link to comment
  
function spawnPolice ( cityName, teamName, skinName ) 
    if ( teamName == "Police" and skinName == "Police" ) then 
        setPlayerTeam ( source, teamPolice ) 
        setTeamFriendlyFire( getTeamFromName(teamPolice), false ) 
        local x,y,z 
        x = 1608.10 
        y = -1686.58 
        z = 6.21 
        spawnPlayer ( source, x,y,z  ) 
        fadeCamera(source, true) 
        giveWeapon ( source, 3, 2000 ) 
        giveWeapon ( source, 22, 2000 ) 
        giveWeapon ( source, 32, 2000 ) 
        giveWeapon ( source, 25, 200 ) 
        setElementHealth ( source, 100 ) 
        setElementModel ( source,280 ) 
        setPedArmor ( source, 0 ) 
        triggerClientEvent ( "onPlayerChooseTeam", getRootElement(), teamName ) 
    end 
end 
      
addEvent("setPlayerTeam",true) 
addEventHandler("setPlayerTeam",resourceRoot,function(Police) 
setPlayerTeam(client,Police) 
end 
) 

Try it.

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...