Help Please With PM Command
#4

First off, why would you need a 256 cells strings for a PM message? 128 is the max input and you wouldn't even need it, since the message will be shortened by "PM From Name(300): ". You don't need two strings to show two messages, you can format one of them twice.

This should work:
pawn Код:
dcmd_pm(playerid, params[])
{
    new
        id,
        string[128],
        message[94],
        name[2][21];
       
    if(sscanf(params, "rs[93]", id, message)) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /pm [playerid] [message]");
    else if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFFFFFFFF, "That player is not even connected to the server.");
    else if(id == playerid) return SendClientMessage(playerid, 0xFF0000FF, "You can't send a private message to yourself.");
    GetPlayerName(playerid, name[0], 21);
    GetPlayerName(id, name[1], 21);
    format(string, sizeof(string), "PM To %s(%i): %s", name[1], id, message);
    SendClientMessage(playerid, 0x00FFFFFF, string);
    format(string, sizeof(string), "PM From %s(%i): %s", name[0], playerid, message);
    SendClientMessage(id, 0x00FFFFFF, string);
    return 1;
}
Reply


Messages In This Thread
Help Please With PM Command - by Tim_Ethen - 12.11.2010, 02:20
Re: Help Please With PM Command - by (SF)Noobanatior - 12.11.2010, 03:08
Re: Help Please With PM Command - by Larsey123IsMe - 12.11.2010, 03:18
Re: Help Please With PM Command - by Miguel - 12.11.2010, 06:02

Forum Jump:


Users browsing this thread: 1 Guest(s)