Jump to content

getPlayerTeam help


A3kri

Recommended Posts

Hello ..

I'm a biggener lua developer, I'm having a problem in one of my scripts I'm trying to build.

function lookright() 
local skin = getPedSkin(client) 
local playerTeam = getPlayerTeam(client) 
if (playerTeam = getTeamName(ekri)) then 
if (client) then 
setPedSkin(client, skin+1) 
end 
else 
setPedSkin(client, 50) 
end 
end 
addEvent("right", true) 
addEventHandler("right", getRootElement(), right) 

the problem is in

if (playerTeam = getTeamName(ekri)) then 
  

is it right? I want if the player team is ekri then ... atm the skin of the player always become 50 .. so that means that knowing if the player is in ekri team is wrong thats why the script goes to the else function which sets the skin to 50 not +1

----------

also this doesn't work,

    outputChatBox (getPlayerTeam(client), client ) 

it should output a messsage with the player's team ..

Link to comment
function lookright ( ) 
    local skin = getElementModel ( client ) 
    local playerTeam = getPlayerTeam ( client ) 
    if ( playerTeam and getTeamName ( playerTeam ) == "ekri" ) then 
        setElementModel ( client, skin + 1 ) 
    else 
        setElementModel ( client, 50 ) 
    end 
end 
addEvent ( "right", true ) 
addEventHandler ( "right", getRootElement(), right ) 

Link to comment
function lookright ( ) 
    local skin = getElementModel ( client ) 
    local playerTeam = getPlayerTeam ( client ) 
    if ( playerTeam and getTeamName ( playerTeam ) == "ekri" ) then 
        setElementModel ( client, skin + 1 ) 
    else 
        setElementModel ( client, 50 ) 
    end 
end 
addEvent ( "right", true ) 
addEventHandler ( "right", getRootElement(), right ) 

it's working great, thanks.

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