03.04.2013, 06:18
Can anyone help. Messages are been sent but getting cut short.
pawn Код:
CMD:pm(playerid, params[])
{
new recipient,msg[255],playerName[MAX_PLAYER_NAME+1],stringProc[255];
//check it looks right and contains correct format data
if(sscanf(params,"us",recipient,msg)) return SendClientMessage(playerid,COLOR_INDIGO, "Syntax error.Correct usage: /pm [playerid] [message]");
//check player is online
if(!IsPlayerConnected(recipient)) return SendClientMessage(playerid,COLOR_INDIGO, "That player is not online");
//get the player name
GetPlayerName(playerid,playerName,sizeof(playerName));
//format the string for output
format(stringProc,sizeof(stringProc), "pm from %s(%i) %s:",playerName,playerid,msg);
//All checks out so send the formatted string
SendClientMessage(recipient,COLOR_YELLOW,stringProc);
return 1;
}