Black2 Posted November 16, 2015 Share Posted November 16, 2015 Hello,I Need remove the export,but if i remove this don't work why ? if (not exports.team:isPlayerInTeams(localPlayer, "Criminals")) then end why this don't work: if not isPlayerInTeams(localPlayer, "Criminals")) then Link to comment
EmBaby85 Posted November 16, 2015 Share Posted November 16, 2015 MTA doesn't have a function called "isPlayerInTeams" thats why the script requires an export (Make sure that the resource and the function are already existing. Link to comment
Moderators IIYAMA Posted November 16, 2015 Moderators Share Posted November 16, 2015 just copy past this useful function in your code: function isPlayerInTeam(player, team) assert(isElement(player) and getElementType(player) == "player", "Bad argument 1 @ isPlayerInTeam [player expected, got " .. tostring(player) .. "]") assert((not team) or type(team) == "string" or (isElement(team) and getElementType(team) == "team"), "Bad argument 2 @ isPlayerInTeam [nil/string/team expected, got " .. tostring(team) .. "]") return getPlayerTeam(player) == (type(team) == "string" and getTeamFromName(team) or (type(team) == "userdata" and team or (getPlayerTeam(player) or true))) end From: https://wiki.multitheftauto.com/wiki/IsPlayerInTeam and the custom function(isPlayerInTeams) can be used without any exports. 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