JasperRieken Posted January 21, 2011 Posted January 21, 2011 i whas making the script but it doesn't work and can't figure out what i tried debugscript it sais somting like bad addEventHandler but i can't seem to fix it function skinStaff(player) if getElementType(player) == "player" then local team = getPlayerTeam(player) if team and getTeamName(team) == "Xuju Crew" then setElementModel( 217 ) end end end addEventHandler("onPlayerTeamJoin",skinStaff)
DiSaMe Posted January 21, 2011 Posted January 21, 2011 You skipped source element argument in addEventHandler. What's more, element argument in setElementModel is skipped too. -
JasperRieken Posted January 21, 2011 Author Posted January 21, 2011 so like this? function skinStaff(player) if getElementType(player) == "player" then local team = getPlayerTeam(player) if team and getTeamName(team) == "Xuju Crew" then setElementModel(source,217) end end end addEventHandler("onTeamJoin",source,skinStaff)
JasperRieken Posted January 21, 2011 Author Posted January 21, 2011 this doesn't work function skinStaff(player) if getElementType(player) == "player" then local team = getPlayerTeam(player) if team and getTeamName(team) == "Xuju Crew" then setElementModel(source,217) end end end addEventHandler("onPlayerTeamJoin",source,skinStaff)
DiSaMe Posted January 21, 2011 Posted January 21, 2011 I don't know how exactly onPlayerTeamJoin event is triggered, but I guess second argument addEventHandler must be root. And argument of setElementModel must be player. -
DiSaMe Posted January 21, 2011 Posted January 21, 2011 Is onPlayerTeamJoin a custom event? If yes, then you need to add it with addEvent and make sure it's triggered when the player joins the team, otherwise I don't know what you are doing -
SDK Posted January 22, 2011 Posted January 22, 2011 He probably doesn't know what he's doing. Don't start typing random events, use the WIKI! MTA has no event for team joins, so you'll have to dig in your code where teams are set and customize it there. Or if you're lucky onPlayerTeamJoin is triggered by one of your scripts, but then we'll need more details. Learn Lua - Learn to script - GUI scripting Scripter tools - Find/fix errors yourself(!) Don't pm me for scripting help, keep it for the Scripting subforum!
Castillo Posted January 22, 2011 Posted January 22, 2011 He is using the admin panel to set the teams, i was wondering why he don't use the panel also to set the skin. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
SDK Posted January 22, 2011 Posted January 22, 2011 Yeah, hadn't read his other topics yet Learn Lua - Learn to script - GUI scripting Scripter tools - Find/fix errors yourself(!) Don't pm me for scripting help, keep it for the Scripting subforum!
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