A3kri Posted August 1, 2013 Posted August 1, 2013 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 ..
Castillo Posted August 1, 2013 Posted August 1, 2013 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 )
A3kri Posted August 1, 2013 Author Posted August 1, 2013 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.
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