Guest User

Vip system v1.0

a guest
Dec 19th, 2012
628
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. /*
  2. #
  3. # # ###### System by
  4. # # # # # HavingGood
  5. # # # ######
  6. ### # #
  7. */
  8. //---include---
  9. #include <a_samp>
  10. #include <sscanf2>
  11. #include <zcmd>
  12. //---define---
  13. #define FILTERSCRIPT
  14. #define COLOR_GREEN 0x33AA33AA
  15. #define COLOR_RED 0xFF0000AA
  16. #define COLOR_YELLOW 0xFFFF00AA
  17. //---new---
  18. new bool:vip[MAX_PLAYERS];
  19.  
  20. CMD:givevip(playerid,cmdtext[])
  21. {
  22. new player;
  23. if(strcmp(PlayerName(playerid), "Admin1", false) != 0 && strcmp(PlayerName(playerid), "Admin2", false) != 0 && strcmp(PlayerName(playerid), "Admin3", false) != 0)
  24. return SendClientMessage(playerid,COLOR_RED, "You can not use this command!"); //Command on nickname
  25. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_YELLOW,"You're not the administrator");
  26. if(sscanf(cmdtext,"u",player)){
  27. SendClientMessage(playerid, -1, "Use: /givevip [player id]");
  28. return 1;
  29. }
  30. return ActiveVip(player);
  31. }
  32.  
  33. CMD:vipme(playerid, params[])
  34. {
  35. if(vip[playerid]) SendClientMessage(playerid, COLOR_YELLOW,"You are VIP!");
  36. else SendClientMessage(playerid, COLOR_YELLOW, "You are not vip!");
  37. return 1;
  38. }
  39.  
  40. CMD:vheal(playerid, params[]) //A typical vip command (Health)
  41. {
  42. if(!vip[playerid]) SendClientMessage(playerid, COLOR_RED, "You are not vip!");
  43. SetPlayerHealth(playerid, 100);
  44. return 1;
  45. }
  46.  
  47. CMD:varmor(playerid, params[]) //A typical vip command2 (Armor)
  48. {
  49. if(!vip[playerid]) SendClientMessage(playerid, COLOR_RED, "You are not vip!");
  50. SetPlayerArmour(playerid, 100);
  51. return 1;
  52. }
  53.  
  54. forward ActiveVip(playerid);
  55. public ActiveVip(playerid){
  56.  
  57. if(vip[playerid]) return 0;
  58.  
  59. vip[playerid]=true;
  60. SendClientMessage(playerid, COLOR_GREEN, "You received a vip account!");
  61. return 1;
  62. }
  63.  
  64. stock PlayerName(playerid)
  65. {
  66. new Name[MAX_PLAYER_NAME];
  67. GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
  68. return Name;
  69. }
Advertisement
Add Comment
Please, Sign In to add comment