Advertisement
Guest User

Simple PM Fixed

a guest
Aug 12th, 2011
1,217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. /*
  2. Short FilterScript by Tanush
  3. Server IP: 213.5.176.159:7789
  4. Special thanks to Zeex (ZCMD)
  5. Another thanks to Y_Less (sscanf)
  6. */
  7. #include <a_samp>
  8. #include <zcmd>
  9. #include <sscanf>
  10.  
  11. new togglepm[MAX_PLAYERS],ID,message[128],str[128],Nam[MAX_PLAYER_NAME],Pname[MAX_PLAYER_NAME];
  12.  
  13. public OnPlayerConnect(playerid)
  14. {
  15. togglepm[playerid] = 1;
  16. return 1;
  17. }
  18. CMD:pm(playerid, params[])
  19. {
  20. if(sscanf(params,"us",ID,message)) return SendClientMessage(playerid,0xFF9900AA,"USAGE: /pm [ID] [message]");
  21. if(!IsPlayerConnected(ID)) return SendClientMessage(playerid,0xFF0000FF,"That user is not connected.");
  22. if(togglepm[ID] == 0) return SendClientMessage(playerid,0xff0000ff,"ERROR: That user has is pm to toggle off");
  23. GetPlayerName(ID,Pname,sizeof(Pname));
  24. GetPlayerName(playerid,Nam,sizeof(Nam));
  25. format(str,sizeof(str),"You had send a message to %s",Pname);
  26. SendClientMessage(playerid,0xFF9900AA,str);
  27. format(str,sizeof(str),"%s Send you a PM: %s",Nam,message);
  28. SendClientMessage(ID,0xFF9900AA,str);
  29. return 1;
  30. }
  31. CMD:togglepm(playerid,params[])
  32. {
  33. if(togglepm[playerid] == 1)
  34. {
  35. SendClientMessage(playerid,0xff9900aa,"You had toggled your pm to off now, you won't get pm's.");
  36. togglepm[playerid] = 0;
  37. }
  38. else if(togglepm[playerid] == 0)
  39. {
  40. SendClientMessage(playerid,0xff9900aa,"You had toggled your pm to on now, you will get pm's from others.");
  41. togglepm[playerid] = 1;
  42. }
  43. return 1;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement