Advertisement
EmmanuelU

Player Admin Check by EmmanuelU

Apr 15th, 2013
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. //replace gamertags with the yodada & yomamas
  2. // add these in your bottom of vars.h or somewhere global
  3.  
  4. void is_player_admin(int playerid){
  5. if(COMPARE_STRING(GET_PLAYER_NAME(playerid),"Yodada_69")) return true; //1
  6. if(COMPARE_STRING(GET_PLAYER_NAME(playerid),"Yomama_1")) return 2;
  7. if(COMPARE_STRING(GET_PLAYER_NAME(playerid),"Yomama_2")) return 3;
  8. if(COMPARE_STRING(GET_PLAYER_NAME(playerid),"Yomama_3")) return 4;
  9. return false; //0
  10. }
  11.  
  12. bool player_admin = false;
  13.  
  14. //make necessary changes to gamertags and add to bottom of vars.h
  15. void print_player_admin(void){
  16. if(!player_admin){
  17. for(i = 0; i<16; i++){
  18. if(!IS_NETWORK_PLAYER_ACTIVE(i)) continue;
  19. if (i == GetPlayerIndex()) continue;
  20. if(is_player_admin(i) == 1) { //gamertag Yodada_69
  21. print("Yodada_69 in da house!");
  22. player_admin = true;
  23. return;
  24. }
  25. else if(is_player_admin(i) == 2) { //gamertag Yomama_1
  26. print("Yomama_1 in da house!");
  27. player_admin = true;
  28. return;
  29. }
  30. else if(is_player_admin(i) == 2) { //gamertag Yomama_2
  31. print("Yomama_2 in da house!");
  32. player_admin = true;
  33. return;
  34. }
  35. else if(is_player_admin(i) == 4) { //gamertag Yomama_3
  36. print("Yomama_3 in da house!");
  37. player_admin = true;
  38. return;
  39. }
  40. }
  41. }
  42. else{
  43. player_admin = false
  44. for(i = 0; i<16; i++) if(is_player_admin(i) > 0){
  45. player_admin = true;
  46. return;
  47. }
  48. }
  49. return;
  50. }
  51.  
  52. //put this in the main(void)
  53.  
  54. print_player_admin();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement