Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // PM system by lulo356 don't remove the credits
- #include <a_samp>
- #include <sscanf2>
- #include <zcmd>
- #define COLOR_YELLOW 0xFFFF00FF
- #define COLOR_WHITE 0xFFFFFFFF
- CMD:pm(playerid, params[])
- {
- new str2[128], id;
- if(sscanf(params, "us[128]", id, str2)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /pm [ID] [MESSAGE]");
- if(!IsPlayerConnected(id)) return GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~ERROR: Player Isnt Connected", 3000, 3);
- if(playerid == id) return GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~You can't PM your self", 3000, 3);
- if(GetPVarInt(id, "BlockPM") == 1) return GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~Player has blocked their PM's", 3000, 3);
- new Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME], str[128];
- GetPlayerName(playerid, Name1, sizeof(Name1));
- GetPlayerName(id, Name2, sizeof(Name2));
- format(str, sizeof(str), "((PM To %s: %s))", Name2, str2);
- SendClientMessage(playerid, COLOR_YELLOW, str);
- format(str, sizeof(str), "((PM From %s: %s))", Name1, str2);
- SendClientMessage(id, COLOR_YELLOW, str);
- return 1;
- }
- CMD:blockpm(playerid, params[])
- {
- if(GetPVarInt(playerid, "BlockPM") == 1)
- {
- SetPVarInt(playerid, "BlockPM", 0);
- GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~You've unblocked your PM's", 3000, 3);
- }
- else
- {
- SetPVarInt(playerid, "BlockPM", 1);
- GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~You've blocked your PM's", 3000, 3);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment