Guest User

CookiePM

a guest
Dec 10th, 2011
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 4.67 KB | None | 0 0
  1. #define FILTERSCRIPT
  2.  
  3. #include <a_samp>
  4. #include <sscanf2>
  5. #include <zcmd>
  6.  
  7. #define PM_SENT_COLOR 0xFFFF00AA
  8. #define PM_RECIEVED_COLOR 0x33CCFFAA
  9. #define COLOR_ERROR 0xAFAFAFAA
  10.  
  11. new MenuPlayerClickedID;
  12. new WhoLastPMed;
  13.  
  14. #define ReplyDialog 1335
  15. #define MenuPMDialog 1336
  16. #define PMDialog 1337
  17. #define PMSendingDialog 1338
  18. #define PMRecievedDialog 1339
  19.  
  20. #if defined FILTERSCRIPT
  21.  
  22. public OnFilterScriptInit()
  23. {
  24.     print("         |/|   ");
  25.     print("         |/|   ");
  26.     print("         |/|   ");
  27.     print("         |/|   ");
  28.     print("         |/|   ");
  29.     print("         |/| /Ż)   ");
  30.     print("         |/|/|/   ");
  31.     print("         |/||/   ");
  32.     print("        (ŻŻŻ)   ");
  33.     print("        (ŻŻŻ)   ");
  34.     print("        (ŻŻŻ)   ");
  35.     print("        (ŻŻŻ)   ");
  36.     print("        (ŻŻŻ)   ");
  37.     print("        /ŻŻ/|   ");
  38.     print("       / ,^./|   ");
  39.     print("      / /   |/|   ");
  40.     print("     / /     |/|   ");
  41.     print("    ( (       )/)   ");
  42.     print("    | |       |/|   ");
  43.     print("    | |       |/|   ");
  44.     print("    | |       |/|   ");
  45.     print("    ( (       )/)   ");
  46.     print("     | |     / /   ");
  47.     print("      | `---' /   ");
  48.     print("       `-----'    ");
  49.     print("PM System by Max_Coldheart");
  50.     return 1;
  51. }
  52.  
  53. public OnFilterScriptExit()
  54. {
  55.     return 1;
  56. }
  57.  
  58. #endif
  59.  
  60. public OnPlayerRequestClass(playerid, classid)
  61. {
  62.     SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  63.     SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  64.     SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  65.     return 1;
  66. }
  67.  
  68. CMD:pm(playerid, params[])
  69. {
  70.     ShowPlayerDialog(playerid, PMDialog, DIALOG_STYLE_INPUT, "PM Dialog", "Type in the players name / ID", "Ok", "Cancel");
  71.     return 1;
  72. }
  73.  
  74. CMD:reply(playerid, params[])
  75. {
  76.     ShowPlayerDialog(playerid, ReplyDialog, DIALOG_STYLE_INPUT, "PM Dialog", "Type in the message", "Ok", "Cancel");
  77.     return 1;
  78. }
  79.  
  80. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  81. {
  82.     new id;
  83.     if(dialogid == PMDialog)
  84.     {
  85.         if(!response) return 1;
  86.         if(sscanf(inputtext, "r", id)) return ShowPlayerDialog(playerid, PMDialog, DIALOG_STYLE_INPUT, "PM Dialog", "Type in the players name / ID", "Ok", "Cancel");
  87.         if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR, "ERROR: Player not online");
  88.         ShowPlayerDialog(playerid, PMSendingDialog, DIALOG_STYLE_INPUT, "PM Dialog", "Type your message here.", "Send", "Cancel");
  89.     }
  90.     else if(dialogid == PMSendingDialog)
  91.     {
  92.         new SenderName[MAX_PLAYER_NAME], string[128], text[256];
  93.         if(sscanf(inputtext, "s[256]", text)) return ShowPlayerDialog(playerid, PMSendingDialog, DIALOG_STYLE_INPUT, "PM Dialog", "Type your message here.", "Send", "Cancel");
  94.         if(strlen(inputtext) < 0) return SendClientMessage(playerid, COLOR_ERROR, "ERROR: You should type a message.");
  95.         GetPlayerName(playerid, SenderName, sizeof(SenderName));
  96.         format(string, sizeof(string), "PM From %s: %s", SenderName, text);
  97.         GameTextForPlayer(playerid, "]PM Sent]", 3000, 5);
  98.         ShowPlayerDialog(id, PMRecievedDialog, DIALOG_STYLE_MSGBOX, "PM", string, "OK", "");
  99.         WhoLastPMed = id;
  100.     }
  101.     else if(dialogid == MenuPMDialog)
  102.     {
  103.         new SenderName[MAX_PLAYER_NAME], string[128], text[256];
  104.         if(sscanf(inputtext, "s[256]", text)) return ShowPlayerDialog(playerid, MenuPMDialog, DIALOG_STYLE_INPUT, "PM Dialog", "Type in the message", "Ok", "Cancel");
  105.         if(strlen(inputtext) < 0) return SendClientMessage(playerid, COLOR_ERROR, "ERROR: You should type a message.");
  106.         GetPlayerName(playerid, SenderName, sizeof(SenderName));
  107.         format(string, sizeof(string), "PM From %s: %s", SenderName, text);
  108.         GameTextForPlayer(playerid, "]PM Sent]", 3000, 5);
  109.         ShowPlayerDialog(MenuPlayerClickedID, PMRecievedDialog, DIALOG_STYLE_MSGBOX, "PM", string, "OK", "");
  110.         WhoLastPMed = id;
  111.     }
  112.     else if(dialogid == ReplyDialog)
  113.     {
  114.         new SenderName[MAX_PLAYER_NAME], string[128], text[256];
  115.         if(sscanf(inputtext, "s[256]", text)) return ShowPlayerDialog(playerid, ReplyDialog, DIALOG_STYLE_INPUT, "PM Dialog", "Type in the message", "Ok", "Cancel");
  116.         if(strlen(inputtext) < 0) return SendClientMessage(playerid, COLOR_ERROR, "ERROR: You should type a message.");
  117.         GetPlayerName(playerid, SenderName, sizeof(SenderName));
  118.         format(string, sizeof(string), "PM From %s: %s", SenderName, text);
  119.         GameTextForPlayer(playerid, "]PM Sent]", 3000, 5);
  120.         ShowPlayerDialog(WhoLastPMed, PMRecievedDialog, DIALOG_STYLE_MSGBOX, "PM", string, "OK", "");
  121.         WhoLastPMed = id;
  122.     }
  123.     return 1;
  124. }
  125.  
  126. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  127. {
  128.     ShowPlayerDialog(playerid, MenuPMDialog, DIALOG_STYLE_INPUT, "PM Dialog", "Type in the message", "Ok", "Cancel");
  129.     MenuPlayerClickedID = clickedplayerid;
  130.     return 1;
  131. }
  132.  
Advertisement
Add Comment
Please, Sign In to add comment