Jump to content

Police command [Solved]


Miika

Recommended Posts

Police not working, it not se player team.

function setPolice(policePlayer) 
    police = getPlayerName(policePlayer) 
    setPlayerSkin(policePlayer, 280) 
    giveWeapon(policePlayer, 3) 
    setPedWeaponSlot (policePlayer, 1) 
    setElementPosition (policePlayer, -1626, 675, 7.1875) 
    setPlayerTeam(policePlayer, PoliceTeam) 
    outputChatBox("" .. police .. " on nyt Poliisi!", getRootElement(), 255, 255, 0) 
end 
addCommandHandler("police", setPolice) 

StaffTeam = createTeam ("Staff", 105,0,91 ) 
ArmyTeam = createTeam ("Army", 12,105,0 ) 
FBITeam = createTeam ("FBI", 91,0,209 ) 
SwatTeam = createTeam ("SWAT", 15,0,112 ) 
PoliceTeam = createTeam ("Police", 29,0,217 ) 
CrimnalTeam = createTeam ("Criminal", 255,0,0 ) 
EmergencyTeam = createTeam ("Emergency", 0,242,255 ) 
CivilliansTeam = createTeam ("Civilians", 255,255,0 ) 
FreeroamTeam = createTeam ("Freeroam", 17,112,0 ) 
UnemployedTeam = createTeam ("Unemployed", 209,209,209 ) 

Edited by Guest
Link to comment
  • Moderators

Try this:

function setPolice(policePlayer) 
    local policeTeam = getTeamFromName("Police") 
    local police = getPlayerName(policePlayer) 
    setElementModel(policePlayer, 280) 
    giveWeapon(policePlayer, 3) 
    setPedWeaponSlot (policePlayer, 1) 
    setElementPosition (policePlayer, -1626, 675, 7.1875) 
    setPlayerTeam(policePlayer, policeTeam) 
    outputChatBox("" .. police .. " on nyt Poliisi!", getRootElement(), 255, 255, 0) 
end 
addCommandHandler("police", setPolice) 

Link to comment
Try this:
function setPolice(policePlayer) 
    local policeTeam = getTeamFromName("Police") 
    local police = getPlayerName(policePlayer) 
    setElementModel(policePlayer, 280) 
    giveWeapon(policePlayer, 3) 
    setPedWeaponSlot (policePlayer, 1) 
    setElementPosition (policePlayer, -1626, 675, 7.1875) 
    setPlayerTeam(policePlayer, policeTeam) 
    outputChatBox("" .. police .. " on nyt Poliisi!", getRootElement(), 255, 255, 0) 
end 
addCommandHandler("police", setPolice) 

thx

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