[+REP]PM Message only appears if less then 40 characters
#2

Try this

pawn Код:
CMD:pm(playerid,params[])
{
     new text[128],targetid,string[128],sendername[MAX_PLAYER_NAME],giveplayer[MAX_PLAYER_NAME];
    if(sscanf(params, "us[128]", targetid, text)) SendClientMessage(playerid, COLOR_GREY, "Usage: /pm [playerid] [text]");//if player uses command wrong
    else
    {
        if (playerid == targetid) return SendClientMessage(playerid, COLOR_GREY, "SERVER: You cannot pm to yourself.");//if player try to pm self
        if(IsPlayerConnected(targetid))//check if player online
        {
            format(sendername, sizeof(sendername), "%s", PlayerName(playerid));
            format(giveplayer, sizeof(giveplayer), "%s", PlayerName(targetid));
            NameSpace(sendername);
            NameSpace(giveplayer);
            format(string, sizeof(string), ">> PM from %s[%d]: %s <<", sendername, playerid, text);//change format if you want
            SendClientMessage(targetid,  0xF9F900FF, string);
            format(string, sizeof(string), ">> PM sent to %s: %s <<", giveplayer, text);//change format if you want
            SendClientMessage(playerid,  0xE5C43EAA, string);
            PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
        }
    }
    return 1;
}


stock NameSpace(str[])
{
    new strl;
    strl=strlen(str);
    while(strl--) {
    if(str[strl]=='_')  str[strl]=' ';
    }
    return 0;
}
Reply


Messages In This Thread
[+REP]PM Message only appears if less then 40 characters - by Aasim - 20.01.2015, 00:54
Re: [+REP]PM Message only appears if less then 40 characters - by 1fret - 20.01.2015, 01:04
Re: [+REP]PM Message only appears if less then 40 characters - by Abagail - 20.01.2015, 01:43

Forum Jump:


Users browsing this thread: 1 Guest(s)