Advertisement
Guest User

/pm

a guest
Mar 2nd, 2013
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. if(strcmp(cmd, "/pm", true) == 0)
  2. {
  3.  
  4. // Here the player will choose to who he will send a private message.
  5. if(strlen(pID) == 0) return SendClientMessage(playerid, 0xD1D1D1FF, "USAGE: /pm [PlayerID] [Message]");
  6.  
  7. // If the player chose a non-occupied ID he will receive the message below.
  8. if(!IsPlayerConnected(strval(pID))) return SendClientMessage(playerid, 0xD62424FF, "ERROR: Wrong player name or player ID. ");
  9. GetPlayerName(playerid, name, sizeof(name));
  10. kreplace(name, '_', ' ');
  11. GetPlayerName(strval(pID), pname, sizeof(pname));
  12. kreplace(pname, '_', ' ');
  13.  
  14. // Here it will take the message the player sent and the players names. ( The one who sent and the one who received the message )
  15. format(strin, sizeof(strin), "(( PM from %s(%i):%s ))", name, playerid, cmdtext[4+strlen(pID)]);
  16. format(str, sizeof(str), "(( PM sent to %s(%i):%s ))", pname, strval(pID), cmdtext[4+strlen(pID)]);
  17.  
  18. // Here it will send the formats above.
  19. SendClientMessage(strval(pID), COLOR_BRIGHT_PURPLE, strin);
  20. SendClientMessage(playerid, COLOR_BRIGHT_PURPLE, str);
  21.  
  22. // The end.
  23. return 1;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement