Jump to content

[help]team lua


JasperRieken

Recommended Posts

Posted

i want to have a scipt if you join the Xuju Crew team you will not be able to be killed and yuo will get skin 217 but i really can't get it don't know how tryed mta wiki didn't work

Thank you for helping me

Posted
 function checkIfTeamRight() 
    local team = --check my message at bottom 
    if (team and getTeamName(source) == "Xuju Crew") then 
       cancelEvent() 
    end 
end 
addEventHandler("onClientPlayerDamage", getLocalPlayer(), checkIfTeamRight) 
  

Atleast have a real attempt before asking for help...

--check my message at bottom Is suppost be

local team = getPlayerTeam(source) but for some reason when sumbitting this message this happens...

local team = getPlayerTeam" class="kw2">getPlayerTeam (source)

Posted
setElementModel(source,217) 

that?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

When they join in the Xuju Crew witht this script

function checkIfTeamRight() 
local team = getPlayerTeam(source) 
if (team and getTeamName(source) == "Xuju Crew") then 
cancelEvent() 
end 
end 
addEventHandler("onClientPlayerDamage", getLocalPlayer(), checkIfTeamRight) 

Posted

that is not a script to join a team o_o

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

ow yeah extra

function checkIfTeamRight() 
local team = getPlayerTeam(source) 
if (team and getTeamName(source) == "Xuju Crew") then 
cancelEvent() 
end 
end 
addEventHandler("onClientPlayerDamage", getLocalPlayer(), checkIfTeamRight) 

it doesn't do anyting only thing he sais is bad playerpointer

Posted

i got this so far but doesn't work

function skinStaff() 
 if getElementType(source) == "player" then -- check if a player element hit the marker 
local team = getPlayerTeam(source) --Getting player's team 
if team and getTeamName(team) == "Xuju Crew" then -- if player is in team and team name is "Xuju Crew" 
setElementModel(source,217) 
end 
end 
end 
addEventHandler("onTeamJoin",skinStaff) 

Posted

There is no such event named "onTeamJoin", also the addEventHandler isn't even right.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

maybe you should explain us how you want it to work? like when the player spawns?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

there is no event to detect when a player joins a team, you could make your own event when you set him to the team.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Post the code you use to set the player to team.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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