Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- Start Of Script: Pm and Whisper system - DeeadPool©
- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
- #include <a_samp>
- #include <zcmd>
- #include <sscanf>
- //Colors
- #define COLOR_RED 0xFF0000FF
- #define COLOR_YELLOW 0xFFFF00FF
- #define COLOR_GREEN 0x00FF00FF
- #define COLOR_BLUE 0x0000FFFF
- #define COLOR_GREY 0xCCCCCCFF
- //enum
- enum PlayerInfo
- {
- Readpm,
- Lastpm,
- PM,
- PmOff,
- Block
- }
- new PlayerData[MAX_PLAYERS][PlayerInfo];
- //Stock
- stock PlayerName(playerid)
- {
- new pName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, pName, sizeof(pName));
- return pName;
- }
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Pm and whisper filterscript by DeeadPool");
- print(" Loaded ");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("\n--------------------------------------");
- print(" Pm and whisper filterscript by DeeadPool");
- print(" Unloaded ");
- print("--------------------------------------\n");
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- PlayerData[playerid][Lastpm] = -1;
- PlayerData[playerid][PmOff] = 0;
- PlayerData[playerid][Readpm] = -1;
- PlayerData[playerid][Block] = -1;
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- PlayerData[playerid][Lastpm] = -1;
- PlayerData[playerid][PmOff] = 0;
- PlayerData[playerid][Readpm] = -1;
- PlayerData[playerid][Block] = -1;
- return 1;
- }
- /*=====================================================================================================
- PM System
- =====================================================================================================*/
- CMD:pm(playerid, parmas[])
- {
- new ID,
- Message[256],
- String[256],
- String2[256];
- if(sscanf(parmas, "us[256]", ID, Message)) return SendClientMessage(playerid, COLOR_RED, "Usage: /pm [id] [message]");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, -1, "Player not connected!");
- if(ID == playerid) return SendClientMessage(playerid, COLOR_RED, "You can not PM yourself!");
- if(PlayerData[ID][Block] == playerid) return SendClientMessage(playerid, COLOR_RED, "The player has chosen not recieve Pms from you!");
- format(String, sizeof(String), "%s [%d] is no more accepting private messages!");
- if(PlayerData[ID][PmOff] == 1) return SendClientMessage(playerid, COLOR_YELLOW, String);
- if(PlayerData[playerid][PmOff] == 1) return SendClientMessage(playerid, COLOR_RED,"You can not send private message when you have switched off your pms!");
- format(String2, sizeof(String2), "PM to %s : %s", PlayerName(ID), Message);
- SendClientMessage(playerid, COLOR_YELLOW, String2);
- format(String2, sizeof(String2), "PM From %s : %s", PlayerName(playerid), Message);
- SendClientMessage(ID, COLOR_YELLOW, String2);
- PlayerData[ID][Lastpm] = playerid;
- return 1;
- }
- CMD:reply(playerid, parmas[])
- {
- new Message[256],
- String[256],
- String2[256];
- new ID = PlayerData[playerid][Lastpm];
- if(sscanf(parmas, "s[256]", Message)) return SendClientMessage(playerid, COLOR_RED, "Usage: /r(eply) [Message]");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, -1, "Player not connected!");
- if(ID == playerid) return SendClientMessage(playerid, COLOR_RED, "You can not PM yourself!");
- if(PlayerData[ID][Block] == playerid) return SendClientMessage(playerid, COLOR_RED, "The player has chosen not recieve Pms from you!");
- if(PlayerData[playerid][Lastpm] == -1) return SendClientMessage(playerid, -1, "You have recieved no PM's till now!");
- format(String, sizeof(String), "%s [%d] is no more accepting private messages!");
- if(PlayerData[ID][PmOff] == 1) return SendClientMessage(playerid, COLOR_YELLOW, String);
- format(String2, sizeof(String2), "PM to %s : %s", PlayerName(ID), Message);
- SendClientMessage(playerid, COLOR_YELLOW, String2);
- format(String2, sizeof(String2), "PM From %s : %s", PlayerName(playerid), Message);
- SendClientMessage(ID, COLOR_YELLOW, String2);
- PlayerData[ID][Lastpm] = playerid;
- return 1;
- }
- CMD:r(playerid, parmas[]) return cmd_reply(playerid, parmas);
- CMD:pmon(playerid, parmas[])
- {
- if(PlayerData[playerid][PmOff] == 0) return SendClientMessage(playerid, COLOR_YELLOW, "You have already enabled your Pms!");
- if(PlayerData[playerid][PmOff] == 1)
- {
- SendClientMessage(playerid, COLOR_YELLOW, "You have enabled your Pms!");
- PlayerData[playerid][PmOff] = 0;
- }
- return 1;
- }
- CMD:pmoff(playerid, parmas[])
- {
- if(PlayerData[playerid][PmOff] == 1) return SendClientMessage(playerid, COLOR_YELLOW, "You have already disabled your Pms!");
- if(PlayerData[playerid][PmOff] == 0)
- {
- SendClientMessage(playerid, COLOR_YELLOW, "You have disabled your Pms!");
- PlayerData[playerid][PmOff] = 1;
- }
- return 1;
- }
- CMD:block(playerid, parmas[])
- {
- new ID,
- String[128];
- if(sscanf(parmas, "u", ID)) return SendClientMessage(playerid, COLOR_RED, "Usage: /block [id]");
- if(ID == playerid) return SendClientMessage(playerid, COLOR_RED, "you can not block yourself");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, -1, "Player not connected!");
- format(String, sizeof(String), "You have blocked %s from sending you PMs", PlayerName(ID));
- SendClientMessage(playerid, COLOR_YELLOW, String);
- PlayerData[playerid][Block] = ID;
- return 1;
- }
- CMD:unblock(playerid, parmas[])
- {
- new ID,
- String[128];
- if(sscanf(parmas, "u", ID)) return SendClientMessage(playerid, COLOR_RED, "Usage: /unblock [id]");
- if(ID == playerid) return SendClientMessage(playerid, COLOR_RED, "you can not unblock yourself");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, -1, "Player not connected!");
- format(String, sizeof(String), "You are now accepting Pms from %s", PlayerName(ID));
- SendClientMessage(playerid, COLOR_YELLOW, String);
- PlayerData[playerid][Block] = -1;
- return 1;
- }
- /*=====================================================================================================
- End of PM System
- =====================================================================================================*/
- /*=====================================================================================================
- Whisper System
- =====================================================================================================*/
- CMD:w(playerid,params[])
- {
- new String[128];
- new String2[128];
- new Float:x,
- Float:y,
- Float:z;
- if(sscanf(params, "s[128]", String)) return SendClientMessage(playerid, -1, "Usage: /w(hisper) [message]");
- SetPlayerChatBubble(playerid, String, COLOR_YELLOW, 35, 10000);
- GetPlayerPos(playerid, x, y, z);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerInRangeOfPoint(i, 15.0, x, y, z))
- {
- format(String2, sizeof(String2), "%s[%i]: %s", PlayerName(playerid), playerid, String);
- SendClientMessage(i, COLOR_YELLOW, String2);
- }
- }
- return 1;
- }
- CMD:whisper(playerid, parmas[]) return cmd_w(playerid, parmas);
- /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- End Of Script: Pm and Whisper system - DeeadPool©
- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
Add Comment
Please, Sign In to add comment