Guest User

Untitled

a guest
May 6th, 2018
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. COMMAND:pm(playerid, params[])
  2. {
  3. // Setup local variables
  4. new OtherPlayer, Message[128], Msg1[128], Msg2[128], YourName[24], OtherPlayerName[24];
  5.  
  6. // Send the command to all admins so they can see it
  7. SendAdminText(playerid, "/pm", params);
  8.  
  9. // Check if the player has logged in
  10. if (APlayerData[playerid][LoggedIn] == true)
  11. {
  12. if (sscanf(params, "us[128]", OtherPlayerName, Message)) SendClientMessage(playerid, 0xFF0000AA, "Naudojimas: \"/pm <Žaidėjas> <Žinutė>\"");
  13. else
  14. {
  15. // Check if that other player is online
  16. if (IsPlayerConnected(OtherPlayer))
  17. {
  18. // Check if the player isn't muted
  19. if (APlayerData[playerid][Muted] == false)
  20. {
  21. // Get both names
  22. GetPlayerName(playerid, YourName, sizeof(YourName));
  23. GetPlayerName(OtherPlayer, OtherPlayerName, sizeof(OtherPlayerName));
  24. // Construct the message that is sent to yourself
  25. format(Msg1, 128, "{808080}PM >> %s{FFFFFF}: %s", OtherPlayerName, Message);
  26. // Construct the message that is sent to the other player
  27. format(Msg2, 128, "{A0A0A0}PM << %s{FFFFFF}: %s", YourName, Message);
  28. // Send the messages
  29. SendClientMessage(playerid, 0xFFFFFFFF, Msg1);
  30. SendClientMessage(OtherPlayer, 0xFFFFFFFF, Msg2);
  31. }
  32. else
  33. SendClientMessage(playerid, 0xFFFFFFFF, "{CC0000}••{ffffff} Jūs vis dar užtildytas!");
  34. }
  35. else
  36. SendClientMessage(playerid, 0xFF0000FF, "Šis žaidėjas nėra prisijungęs!");
  37. }
  38. }
  39. else
  40. return 0;
  41.  
  42. // Let the server know that this was a valid command
  43. return 1;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment