SA-MP Forums Archive
Private Messages - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Private Messages (/showthread.php?tid=207016)



Private Messages - Chrillzen - 05.01.2011

Hi i was on wiki and found a /pm code, but it didnt work for me, can some of you guys show me one?


Re: Private Messages - Haydz - 05.01.2011

Hey, found this tut, havn't tryed it tho but it looks good.
https://sampforum.blast.hk/showthread.php?tid=164500


Re: Private Messages - [BFT]eagles22 - 05.01.2011

This is the pm code i use in my server.

pawn Код:
public OnPlayerCommandText(playerid cmdtext[])
{
    dcmd(pm, 2, cmdtext);
    return 0;
}

dcmd_pm(playerid,params[])
{
        new
                pmtext[128],
                pID;
        if(sscanf(params,"ds",pID,pmtext)) {
                        return  SendClientMessage(playerid,COLOR_RED,"USAGE: /pm [playerid] [text]");

        }
        if(!IsPlayerConnected(pID)) {
                return SendClientMessage(playerid,COLOR_RED,"Nobody is connected with this ID");
                }
        new
                name[MAX_PLAYER_NAME],pmname[MAX_PLAYER_NAME],
                string[128],string2[128];
        GetPlayerName(playerid,name,sizeof(name));
        GetPlayerName(pID,pmname,sizeof(pmname));
        if(GetPlayerName(pID, pmname, sizeof(pmname)) == GetPlayerName(playerid, name, sizeof(name))){
            return SendClientMessage(playerid, COLOR_RED, "You cannot send a PM to yourself!");
        }
        format(string,sizeof(string),"PM sent to %s(%d) : %s ", pmname, pID, pmtext);
        format(string2,sizeof(string2),"PM from %s(%d) : %s", name, playerid, pmtext);
        SendClientMessage(playerid,COLOR_PMY,string);
        SendClientMessage(pID,COLOR_PMY,string2);
        return 1;
 }



Re: Private Messages - Chrillzen - 05.01.2011

Quote:
Originally Posted by Hayden_Bruin
Посмотреть сообщение
Hey, found this tut, havn't tryed it tho but it looks good.
https://sampforum.blast.hk/showthread.php?tid=164500
Thanks it worked.