Advertisement
Guest User

Untitled

a guest
Nov 14th, 2016
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. function CheckTeam ( role )
  2. local player = {}
  3. player[1] = role
  4. player[2] = GetTeamCha( role , 0 )
  5. player[3] = GetTeamCha( role , 1 )
  6. player[4] = GetTeamCha( role , 2 )
  7. player[5] = GetTeamCha( role , 3 )
  8. local n1 = 0
  9. local n2 = 0
  10. local n3 = 0
  11.  
  12. for j = 0 , 5 , 1 do
  13. if ValidCha( player[j] )== 1 then
  14. local lv_p = GetChaAttr ( player[j] , ATTR_LV )
  15. if lv_p >= 20 and lv_p <= 30 then
  16. n1 = n1 + 1
  17. elseif lv_p > 30 and lv_p <= 40 then
  18. n2 = n2 + 1
  19. elseif lv_p > 40 then
  20. n3 = n3 + 1
  21. end
  22. end
  23. end
  24. if n1 >= 1 and n2 >= 1 and n3>= 1 then
  25. return LUA_TRUE
  26. end
  27. end
  28.  
  29. --MissionSdk.lua, around line 2688!
  30. elseif conditions[i].func == CheckTeam then
  31. PRINT( "ConditionsTest: CheckTeam, p1 = ", conditions[i].p1 )
  32. local ret = CheckTeam( character, conditions[i].p1 )
  33. if ret ~= LUA_TRUE then
  34. PRINT( "ConditionsTest:CheckTeam = false" )
  35. return LUA_FALSE
  36. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement