Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Welcome to [vTc] Fs's Thank you for downloading This is a NORMAL and EASY PM System which help's you to send
- private messages.Just Press Tab and select NAME where you want to send.
- _________________________________DONT REMOVE CREDIT'S! [vTc]Team __________________________________
- */
- #include <a_samp.inc>
- #include <zcmd.inc>
- main(){}
- #define PMCOLOR 0x48D1CCFF
- #define ERROR 0xFF0000AA
- #define PMDialog 123
- new Message[128];
- new DialogClicked[MAX_PLAYERS];
- new IgnorePM[MAX_PLAYERS];
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- ShowPlayerDialog(playerid,PMDialog,DIALOG_STYLE_INPUT,"Private Message","Please Type your Message to send!","Send","Cancel");
- DialogClicked[playerid] = clickedplayerid;
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- IgnorePM[playerid] = 1;
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- IgnorePM[playerid] = 0;
- return 1;
- }
- CMD:ignorepms(playerid, params[])
- {
- if(IgnorePM[playerid] == 1)
- {
- SendClientMessage(playerid, PMCOLOR, "From Now you are NO more recieving any PM's - Type /ignorepms again to receive them.");
- IgnorePM[playerid] = 0;
- }
- else
- {
- SendClientMessage(playerid, PMCOLOR, "From Now you are recieving PM's - Type /ignorepms to not receive them.");
- IgnorePM[playerid] = 1;
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == PMDialog)
- {
- if(response)
- {
- if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, ERROR, "Player not found!");
- if(DialogClicked[playerid] == playerid) return SendClientMessage(playerid, ERROR, "* Error: You are'nt allowed to PM yourself!");
- if(IgnorePM[playerid] == 0) return SendClientMessage(playerid, ERROR, "This Player is BLACKLISTED from PM's");
- if(!inputtext[0])
- {
- SendClientMessage(playerid, ERROR, "* Error: The BOX is Empty Please re-type Your Message and send!.");
- ShowPlayerDialog(playerid,PMDialog,DIALOG_STYLE_INPUT,"Private Message","Entered message was emty - Please enter correcet.","Send","Cancel");
- return 1;
- }
- if(!strlen(inputtext))
- {
- format(Message,sizeof(Message),"Wrong Message\nEnter Correct Message");
- ShowPlayerDialog(playerid,PMDialog,DIALOG_STYLE_INPUT,"Incorrect Message - Enter Correct Password To send PM's",Message,"Send","Cancel");
- return 1;
- }
- new PMSender[MAX_PLAYER_NAME];
- new PMReceiver[MAX_PLAYER_NAME];
- GetPlayerName(playerid, PMSender, sizeof(PMSender));
- GetPlayerName(DialogClicked[playerid], PMReceiver, sizeof(PMReceiver));
- if(strlen(inputtext))
- {
- format(Message, 256, "Player %s Sent Private Message To %s - [MESSAGE: %s]", PMSender, PMReceiver, inputtext);
- printf("%s", Message);
- format(Message, sizeof(Message), "[-->] PM To %s (ID: %d): %s", PMReceiver, DialogClicked[playerid], inputtext);
- SendClientMessage(playerid, PMCOLOR, Message);
- format(Message, sizeof(Message), "[<--] PM From %s (ID: %d): %s", PMSender, playerid, inputtext);
- SendClientMessage(DialogClicked[playerid], PMCOLOR, Message);
- return 1;
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment