Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(strcmp(cmd, "/pm", true) == 0)
- {
- // Here the player will choose to who he will send a private message.
- if(strlen(pID) == 0) return SendClientMessage(playerid, 0xD1D1D1FF, "USAGE: /pm [PlayerID] [Message]");
- // If the player chose a non-occupied ID he will receive the message below.
- if(!IsPlayerConnected(strval(pID))) return SendClientMessage(playerid, 0xD62424FF, "ERROR: Wrong player name or player ID. ");
- GetPlayerName(playerid, name, sizeof(name));
- kreplace(name, '_', ' ');
- GetPlayerName(strval(pID), pname, sizeof(pname));
- kreplace(pname, '_', ' ');
- // Here it will take the message the player sent and the players names. ( The one who sent and the one who received the message )
- format(strin, sizeof(strin), "(( PM from %s(%i):%s ))", name, playerid, cmdtext[4+strlen(pID)]);
- format(str, sizeof(str), "(( PM sent to %s(%i):%s ))", pname, strval(pID), cmdtext[4+strlen(pID)]);
- // Here it will send the formats above.
- SendClientMessage(strval(pID), COLOR_BRIGHT_PURPLE, strin);
- SendClientMessage(playerid, COLOR_BRIGHT_PURPLE, str);
- // The end.
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement