Guest User

/setvip

a guest
Jan 31st, 2012
416
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.27 KB | None | 0 0
  1. #include <a_samp>
  2. #include <zcmd>
  3. #include <sscanf2>
  4.  
  5. enum pData
  6. {
  7. vip
  8. };
  9. new PlayerData[MAX_PLAYERS][pData];
  10. new vlevel,Nam[MAX_PLAYER_NAME],pname[MAX_PLAYER_NAME],str[128],ID;
  11.  
  12. CMD:setvip(playerid, params[])
  13. {
  14. if(!IsPlayerAdmin(playerid)) return 0;//This will make the command work for rcon, if your not rcon it will do SERVER: Unknown Command
  15. if(sscanf(params,"ui",ID,vlevel)) return SendClientMessage(playerid,0xFF9900AA, "USAGE: /setvip [playerid / partofname] [Level 1-3]");//If you do not use the format /setvip properly it will show how to
  16. if(ID == INVALID_PLAYER_ID) return SendClientMessage(playerid,0xFF0000FF, "That user is not connected.");//if its an unknown ID, it will show that person is not connected
  17. if(vlevel > 3) return SendClientMessage(playerid,0xFF0000FF,"AVAILABLE VIP LEVELS 1-3!"); //If you add a number over 3 for /setvip, ex: /setvip Tanush 1000, it will show that message
  18. if(vlevel == 0)//if you select vip level 0
  19. {
  20. if(PlayerData[ID][vip] == 0) return SendClientMessage(playerid,0xFF0000FF,"ERROR: That person is already level 0 vip!");// If the person you attempt to /setvip that is already level 0 vip, it will show that
  21. GetPlayerName(playerid,Nam, MAX_PLAYER_NAME);//Defines the playerid name
  22. GetPlayerName(ID,pname,MAX_PLAYER_NAME);//Defines the other player name
  23. format(str, sizeof(str),"%s has set your VIP Level to 0!",Nam);//string
  24. SendClientMessage(ID,0xFF9900AA,str);//It will send the other person a message that %s has set your vip level to 0
  25. format(str,sizeof(str),"You had set %s VIP Level to 0!",pname);//string
  26. SendClientMessage(playerid,0xFF9900AA,str);//This will send you that you had set %s vip level to 0
  27. PlayerData[ID][vip] = 0;//Sets the other person vip level to 0
  28. }
  29. if(vlevel == 1)//if you select vip level 1
  30. {
  31. if(PlayerData[ID][vip] == 1) return SendClientMessage(playerid,0xFF0000FF,"ERROR: That person is already level 1 vip!");//If the person you attempt to /setvip that is already level 1 vip, it will show that
  32. GetPlayerName(playerid,Nam, MAX_PLAYER_NAME);//defines the playerid name
  33. GetPlayerName(ID,pname,MAX_PLAYER_NAME);//defines the other player name
  34. format(str, sizeof(str),"%s has set your VIP Level to 1 (BRONZE VIP)!",Nam);//string
  35. SendClientMessage(ID,0xFF9900AA,str);//Sends the other person a message
  36. format(str, sizeof(str),"You had set %s VIP Level to 1 (BRONZE VIP)!",pname);//string
  37. SendClientMessage(playerid,0xFF9900AA,str);//Sends you a message
  38. PlayerData[ID][vip] = 1;//Sets the other person vip level to 1
  39. }
  40. if(vlevel == 2)//if you select vip level 2
  41. {
  42. if(PlayerData[ID][vip] == 2) return SendClientMessage(playerid,0xFF0000FF,"ERROR: That person is already level 2 vip!");//If the person you attempt to /setvip that is already level 2 vip, it will show that
  43. GetPlayerName(playerid,Nam, MAX_PLAYER_NAME);//defines playerid name
  44. GetPlayerName(ID,pname,MAX_PLAYER_NAME);//defines other person name
  45. format(str, sizeof(str),"%s has set your VIP Level to 2 (SILVER VIP)!",Nam);//string
  46. SendClientMessage(ID,0xFF9900AA,str);// Sends the other person a message
  47. format(str, sizeof(str),"You had set %s VIP Level to 2 (SILVER VIP)!",pname);//string
  48. SendClientMessage(playerid,0xFF9900AA,str);//sends you a message
  49. PlayerData[ID][vip] = 2;//sets the other person vip level to 2
  50. }
  51. if(vlevel == 3)// if you select vip level 3
  52. {
  53. if(PlayerData[ID][vip] == 3) return SendClientMessage(playerid,0xFF0000FF,"ERROR: That person is already level 3 vip!");//if the person you attempt to /setvip that is already level 3 vip, it will show that
  54. GetPlayerName(playerid,Nam, MAX_PLAYER_NAME);//defines playerid name
  55. GetPlayerName(ID,pname,MAX_PLAYER_NAME);//defines the other person name
  56. format(str, sizeof(str),"%s has set your VIP Level to 3 (GOLD VIP)!",Nam);//string
  57. SendClientMessage(ID,0xFF9900AA,str);//sends the other person a message
  58. format(str, sizeof(str),"You had set %s VIP Level to 3 (GOLD VIP)!",pname);//String
  59. SendClientMessage(playerid,0xFF9900AA,str);//Sends you a message
  60. PlayerData[ID][vip] = 3;//sets the other person vip level to 3
  61. }
  62. return 1;
  63. }
  64. CMD:healme(playerid,params[])//command
  65. {
  66. if(PlayerData[playerid][vip] < 1) return 0;//well i entered 1 so it will work for vip level 1 and above, if somebody that uses /healme and is under vip level 1 (thats obviously 0), it will send them SERVER: Unknown Command.
  67. SetPlayerHealth(playerid,100);//just heals the player
  68. SendClientMessage(playerid,0xFF9900AA,"You have healed your self");//a nice message :)
  69. return 1;
  70. }
Advertisement
Add Comment
Please, Sign In to add comment