Guest User

VIP system v1.1

a guest
Dec 19th, 2012
621
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.29 KB | None | 0 0
  1. /*
  2. #
  3. # # ###### System by
  4. # # # # # HavingGood
  5. # # # ######
  6. ### # #
  7. -----------------------------------------
  8. # # ### ###
  9. # # # # # #
  10. ## # # # #
  11. -------------------------------
  12. ' Do not remove the author ;) '
  13. -------------------------------
  14. */
  15. //---include---
  16. #include <a_samp>
  17. #include <sscanf2>
  18. #include <zcmd>
  19. //---define---
  20. #define FILTERSCRIPT
  21. #define COLOR_GREEN 0x33AA33AA
  22. #define COLOR_RED 0xFF0000AA
  23. #define COLOR_YELLOW 0xFFFF00AA
  24. //---new---
  25. new bool:vip[MAX_PLAYERS];
  26.  
  27. CMD:givevip(playerid,cmdtext[]){
  28. new player;
  29. if(strcmp(PlayerName(playerid), "Admin1", false) != 0 && strcmp(PlayerName(playerid), "Admin2", false) != 0 && strcmp(PlayerName(playerid), "Admin3", false) != 0)
  30. return SendClientMessage(playerid,COLOR_RED, "You can not use this command!"); //Command on nickname
  31. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_YELLOW,"You're not the administrator");
  32. if(sscanf(cmdtext,"u",player)){
  33. SendClientMessage(playerid, -1, "Use: /givevip [player id]");
  34. return 1;
  35. }
  36. return Activevip(player);}
  37.  
  38. CMD:delvip(playerid,cmdtext[]){
  39. new player;
  40. if(strcmp(PlayerName(playerid), "Admin1", false) != 0 && strcmp(PlayerName(playerid), "Admin2", false) != 0 && strcmp(PlayerName(playerid), "Admin3", false) != 0)
  41. return SendClientMessage(playerid,COLOR_RED, "You can not use this command!"); //Command on nickname
  42. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_YELLOW,"You're not the administrator");
  43. if(sscanf(cmdtext,"u",player)){
  44. SendClientMessage(playerid, -1, "Use: /delvip [player id]");
  45. return 1;
  46. }
  47. return Deactivevip(player);}
  48.  
  49. CMD:vipme(playerid, params[]){
  50. if(vip[playerid]) SendClientMessage(playerid, COLOR_YELLOW,"You are vip!");
  51. else SendClientMessage(playerid, COLOR_YELLOW, "You are not vip!");
  52. return 1;}
  53.  
  54. CMD:vheal(playerid, params[]){ //A typical vip command (Health)
  55. if(!vip[playerid]) SendClientMessage(playerid, COLOR_RED, "You are not vip!");
  56. SetPlayerHealth(playerid, 100);
  57. return 1;}
  58.  
  59. CMD:varmour(playerid, params[]){ //A typical vip command2 (Armor)
  60. if(!vip[playerid]) SendClientMessage(playerid, COLOR_RED, "You are not vip!");
  61. SetPlayerArmour(playerid, 100);
  62. return 1;}
  63.  
  64. CMD:vnight(playerid, params[]){
  65. if(!vip[playerid]) SendClientMessage(playerid, COLOR_RED, "You are not vip!");
  66. new time;
  67. SetPlayerTime(playerid,time,0);
  68. return 1;}
  69.  
  70. CMD:vday(playerid, params[]){
  71. if(!vip[playerid]) SendClientMessage(playerid, COLOR_RED, "You are not vip!");
  72. new time;
  73. SetPlayerTime(playerid,time,12);
  74. return 1;}
  75.  
  76. CMD:vch(playerid, params[]){ //Vip chat
  77. new tmp[256];
  78. new string[256];
  79. if(!strlen(tmp)) {
  80. SendClientMessage(playerid, COLOR_RED, "Use: /vch [text]");
  81. return 1;
  82. }
  83. new name[MAX_PLAYER_NAME];
  84. GetPlayerName(playerid,name, sizeof(name));
  85. if(IsPlayerAdmin(playerid)){
  86. format(string, sizeof(string), "*Vip %s: %s",name, tmp);
  87. SendMessageTovip(COLOR_YELLOW, string);
  88. }
  89. return 1;}
  90.  
  91. CMD:about(playerid, params[]){ //Don't delete
  92. if(!vip[playerid]) SendClientMessage(playerid, COLOR_RED, "You are not vip!");
  93. new about[1000];
  94. strcat(about, "{CCFF99}The script was created by HavingGood\n");
  95. strcat(about, "{99FF99}Creation date: 19.12.12y\n");
  96. strcat(about, "{66FF66}Version: 1.1\n");
  97. strcat(about, "{FF6633}Merry Christmas!\n");
  98. ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "About",about , "Ok", "");
  99. return 1;}
  100.  
  101. CMD:vcmd(playerid, params[]){ //Don't delete
  102. if(!vip[playerid]) SendClientMessage(playerid, COLOR_RED, "You are not vip!");
  103. new vcmd[1000];
  104. strcat(vcmd, "{FFFFFF}Vip Commands\n");
  105. strcat(vcmd, "{FFFFFF}Admin Commands:\n");
  106. strcat(vcmd, " \n");
  107. strcat(vcmd, "{FF0000}/givevip [player id] - You give Vip\n");
  108. strcat(vcmd, "{FF0000}/delvip [player id] - You delete Vip\n");
  109. strcat(vcmd, " \n");
  110. strcat(vcmd, "{FF0000}Users Commands:\n");
  111. strcat(vcmd, " \n");
  112. strcat(vcmd, "{FF0000}/about - information about the script\n");
  113. strcat(vcmd, "{FF0000}/vipme - You check whether you have a VIP account\n");
  114. strcat(vcmd, "{FF0000}/vheal - Vip Heal\n");
  115. strcat(vcmd, "{FF0000}/varmour - Vip armour\n");
  116. strcat(vcmd, "{FF0000}/vnight - Change the weather\n");
  117. strcat(vcmd, "{FF0000}/vday - Change the weather\n");
  118. strcat(vcmd, "{FF0000}/vch [text] - VipChat\n");
  119. ShowPlayerDialog(playerid, 2, DIALOG_STYLE_MSGBOX, "VIP COMMANDS",vcmd , "Ok", "");
  120. return 1;}
  121.  
  122. forward Activevip(playerid);
  123. public Activevip(playerid){
  124.  
  125. if(vip[playerid]) return 0;
  126.  
  127. vip[playerid]=true;
  128. SendClientMessage(playerid, COLOR_GREEN, "You received a vip account!");
  129. return 1;}
  130.  
  131. forward Deactivevip(playerid);
  132. public Deactivevip(playerid){
  133.  
  134. if(vip[playerid]) return 0;
  135.  
  136. vip[playerid]=false;
  137. SendClientMessage(playerid, COLOR_GREEN, "Yours vip account has been deleted!");
  138. return 1;}
  139.  
  140. stock SendMessageTovip(color, const message[]) {
  141. for(new a=0; a<GetMaxPlayers(); a++) {
  142. if(IsPlayerConnected(a)) {
  143. if(vip[a]) {
  144. SendClientMessage(a, color, message);
  145. }
  146. }
  147. }
  148. }
  149. stock PlayerName(playerid)
  150. {
  151. new Name[MAX_PLAYER_NAME];
  152. GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
  153. return Name;
  154. }
Advertisement
Add Comment
Please, Sign In to add comment