Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define FILTERSCRIPT
- #include <a_samp>
- #include <zcmd>
- #include <sscanf2>
- #include <YSI\y_ini>
- #define COLOR_RED 0xFF0000FF
- #define COLOR_YELLOW 0xFFFF00AA
- #define COLOR_ORANGE 0xFF9900AA
- enum PMInfo
- {
- LastPM,
- NoPM,
- };
- new pInfo[MAX_PLAYERS][PMInfo];
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n**************************************");
- print("* PM System Made By OngTung *");
- print("* Don't Remove My Credits! *");
- print("* [ LOADED ] *");
- print("**************************************\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #endif
- CMD:pm(playerid, params[])
- {
- new pName[MAX_PLAYER_NAME], string[250], String[250],target, tName[MAX_PLAYER_NAME];
- if(sscanf(params, "us[50]",target,params)) return SendClientMessage(playerid, -1, "{FF0000}Su dung : {FF0000}/pm [ID][MESSAGE]");
- if(target == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "ERROR : {FF0000}Sai ID nguoi choi");
- if(target == playerid) return SendClientMessage(playerid, 0, "ERROR : {FF0000}Ban khong the PM cho rieng minh!");
- if(pInfo[target][NoPM]) return SendClientMessage(playerid, -1, "ERROR : {FF0000}Nguoi choi da tat che do PM!");
- GetPlayerName(playerid, pName, sizeof(pName));
- GetPlayerName(target, tName, sizeof(tName));
- format(string ,sizeof(string), "{C0C0C0}|- PM tu %s : %s -|", pName, params);
- SendClientMessage(target,0, string);
- format(String, sizeof(String), "{C0C0C0}|- PM gui den %s -|", tName);
- SendClientMessage(playerid, 0, String);
- return 1;
- }
- CMD:nopm(playerid, params[])
- {
- if(pInfo[playerid][NoPM] == 0)
- {
- pInfo[playerid][NoPM] = 1;
- SendClientMessage(playerid, -1, "{FF0000}INFO : {FFFFFF}Ban da bat che do PM cua ban!");
- }
- else
- {
- pInfo[playerid][NoPM] = 0;
- SendClientMessage(playerid, -1, "{FF0000}INFO : {FFFFFF}Ban da tat che do PM cua ban!");
- }
- return 1;
- }
- CMD:reply(playerid, params[])
- {
- new pName[MAX_PLAYER_NAME], string[128],target, tName[MAX_PLAYER_NAME];
- if(sscanf(params, "s", params)) return SendClientMessage(playerid, COLOR_RED, "Su dung: /reply [MESSAGE]");
- new pID = pInfo[playerid][LastPM];
- if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, COLOR_RED, "ERROR : Nguoi choi khong co online.");
- if(pID == playerid) return SendClientMessage(playerid, COLOR_RED, "ERROR : Ban khong the PM cho rieng minh.");
- if(pInfo[pID][NoPM] == 1) return SendClientMessage(playerid, COLOR_RED, "ERROR : Nguoi choi da tat che do PM, ban khong the PM hay cho nguoi choi dap lai!");
- GetPlayerName(playerid, pName, sizeof(pName));
- GetPlayerName(target, tName, sizeof(tName));
- format(string, sizeof(string), "{C0C0C0}|- PM gui den %s -|", tName, params);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- format(string, sizeof(string), "{C0C0C0}|- PM tu %s : %s -|", pName, params);
- SendClientMessage(pID, COLOR_YELLOW, string);
- pInfo[pID][LastPM] = playerid;
- return 1;
- }
- CMD:r(playerid, params[])
- {
- new pName[MAX_PLAYER_NAME], string[128],target, tName[MAX_PLAYER_NAME];
- if(sscanf(params, "s", params)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /reply [MESSAGE]");
- new pID = pInfo[playerid][LastPM];
- if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, COLOR_RED, "ERROR : Nguoi choi khong co online.");
- if(pID == playerid) return SendClientMessage(playerid, COLOR_RED, "ERROR : Ban khong the PM cho rieng minh.");
- if(pInfo[pID][NoPM] == 1) return SendClientMessage(playerid, COLOR_RED, "ERROR : Nguoi choi da tat che do PM, ban khong the PM hay cho nguoi choi dap lai!");
- GetPlayerName(playerid, pName, sizeof(pName));
- GetPlayerName(target, tName, sizeof(tName));
- format(string, sizeof(string), "{C0C0C0}|- PM Sent To %s -|", tName, params);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- format(string, sizeof(string), "{C0C0C0}|- PM From %s : %s -|", pName, params);
- SendClientMessage(pID, COLOR_YELLOW, string);
- pInfo[pID][LastPM] = playerid;
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement