Samp Pm Help!
#10

i think this should work

pawn Код:
dcmd_pm(playerid, params[])
{
    new id, msg[148],str[148],str1[148];
    if(sscanf(params, "us[81]", id, msg)) return SendClientMessage(playerid, 0xFFFFFFFF, "/pm [player] [message]");
    if(msg[80]) return SendClientMessage(playerid, 0xFFFFFFFF, "Error! Invalid PM Length. Your PM Must Be Between 1-80 Characters.");
    if(!strlen(msg)) return SendClientMessage(playerid, 0xFFFFFFFF, "Error! Invalid PM Length. Your PM Must Be Between 1-80 Characters.");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "Invalid Player!");
    //if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "You Can Not PM Yourself!");
//uncomment the line above if you want to disable PMing yourself
    else
    {
        new sentname[MAX_PLAYER_NAME], recievedname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, sentname, sizeof(sentname));
        GetPlayerName(id, recievedname, sizeof(recievedname));
       
        format(str,sizeof(str),"PM Sent To %s(%d): %s", recievedname, id, msg);
        format(str1,sizeof(str1),"PM From %s(%d): %s", sentname, playerid, msg);
        SendClientMessage(playerid,0xFFFFFFFF,str);
        SendClientMessage(id, 0xFFFFFFFF,str1);
    }
    return 1;
}
Reply


Messages In This Thread
Samp Pm Help! - by MrCripBloodz - 27.06.2012, 03:25
Re: Samp Pm Help! - by Ironboy - 27.06.2012, 04:03
Re: Samp Pm Help! - by MrCripBloodz - 27.06.2012, 04:09
Re: Samp Pm Help! - by MrCripBloodz - 07.07.2012, 23:22
Re: Samp Pm Help! - by SnG.Scot_MisCuDI - 08.07.2012, 00:31
Re: Samp Pm Help! - by MrCripBloodz - 08.07.2012, 00:57
Re: Samp Pm Help! - by Kirollos - 08.07.2012, 00:59
Re: Samp Pm Help! - by MrCripBloodz - 08.07.2012, 01:03
Re: Samp Pm Help! - by Uberanwar - 08.07.2012, 01:09
Re: Samp Pm Help! - by Kirollos - 08.07.2012, 01:11

Forum Jump:


Users browsing this thread: 4 Guest(s)