Guest User

Command /pm with fix bugs

a guest
Nov 16th, 2014
385
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. //DEFINES
  2. #include <a_samp>
  3. #include <y_cmd>
  4. #include <sscanf2>
  5.  
  6. //=======================================================================================================//
  7. //============================ - [ PM to player only he can see this message ] - ========================//
  8. //=======================================================================================================//
  9. YCMD:pm(playerid, params[],help)
  10. {
  11. #pragma unused help
  12. {
  13. new id, message[128];
  14. if(sscanf(params, "us[128]", id, message)) return SendClientMessage(playerid,-1,"{FF0000}HELP | "BELA"/pm [ID/Name] [text]");
  15. new string[156];
  16. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, " {FFFFFF}[{F81414}ERROR!{FFFFFF}] {C3C3C3}Wrong ID!");
  17. format(string,sizeof string, "{FF0000}You sent a message to the player %s [ID:%d]: {FFFFFF}%s", GetName(id) , id, message);
  18. SendClientMessage(playerid, -1,string);
  19. format(string,sizeof string ,"{00C0FF}[ID:%d] Player %s sent you a pm: %s",playerid,GetName(playerid),message);
  20. SendClientMessage(id, -1,string);
  21. }
  22. return 1;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment