Advertisement
Guest User

PM SYstem By George

a guest
Dec 20th, 2014
928
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 4.88 KB | None | 0 0
  1. /*
  2.  
  3.   ,ad8888ba,
  4.  d8"'    `"8b
  5. d8'
  6. 88             ,adPPYba,  ,adPPYba,  8b,dPPYba,  ,adPPYb,d8  ,adPPYba,
  7. 88      88888 a8P_____88 a8"     "8a 88P'   "Y8 a8"    `Y88 a8P_____88
  8. Y8,        88 8PP""""""" 8b       d8 88         8b       88 8PP"""""""
  9.  Y8a.    .a88 "8b,   ,aa "8a,   ,a8" 88         "8a,   ,d88 "8b,   ,aa
  10.   `"Y88888P"   `"Ybbd8"'  `"YbbdP"'  88          `"YbbdP"Y8  `"Ybbd8"'
  11.                                                  aa,    ,88
  12.                                                   "Y8bbdP"
  13.                 Don't Edit The Script Just If You Are A Good Scripter
  14.                                 PM System By GEORGE
  15.                 Don't Edit The Script Just If You Are A Good Scripter
  16.                                                                               */
  17. #define FILTERSCRIPT
  18. ///////Includes////////////////
  19. #include <a_samp>
  20. #include <zcmd>
  21. #include <sscanf2>
  22. #include <YSI\y_ini>
  23. ///////////////////////////////
  24. ///////////Colours/////////////
  25. #define COLOR_RED 0xFF0000FF
  26. #define COLOR_YELLOW 0xFFFF00AA
  27. #define COLOR_ORANGE 0xFF9900AA
  28. ///////////////////////////////
  29. ////////////Enum///////////////
  30. enum PMInfo
  31. {
  32.         LastPM,
  33.         NoPM,
  34. };
  35. new pInfo[MAX_PLAYERS][PMInfo];
  36. ///////////////////////////////
  37.  
  38. #if defined FILTERSCRIPT
  39.  
  40. public OnFilterScriptInit()
  41. {
  42.     print("\n**************************************");
  43.     print("*        PM System Made By George      *");
  44.     print("*        Don't Remove My Credits!      *");
  45.     print("*               [ LOADED ]             *");
  46.     print("**************************************\n");
  47.     return 1;
  48. }
  49.  
  50. public OnFilterScriptExit()
  51. {
  52.     return 1;
  53. }
  54.  
  55. #endif
  56.  
  57. CMD:pm(playerid, params[])
  58. {
  59.     new pName[MAX_PLAYER_NAME], string[250], String[250],target, tName[MAX_PLAYER_NAME];
  60.     if(sscanf(params, "us[50]",target,params)) return SendClientMessage(playerid, -1, "{FF0000}USAGE : {FF0000}/pm [ID][MESSAGE]");
  61.     if(target == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "ERROR : {FF0000}Invalid Player Id");
  62.     if(target == playerid) return SendClientMessage(playerid, 0, "ERROR : {FF0000}You Cannot PM Your Self!");
  63.     if(pInfo[target][NoPM]) return SendClientMessage(playerid, -1, "ERROR : {FF0000}This Player Has NoPM On!");
  64.     GetPlayerName(playerid, pName, sizeof(pName));
  65.     GetPlayerName(target, tName, sizeof(tName));
  66.     format(string ,sizeof(string), "{C0C0C0}|- PM From %s : %s -|", pName, params);
  67.     SendClientMessage(target,0, string);
  68.     format(String, sizeof(String), "{C0C0C0}|- PM Sent To %s -|", tName);
  69.     SendClientMessage(playerid, 0, String);
  70.     return 1;
  71. }
  72.  
  73. CMD:nopm(playerid, params[])
  74. {
  75.     if(pInfo[playerid][NoPM] == 0)
  76.     {
  77.     pInfo[playerid][NoPM] = 1;
  78.     SendClientMessage(playerid, -1, "{FF0000}INFO : {FFFFFF}You Have Enabled NoPM No One Will Be Able To PM You!");
  79.     }
  80.     else
  81.     {
  82.     pInfo[playerid][NoPM] = 0;
  83.     SendClientMessage(playerid, -1, "{FF0000}INFO : {FFFFFF}You Have Disabled NoPM EveryOne Will Be Able To PM You!");
  84.     }
  85.     return 1;
  86. }
  87.  
  88. CMD:reply(playerid, params[])
  89. {
  90.     new pName[MAX_PLAYER_NAME], string[128],target, tName[MAX_PLAYER_NAME];
  91.     if(sscanf(params, "s", params)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /reply [MESSAGE]");
  92.     new pID = pInfo[playerid][LastPM];
  93.     if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, COLOR_RED, "ERROR : Player is not connected.");
  94.     if(pID == playerid) return SendClientMessage(playerid, COLOR_RED, "ERROR : You cannot PM yourself.");
  95.     if(pInfo[pID][NoPM] == 1) return SendClientMessage(playerid, COLOR_RED, "ERROR : This player has NoPM on you cannot PM his or reply him back!");
  96.     GetPlayerName(playerid, pName, sizeof(pName));
  97.     GetPlayerName(target, tName, sizeof(tName));
  98.     format(string, sizeof(string), "{C0C0C0}|- PM Sent To %s -|", tName, params);
  99.     SendClientMessage(playerid, COLOR_YELLOW, string);
  100.     format(string, sizeof(string), "{C0C0C0}|- PM From %s : %s -|", pName, params);
  101.     SendClientMessage(pID, COLOR_YELLOW, string);
  102.     pInfo[pID][LastPM] = playerid;
  103.     return 1;
  104. }
  105.  
  106. CMD:r(playerid, params[])
  107. {
  108.     new pName[MAX_PLAYER_NAME], string[128],target, tName[MAX_PLAYER_NAME];
  109.     if(sscanf(params, "s", params)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /reply [MESSAGE]");
  110.     new pID = pInfo[playerid][LastPM];
  111.     if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, COLOR_RED, "ERROR : Player is not connected.");
  112.     if(pID == playerid) return SendClientMessage(playerid, COLOR_RED, "ERROR : You cannot PM yourself.");
  113.     if(pInfo[pID][NoPM] == 1) return SendClientMessage(playerid, COLOR_RED, "ERROR : This player has NoPM on you cannot PM his or reply him back!");
  114.     GetPlayerName(playerid, pName, sizeof(pName));
  115.     GetPlayerName(target, tName, sizeof(tName));
  116.     format(string, sizeof(string), "{C0C0C0}|- PM Sent To %s -|", tName, params);
  117.     SendClientMessage(playerid, COLOR_YELLOW, string);
  118.     format(string, sizeof(string), "{C0C0C0}|- PM From %s : %s -|", pName, params);
  119.     SendClientMessage(pID, COLOR_YELLOW, string);
  120.     pInfo[pID][LastPM] = playerid;
  121.     return 1;
  122. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement