John Smith Posted October 4, 2014 Posted October 4, 2014 which function do i need to remove team? If you find my post useful or if it helped you, please like my post Ingame name: ZoeN
The Don Posted October 4, 2014 Posted October 4, 2014 destroyElement آن يكون فكر المرء مختلآ , خيرآ من آن يكون فكره محتلآ ! my nick name in the game : =x=|DoN|=x= or 7eJAzZy- ( ͡° ͜ʖ ͡°) http://community.multitheftauto.com/ind ... &id=337164 my profile
John Smith Posted October 4, 2014 Author Posted October 4, 2014 umm something like this? function deleteTeam() for i,team in ipairs(getElementsByType("team")) do if getTeamName(team) == "Team Name" then destroyElement(team) else return end end end If you find my post useful or if it helped you, please like my post Ingame name: ZoeN
darhal Posted October 4, 2014 Posted October 4, 2014 You should pass the team name as an argument ! #include <iostream> int main() { std::cout << "C++ is amazing <3" << std::endl; return 0; } I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please
John Smith Posted October 4, 2014 Author Posted October 4, 2014 give me an example please i dont know how would code look like with the argument in function If you find my post useful or if it helped you, please like my post Ingame name: ZoeN
King12 Posted October 4, 2014 Posted October 4, 2014 function DeleteTeam () local delteam = getTeamFromName("Team Name") if (delteam) then destroyElement(delteam) else return end end)
darhal Posted October 4, 2014 Posted October 4, 2014 Its simple function deleteTeam(teamName) for i, team in ipairs(getElementsByType('team') do if getTeamName(team) == teamName then destroyElement(team) end end end also you can use getTeamFromName(teamName) #include <iostream> int main() { std::cout << "C++ is amazing <3" << std::endl; return 0; } I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please
Anubhav Posted October 4, 2014 Posted October 4, 2014 Dude it will return all team names o-O are you doing? function deleteTeam(teamName) for i, team in ipairs(getElementsByType('team') do if team == teamName then destroyElement(team) end end end See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
darhal Posted October 4, 2014 Posted October 4, 2014 It will work whats the problem but i said he can use getTeamFromName to delte team copy my code and use it like this outside the code eg : deleteTeam('Police') #include <iostream> int main() { std::cout << "C++ is amazing <3" << std::endl; return 0; } I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please
Anubhav Posted October 4, 2014 Posted October 4, 2014 Do you even know what is the loop returning? See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
darhal Posted October 4, 2014 Posted October 4, 2014 I think team userdata not ? #include <iostream> int main() { std::cout << "C++ is amazing <3" << std::endl; return 0; } I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please
Anubhav Posted October 4, 2014 Posted October 4, 2014 You edited the post. I was wrong, it should be like this. function deleteTeam(teamName) for i, team in ipairs(getElementsByType('team') do if team == getTeamName(teamName) then destroyElement(team) end end end See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
darhal Posted October 4, 2014 Posted October 4, 2014 I dont edit anything i swear #include <iostream> int main() { std::cout << "C++ is amazing <3" << std::endl; return 0; } I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please
Gr0x Posted October 5, 2014 Posted October 5, 2014 Why would you loop through all teams? function deleteTeam(teamName) if getTeamFromName(teamName) then destroyElement(getTeamFromName(teamName)) end end
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