Private Messages
#1

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

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

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;
 }
Reply
#4

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)