lulo356

pm system

May 6th, 2014
599
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. // PM system by lulo356 don't remove the credits
  2.  
  3. #include <a_samp>
  4. #include <sscanf2>
  5. #include <zcmd>
  6.  
  7. #define COLOR_YELLOW 0xFFFF00FF
  8. #define COLOR_WHITE 0xFFFFFFFF
  9.  
  10. CMD:pm(playerid, params[])
  11. {
  12. new str2[128], id;
  13. if(sscanf(params, "us[128]", id, str2)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /pm [ID] [MESSAGE]");
  14. if(!IsPlayerConnected(id)) return GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~ERROR: Player Isnt Connected", 3000, 3);
  15. if(playerid == id) return GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~You can't PM your self", 3000, 3);
  16. 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);
  17. new Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME], str[128];
  18. GetPlayerName(playerid, Name1, sizeof(Name1));
  19. GetPlayerName(id, Name2, sizeof(Name2));
  20. format(str, sizeof(str), "((PM To %s: %s))", Name2, str2);
  21. SendClientMessage(playerid, COLOR_YELLOW, str);
  22. format(str, sizeof(str), "((PM From %s: %s))", Name1, str2);
  23. SendClientMessage(id, COLOR_YELLOW, str);
  24. return 1;
  25. }
  26.  
  27. CMD:blockpm(playerid, params[])
  28. {
  29. if(GetPVarInt(playerid, "BlockPM") == 1)
  30. {
  31. SetPVarInt(playerid, "BlockPM", 0);
  32. GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~You've unblocked your PM's", 3000, 3);
  33. }
  34. else
  35. {
  36. SetPVarInt(playerid, "BlockPM", 1);
  37. GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~You've blocked your PM's", 3000, 3);
  38. }
  39. return 1;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment