Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- COMMAND:pm(playerid, params[])
- {
- // Setup local variables
- new OtherPlayer, Message[128], Msg1[128], Msg2[128], YourName[24], OtherPlayerName[24];
- // Send the command to all admins so they can see it
- SendAdminText(playerid, "/pm", params);
- // Check if the player has logged in
- if (APlayerData[playerid][LoggedIn] == true)
- {
- if (sscanf(params, "us[128]", OtherPlayerName, Message)) SendClientMessage(playerid, 0xFF0000AA, "Naudojimas: \"/pm <Žaidėjas> <Žinutė>\"");
- else
- {
- // Check if that other player is online
- if (IsPlayerConnected(OtherPlayer))
- {
- // Check if the player isn't muted
- if (APlayerData[playerid][Muted] == false)
- {
- // Get both names
- GetPlayerName(playerid, YourName, sizeof(YourName));
- GetPlayerName(OtherPlayer, OtherPlayerName, sizeof(OtherPlayerName));
- // Construct the message that is sent to yourself
- format(Msg1, 128, "{808080}PM >> %s{FFFFFF}: %s", OtherPlayerName, Message);
- // Construct the message that is sent to the other player
- format(Msg2, 128, "{A0A0A0}PM << %s{FFFFFF}: %s", YourName, Message);
- // Send the messages
- SendClientMessage(playerid, 0xFFFFFFFF, Msg1);
- SendClientMessage(OtherPlayer, 0xFFFFFFFF, Msg2);
- }
- else
- SendClientMessage(playerid, 0xFFFFFFFF, "{CC0000}••{ffffff} Jūs vis dar užtildytas!");
- }
- else
- SendClientMessage(playerid, 0xFF0000FF, "Šis žaidėjas nėra prisijungęs!");
- }
- }
- else
- return 0;
- // Let the server know that this was a valid command
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment