SHARE
TWEET

AZ PM v 2.0

a guest Apr 24th, 2015 241 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // INC //
  2. #include <a_samp>
  3. #include <zcmd>
  4. main() return true;
  5.  
  6. // DEF //
  7.  
  8. #define function%1(%2)     forward%1(%2); public%1(%2)
  9. #define MAX_PM 10
  10.  
  11. // VAR //
  12. new bool:AzPmStats[MAX_PLAYERS] = false;
  13.  
  14. new Rec[MAX_PLAYERS],PlayerText:Az[3][MAX_PLAYERS],
  15.         cPM[MAX_PLAYERS],ID[MAX_PLAYERS]
  16. ;
  17.  
  18.  
  19. enum AzPmInfo
  20. {
  21.         PMID,
  22.         FromName[10],
  23.         Text[200],
  24. }
  25. new aPM[MAX_PLAYERS][MAX_PM][AzPmInfo];
  26.  
  27.  
  28.  
  29. // Call Back //
  30. public OnFilterScriptInit()
  31. {
  32.         print("\n--------------------------------------");
  33.         print(" PM AZ By AZULA 2015 pwn scripting ");
  34.         print("--------------------------------------\n");
  35.         return 1;
  36. }
  37.  
  38. public OnFilterScriptExit()
  39. {
  40.         return 1;
  41. }
  42.  
  43.  
  44.  
  45.  
  46. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  47. {
  48.     switch(AzPmStats[playerid]) {
  49.             case false: {
  50.                 return true;
  51.                 }
  52.                 case true : {
  53.                     Rec[playerid] = clickedplayerid;
  54.                     ShowPlayerDialog(playerid, 21, DIALOG_STYLE_INPUT, "{FF2EE1}[Az-Pm] :", "{FC0B2F}Please enter your text:", "Send", "Cancel");
  55.                         return true;
  56.                 }
  57.         }
  58.     return 1;
  59. }
  60. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  61. {
  62.     if(dialogid == 21)
  63.     {
  64.         if(!response)
  65.         {
  66.             SendClientMessage(playerid,-1,"{FF2EE1}[Az-Pm] : {FC0B0B}Message failed to send");
  67.             Rec[playerid] = 0;
  68.         }
  69.         else
  70.         {
  71.             if(cPM[ Rec[playerid] ] == MAX_PM) return SendClientMessage(playerid,-1,"{FF2EE1}[Az-Pm] : {FC0B0B}This Player Have a lot of message");
  72.                 cPM[Rec[playerid]] ++;
  73.             ShowNotifs(Rec[playerid]);
  74.                 for(new i=0; i< MAX_PM; i++)
  75.                 {
  76.                     if(aPM[ Rec[playerid]][i][PMID] != -1 ) continue;
  77.                                 aPM[ Rec[playerid]][i][PMID]  = cPM[ Rec[playerid] ];
  78.                                 format(aPM[ Rec[playerid]][i] [FromName], 10, GetName(playerid));
  79.        
  80.                                 ID[playerid] = playerid;
  81.                                 format(aPM[ Rec[playerid]][i][Text] ,200, inputtext);
  82.                                 break;
  83.                         }
  84.  
  85.             Rec[playerid] = 0;
  86.         }
  87.         return 1;
  88.     }
  89.    
  90.     if(dialogid == 22)
  91.     {
  92.         if(!response)
  93.         {
  94.             SendClientMessage(playerid,-1,"{FF2EE1}[Az-Pm] : {FC0B0B}Message failed to send");
  95.         }
  96.         else
  97.         {
  98.             if(cPM[ Rec[playerid] ] == MAX_PM) return SendClientMessage(playerid,-1,"{FF2EE1}[Az-Pm] : {FC0B0B}This Player Have a lot of message");
  99.             ID[playerid] = playerid;
  100.                         Rec[playerid] = ID[playerid];
  101.                         cPM[playerid] --;
  102.             ShowNotifs(playerid);
  103.                     ShowPlayerDialog(playerid, 21, DIALOG_STYLE_INPUT, "{FF2EE1}[Az-Pm] :", "{FC0B2F}Please enter your text:", "Send", "Cancel");
  104.         }
  105.         return 1;
  106.     }
  107.     return 0;
  108. }
  109.  
  110. public OnPlayerConnect(playerid)
  111. {
  112.     for(new i=0; i< MAX_PM; i++)
  113.     {
  114.                 aPM[ playerid ][i][PMID]  = -1;
  115.  
  116.                 aPM[ Rec[playerid]][i] [FromName] = EOS;
  117.                 aPM[ Rec[playerid]][i][Text] = EOS;
  118.         }
  119.         Rec[playerid] = -1;
  120.         cPM[playerid]= 0;
  121.     return 1;
  122. }
  123.  
  124. // CMD //
  125. COMMAND:azpm(playerid, params[]) // /azpm to switch azPm on or off
  126. {
  127.         switch(AzPmStats[playerid]){
  128.                 case false:{
  129.                 SendClientMessage(playerid,-1,"{FF2EE1}[Az-Pm] : {B6B6B6}Az Pm is On Now Click in the tab score menu to PM players");
  130.                 SendClientMessage(playerid,-1,"{FF2EE1}[Az-Pm] : {FC0B0B}/azpm {B6B6B6}to switch off the pm system");
  131.                 AzPmStats[playerid] = true;
  132.                 return true;
  133.                 }
  134.                 case true :{
  135.                     SendClientMessage(playerid,-1,"{FF2EE1}[Az-Pm] : {B6B6B6}Az Pm is {FC0B2F}Off {B6B6B6}Now");
  136.                 AzPmStats[playerid] = false;
  137.                 return true;
  138.                 }
  139.         }
  140.         return true;
  141. }
  142.  
  143. COMMAND:clearpm(playerid, params[]) // /clearpm
  144. {
  145.     cPM[playerid] = 0;
  146.     ShowNotifs(Rec[playerid]);
  147.     for(new i=0; i< MAX_PM; i++)
  148.     {
  149.                 aPM[ Rec[playerid]][i][PMID]  = -1 ;
  150.                 aPM[playerid][i][Text] = EOS;
  151.                 aPM[playerid][i][FromName] = EOS;
  152.         }
  153.         ID[playerid] = -1;
  154.         Rec[playerid] = -1;
  155.         SendClientMessage(playerid,-1,"{FF2EE1}[Az-Pm] : {FC0B0B}You Have delete all pm");
  156.         return true;
  157. }
  158.  
  159.  
  160.  
  161.  
  162.  
  163. COMMAND:showm(playerid, params[]) // /Showm to show MESSAGES
  164. {
  165.         new s[1024];
  166.     if(cPM[ Rec[playerid] ] == 0) return SendClientMessage(playerid,-1,"{FF2EE1}[Az-Pm] : {FC0B0B}You Have any PV MSG now");
  167.         s[0] = EOS;
  168.         for(new i = 0 ; i < MAX_PM; i++)
  169.         {
  170.                 if (aPM[ Rec[playerid] ] [i] [PMID] == -1) continue;
  171.             format(s,sizeof s, "%s{FCF80B}azPM ID : {FC0B2F}%i {FCF80B}from {FC0B2F}'%s' ID: {FC0B2F}[%i] {FF2EE1}TEXT : %s\n",
  172.             s,aPM[ Rec[playerid] ] [i] [PMID] , aPM[ Rec[playerid] ]  [i] [FromName],ID[playerid],aPM[ Rec[playerid] ]  [i] [Text]);
  173.         }
  174.         ShowPlayerDialog(playerid, 22, DIALOG_STYLE_LIST, "{FF2EE1}[Az-Pm] PMS :", s, "Reply", "Close");
  175.        
  176.         return true;
  177. }
  178.  
  179. // stock //
  180. stock GetName(playerid)
  181. {
  182.       new name[MAX_PLAYER_NAME];
  183.       GetPlayerName(playerid, name, MAX_PLAYER_NAME);
  184.       return name;
  185. }
  186.  
  187. function ShowNotifs(playerid)
  188. {
  189.     for( new text = 0; text != 3 ; text ++) {
  190.              PlayerTextDrawHide(playerid, Az[text][playerid]),PlayerTextDrawDestroy(playerid, Az[text][playerid]);
  191.         }
  192.         new s[256];
  193.     Az[0][playerid] = CreatePlayerTextDraw(playerid, 46.400016, 206.079956, "LD_SPAC:white");
  194.         PlayerTextDrawLetterSize(playerid, Az[0][playerid], 0.000000, 0.000000);
  195.         PlayerTextDrawTextSize(playerid, Az[0][playerid], 101.600006, 30.613342);
  196.         PlayerTextDrawAlignment(playerid, Az[0][playerid], 1);
  197.         PlayerTextDrawColor(playerid, Az[0][playerid], 255);
  198.         PlayerTextDrawSetShadow(playerid, Az[0][playerid], 0);
  199.         PlayerTextDrawSetOutline(playerid, Az[0][playerid], 0);
  200.         PlayerTextDrawFont(playerid, Az[0][playerid], 4);
  201.  
  202.         Az[1][playerid] = CreatePlayerTextDraw(playerid, 51.999996, 212.800003, "LD_SPAC:white");
  203.         PlayerTextDrawLetterSize(playerid, Az[1][playerid], 0.000000, 0.000000);
  204.         PlayerTextDrawTextSize(playerid, Az[1][playerid], 90.400009, 16.426666);
  205.         PlayerTextDrawAlignment(playerid, Az[1][playerid], 1);
  206.         PlayerTextDrawColor(playerid, Az[1][playerid], -16776961);
  207.         PlayerTextDrawSetShadow(playerid, Az[1][playerid], 0);
  208.         PlayerTextDrawSetOutline(playerid, Az[1][playerid], 0);
  209.         PlayerTextDrawFont(playerid, Az[1][playerid], 4);
  210.  
  211.         Az[2][playerid] = CreatePlayerTextDraw(playerid, 54.399971, 212.053283, "");
  212.         PlayerTextDrawLetterSize(playerid, Az[2][playerid], 0.263599, 1.682132);
  213.         PlayerTextDrawAlignment(playerid, Az[2][playerid], 1);
  214.         PlayerTextDrawColor(playerid, Az[2][playerid], -1);
  215.         PlayerTextDrawSetShadow(playerid, Az[2][playerid], 0);
  216.         PlayerTextDrawSetOutline(playerid, Az[2][playerid], 1);
  217.         PlayerTextDrawBackgroundColor(playerid, Az[2][playerid], 51);
  218.         PlayerTextDrawFont(playerid, Az[2][playerid], 1);
  219.         PlayerTextDrawSetProportional(playerid, Az[2][playerid], 1);
  220.     PlayerPlaySound(playerid,1150,0.0,0.0,0.0);
  221.    
  222.  
  223.         format(s, sizeof(s), "(%i) NEW MESSAGE", cPM[playerid]);
  224.     SendClientMessage(playerid,-1,"{FF2EE1}[Az-Pm] : {FC0B0B}use /Showm {B6B6B6}to show your MSG");
  225.     PlayerTextDrawSetString(playerid, Az[2][playerid], s);
  226.         for( new text = 0; text != 3 ; text ++) {
  227.              PlayerTextDrawShow(playerid, Az[text][playerid]);
  228.         }
  229.        
  230.         SetTimerEx("UnShowMsg", 3000, false, "i", playerid);
  231.        
  232. }
  233.  
  234.  
  235. function UnShowMsg(playerid) {
  236.     for( new text = 0; text != 3 ; text ++) {
  237.              PlayerTextDrawHide(playerid, Az[text][playerid]),PlayerTextDrawDestroy(playerid, Az[text][playerid]);
  238.         }
  239.         PlayerPlaySound(playerid,1139,0.0,0.0,0.0);
  240. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top