SkatCh Posted May 20, 2014 Share Posted May 20, 2014 hi guys please i need some i want to be a good scripter and i am doing my best but i still need some help anyways i create those teams with meta.xml file and it work fine : ( resource name : Teams ) local staff = createTeam("Staff", 255, 255, 255) local military = createTeam("Armed Forces", 90, 134, 55) local government = createTeam("Government", 132, 141, 137) local unemployed = createTeam("Unemployed", 255, 255, 0) local nonDuty = createTeam("Unoccupied", 240, 160, 213) local civilian = createTeam("Civilian Employees", 255, 255, 0) local Medic = createTeam("Paramedic", 0, 255, 255) local police = createTeam("Police Force", 0, 150, 255) local police = createTeam("Civilian Workers", 0, 150, 255) local criminal = createTeam("Criminals", 195, 0, 0) but my question is how can use exports function example i create medic job so i don't need to create medic team : function createMedicTeam () MedicTeam = createTeam ("Medic", 6, 183, 248) end addEventHandler ("onResourceStart", resourceRoot, createMedicTeam) just i want to use export method here : setPlayerTeam IsPlayerInTeam i tried this but it dosent work : exports.Teams:setPlayerTeam and exports.Teams:IsPlayerInTeam but it dosent' work please help me . i am sorry about my english Link to comment
pa3ck Posted May 20, 2014 Share Posted May 20, 2014 What do you mean? getPlayerTeam and setPlayerTeam are both MTA functions. You mean you want to create a function to check if the player is in a specific team? Link to comment
SkatCh Posted May 20, 2014 Author Share Posted May 20, 2014 yes i know they are MTA function , just i create some Teams ( medic , police , criminal etc ... ) just i want to call this resource when i want to create a job . example i createa Medic job so i need to create Medic Team right . but i already create it in (Teams) script (folder name Teams) just i want to call this resource . for more details this is a part of my server side : function createMedicTeam () MedicTeam = createTeam ("Medic", 6, 183, 248) end addEventHandler ("onResourceStart", resourceRoot, createMedicTeam) --- i want to remove Function createMedicTeam ----------- function joinMedic() oldSkin = getPedSkin(source) setPlayerTeam(source,MedicTeam) ---- and here i want to use export function to call (Teams) resource ----- setPlayerNametagColor ( source, 6, 183, 248 ) setElementModel(source,276) giveWeapon ( source, 41, 9000 ) setElementData( source, "Occupation", "Medic", true ) outputChatBox ("You are now employed as a Paramedic!",source,6, 183, 248) end end addEvent("setMedic", true) addEventHandler("setMedic",root,joinMedic) addEvent("medic:healing", true) Link to comment
Skuleris Posted May 20, 2014 Share Posted May 20, 2014 Maybe you can use getTeamFromName. setPlayerTeam(source,getTeamFromName("Medic")) Link to comment
SkatCh Posted May 20, 2014 Author Share Posted May 20, 2014 :fp: nvm Topic can be locked , i will try to fix it by myself . 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