Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // INC //
- #include <a_samp>
- #include <zcmd>
- main() return true;
- // DEF //
- #define function%1(%2) forward%1(%2); public%1(%2)
- #define MAX_PM 10
- // VAR //
- new bool:AzPmStats[MAX_PLAYERS] = false;
- new Rec[MAX_PLAYERS],PlayerText:Az[3][MAX_PLAYERS],
- cPM[MAX_PLAYERS],ID[MAX_PLAYERS]
- ;
- enum AzPmInfo
- {
- PMID,
- FromName[10],
- Text[200],
- }
- new aPM[MAX_PLAYERS][MAX_PM][AzPmInfo];
- // Call Back //
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" PM AZ By AZULA 2015 pwn scripting ");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- switch(AzPmStats[playerid]) {
- case false: {
- return true;
- }
- case true : {
- Rec[playerid] = clickedplayerid;
- ShowPlayerDialog(playerid, 21, DIALOG_STYLE_INPUT, "{FF2EE1}[Az-Pm] :", "{FC0B2F}Please enter your text:", "Send", "Cancel");
- return true;
- }
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == 21)
- {
- if(!response)
- {
- SendClientMessage(playerid,-1,"{FF2EE1}[Az-Pm] : {FC0B0B}Message failed to send");
- Rec[playerid] = 0;
- }
- else
- {
- if(cPM[ Rec[playerid] ] == MAX_PM) return SendClientMessage(playerid,-1,"{FF2EE1}[Az-Pm] : {FC0B0B}This Player Have a lot of message");
- cPM[Rec[playerid]] ++;
- ShowNotifs(Rec[playerid]);
- for(new i=0; i< MAX_PM; i++)
- {
- if(aPM[ Rec[playerid]][i][PMID] != -1 ) continue;
- aPM[ Rec[playerid]][i][PMID] = cPM[ Rec[playerid] ];
- format(aPM[ Rec[playerid]][i] [FromName], 10, GetName(playerid));
- ID[playerid] = playerid;
- format(aPM[ Rec[playerid]][i][Text] ,200, inputtext);
- break;
- }
- Rec[playerid] = 0;
- }
- return 1;
- }
- if(dialogid == 22)
- {
- if(!response)
- {
- SendClientMessage(playerid,-1,"{FF2EE1}[Az-Pm] : {FC0B0B}Message failed to send");
- }
- else
- {
- if(cPM[ Rec[playerid] ] == MAX_PM) return SendClientMessage(playerid,-1,"{FF2EE1}[Az-Pm] : {FC0B0B}This Player Have a lot of message");
- ID[playerid] = playerid;
- Rec[playerid] = ID[playerid];
- cPM[playerid] --;
- ShowNotifs(playerid);
- ShowPlayerDialog(playerid, 21, DIALOG_STYLE_INPUT, "{FF2EE1}[Az-Pm] :", "{FC0B2F}Please enter your text:", "Send", "Cancel");
- }
- return 1;
- }
- return 0;
- }
- public OnPlayerConnect(playerid)
- {
- for(new i=0; i< MAX_PM; i++)
- {
- aPM[ playerid ][i][PMID] = -1;
- aPM[ Rec[playerid]][i] [FromName] = EOS;
- aPM[ Rec[playerid]][i][Text] = EOS;
- }
- Rec[playerid] = -1;
- cPM[playerid]= 0;
- return 1;
- }
- // CMD //
- COMMAND:azpm(playerid, params[]) // /azpm to switch azPm on or off
- {
- switch(AzPmStats[playerid]){
- case false:{
- SendClientMessage(playerid,-1,"{FF2EE1}[Az-Pm] : {B6B6B6}Az Pm is On Now Click in the tab score menu to PM players");
- SendClientMessage(playerid,-1,"{FF2EE1}[Az-Pm] : {FC0B0B}/azpm {B6B6B6}to switch off the pm system");
- AzPmStats[playerid] = true;
- return true;
- }
- case true :{
- SendClientMessage(playerid,-1,"{FF2EE1}[Az-Pm] : {B6B6B6}Az Pm is {FC0B2F}Off {B6B6B6}Now");
- AzPmStats[playerid] = false;
- return true;
- }
- }
- return true;
- }
- COMMAND:clearpm(playerid, params[]) // /clearpm
- {
- cPM[playerid] = 0;
- ShowNotifs(Rec[playerid]);
- for(new i=0; i< MAX_PM; i++)
- {
- aPM[ Rec[playerid]][i][PMID] = -1 ;
- aPM[playerid][i][Text] = EOS;
- aPM[playerid][i][FromName] = EOS;
- }
- ID[playerid] = -1;
- Rec[playerid] = -1;
- SendClientMessage(playerid,-1,"{FF2EE1}[Az-Pm] : {FC0B0B}You Have delete all pm");
- return true;
- }
- COMMAND:showm(playerid, params[]) // /Showm to show MESSAGES
- {
- new s[1024];
- if(cPM[ Rec[playerid] ] == 0) return SendClientMessage(playerid,-1,"{FF2EE1}[Az-Pm] : {FC0B0B}You Have any PV MSG now");
- s[0] = EOS;
- for(new i = 0 ; i < MAX_PM; i++)
- {
- if (aPM[ Rec[playerid] ] [i] [PMID] == -1) continue;
- format(s,sizeof s, "%s{FCF80B}azPM ID : {FC0B2F}%i {FCF80B}from {FC0B2F}'%s' ID: {FC0B2F}[%i] {FF2EE1}TEXT : %s\n",
- s,aPM[ Rec[playerid] ] [i] [PMID] , aPM[ Rec[playerid] ] [i] [FromName],ID[playerid],aPM[ Rec[playerid] ] [i] [Text]);
- }
- ShowPlayerDialog(playerid, 22, DIALOG_STYLE_LIST, "{FF2EE1}[Az-Pm] PMS :", s, "Reply", "Close");
- return true;
- }
- // stock //
- stock GetName(playerid)
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, MAX_PLAYER_NAME);
- return name;
- }
- function ShowNotifs(playerid)
- {
- for( new text = 0; text != 3 ; text ++) {
- PlayerTextDrawHide(playerid, Az[text][playerid]),PlayerTextDrawDestroy(playerid, Az[text][playerid]);
- }
- new s[256];
- Az[0][playerid] = CreatePlayerTextDraw(playerid, 46.400016, 206.079956, "LD_SPAC:white");
- PlayerTextDrawLetterSize(playerid, Az[0][playerid], 0.000000, 0.000000);
- PlayerTextDrawTextSize(playerid, Az[0][playerid], 101.600006, 30.613342);
- PlayerTextDrawAlignment(playerid, Az[0][playerid], 1);
- PlayerTextDrawColor(playerid, Az[0][playerid], 255);
- PlayerTextDrawSetShadow(playerid, Az[0][playerid], 0);
- PlayerTextDrawSetOutline(playerid, Az[0][playerid], 0);
- PlayerTextDrawFont(playerid, Az[0][playerid], 4);
- Az[1][playerid] = CreatePlayerTextDraw(playerid, 51.999996, 212.800003, "LD_SPAC:white");
- PlayerTextDrawLetterSize(playerid, Az[1][playerid], 0.000000, 0.000000);
- PlayerTextDrawTextSize(playerid, Az[1][playerid], 90.400009, 16.426666);
- PlayerTextDrawAlignment(playerid, Az[1][playerid], 1);
- PlayerTextDrawColor(playerid, Az[1][playerid], -16776961);
- PlayerTextDrawSetShadow(playerid, Az[1][playerid], 0);
- PlayerTextDrawSetOutline(playerid, Az[1][playerid], 0);
- PlayerTextDrawFont(playerid, Az[1][playerid], 4);
- Az[2][playerid] = CreatePlayerTextDraw(playerid, 54.399971, 212.053283, "");
- PlayerTextDrawLetterSize(playerid, Az[2][playerid], 0.263599, 1.682132);
- PlayerTextDrawAlignment(playerid, Az[2][playerid], 1);
- PlayerTextDrawColor(playerid, Az[2][playerid], -1);
- PlayerTextDrawSetShadow(playerid, Az[2][playerid], 0);
- PlayerTextDrawSetOutline(playerid, Az[2][playerid], 1);
- PlayerTextDrawBackgroundColor(playerid, Az[2][playerid], 51);
- PlayerTextDrawFont(playerid, Az[2][playerid], 1);
- PlayerTextDrawSetProportional(playerid, Az[2][playerid], 1);
- PlayerPlaySound(playerid,1150,0.0,0.0,0.0);
- format(s, sizeof(s), "(%i) NEW MESSAGE", cPM[playerid]);
- SendClientMessage(playerid,-1,"{FF2EE1}[Az-Pm] : {FC0B0B}use /Showm {B6B6B6}to show your MSG");
- PlayerTextDrawSetString(playerid, Az[2][playerid], s);
- for( new text = 0; text != 3 ; text ++) {
- PlayerTextDrawShow(playerid, Az[text][playerid]);
- }
- SetTimerEx("UnShowMsg", 3000, false, "i", playerid);
- }
- function UnShowMsg(playerid) {
- for( new text = 0; text != 3 ; text ++) {
- PlayerTextDrawHide(playerid, Az[text][playerid]),PlayerTextDrawDestroy(playerid, Az[text][playerid]);
- }
- PlayerPlaySound(playerid,1139,0.0,0.0,0.0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement