JasperRieken Posted January 21, 2011 Share 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) Link to comment
DiSaMe Posted January 21, 2011 Share Posted January 21, 2011 You skipped source element argument in addEventHandler. What's more, element argument in setElementModel is skipped too. Link to comment
JasperRieken Posted January 21, 2011 Author Share 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) Link to comment
JasperRieken Posted January 21, 2011 Author Share 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) Link to comment
DiSaMe Posted January 21, 2011 Share 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. Link to comment
JasperRieken Posted January 21, 2011 Author Share Posted January 21, 2011 doesn't work Link to comment
DiSaMe Posted January 21, 2011 Share 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 Link to comment
SDK Posted January 22, 2011 Share 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. Link to comment
Castillo Posted January 22, 2011 Share 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. Link to comment
SDK Posted January 22, 2011 Share Posted January 22, 2011 Yeah, hadn't read his other topics yet Link to comment
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