daemon3304

Pms Script By Daemon Hope U Like It

May 25th, 2013
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.45 KB | None | 0 0
  1.  
  2.  
  3. //Credits to daemon
  4. #define FILTERSCRIPT
  5.  
  6. #include <a_samp>
  7. #define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
  8.  
  9. public OnFilterScriptInit()
  10. {
  11. print("\n--------------------------------------");
  12. print(" Blank Filterscript by your name here");
  13. print("--------------------------------------\n");
  14. return 1;
  15. }
  16.  
  17. public OnFilterScriptExit()
  18. {
  19. return 1;
  20. }
  21.  
  22. public OnGameModeInit()
  23. {
  24. return 1;
  25. }
  26.  
  27. public OnGameModeExit()
  28. {
  29. return 1;
  30. }
  31.  
  32. public OnPlayerConnect(playerid)
  33. {
  34. SetPVarInt(playerid,"LastID",-1);
  35. return 1;
  36. }
  37.  
  38. public OnPlayerDisconnect(playerid, reason)
  39. {
  40. SetPVarInt(playerid,"LastID",-1);
  41. return 1;
  42. }
  43.  
  44. public OnPlayerCommandText(playerid, cmdtext[])
  45. {
  46. dcmd(pm,2,cmdtext);
  47. dcmd(r,1,cmdtext);
  48. dcmd(nopm,4,cmdtext);
  49. return 0;
  50. }
  51. dcmd_nopm(playerid,params[])
  52. {
  53. #pragma unused params
  54. if(GetPVarInt(playerid,"NoPM") == 1)
  55. {
  56. SetPVarInt(playerid,"NoPM",0);
  57. SendClientMessage(playerid,0xFFFF00FF,"Pm's on!");
  58. }
  59. else
  60. {
  61. SetPVarInt(playerid,"NoPM",1);
  62. SendClientMessage(playerid,0xFFFF00FF,"Pm's off!");
  63. }
  64. return 1;
  65. }
  66. dcmd_pm(playerid,params[])
  67. {
  68. new id,string[256],pName[MAX_PLAYER_NAME],pName2[MAX_PLAYER_NAME];
  69. id = strval(params);
  70. if(strlen(params) == 0) return SendClientMessage(playerid,0xF2A337FF,"USAGE: /pm [id][text]");
  71. if(GetPVarInt(id,"NoPM") == 1) return SendClientMessage(playerid,0xFF0000FF,"That player isnt recieving pm's");
  72. GetPlayerName(playerid,pName,sizeof(pName));
  73. GetPlayerName(id,pName2,sizeof(pName2));
  74. format(string,sizeof(string),"PM from %s: %s",pName,params);
  75. SendClientMessage(id,0xFFFF00FF,string);
  76. format(string,sizeof(string),"PM sent to %s: %s",pName2,params);
  77. SendClientMessage(playerid,0xF2A337FF,string);
  78. SetPVarInt(id,"LastID",playerid);
  79. return 1;
  80. }
  81.  
  82. dcmd_r(playerid,params[])
  83. {
  84. new string[256],pName[MAX_PLAYER_NAME],pName2[MAX_PLAYER_NAME];
  85. if(strlen(params) == 0) return SendClientMessage(playerid,0xF2A337FF,"USAGE: /r [text]");
  86. if(GetPVarInt(playerid,"LastID") == -1) return SendClientMessage(playerid,0xFF0000FF,"No recent messages!");
  87. if(GetPVarInt(GetPVarInt(playerid,"LastID"),"NoPM") == 1) return SendClientMessage(playerid,0xFF0000FF,"That player isnt recieving pm's");
  88. GetPlayerName(playerid,pName,sizeof(pName));
  89. GetPlayerName(GetPVarInt(playerid,"LastID"),pName2,sizeof(pName2));
  90. format(string,sizeof(string),"PM from %s: %s",pName,params);
  91. SendClientMessage(GetPVarInt(playerid,"LastID"),0xFFFF00FF,string);
  92. format(string,sizeof(string),"PM sent to %s: %s",pName2,params);
  93. SendClientMessage(playerid,0xF2A337FF,string);
  94. SetPVarInt(GetPVarInt(playerid,"LastID"),"LastID",playerid);
  95. return 1;
  96. }
Advertisement
Add Comment
Please, Sign In to add comment