/pm for DCMD
#4

Quote:
Originally Posted by Jeffry
Посмотреть сообщение
pawn Код:
dcmd_pm(playerid,params[])
{
    new tmp[256], idx, string[256],player1, pid[256];
    pid = strtok(params, idx); tmp = strtok(params, idx);
    if(!strlen(pid) || !strlen(tmp)) return SendClientMessage(playerid,red,"Usage: /pm [ID] [message]");
    player1=strval(pid);
    if(IsPlayerConnected(player1))
    {
        format(string,sizeof(string), "PM from %s (ID:%d): %s", pName(playerid),playerid, params[strlen(pid)+1]);
        SendClientMessage(player1,0xFFDC18FF,string);
        new Float:X, Float:Y, Float:Z;
        GetPlayerPos(player1, X,Y,Z);
        PlayerPlaySound(player1, 1058, X, Y, Z);
        format(string,sizeof(string), "PM sent to %s (ID:%d): %s", pName(player1),player1, params[strlen(pid)+1]);
        SendClientMessage(playerid,0xFFDC18FF,string);
        format(string, sizeof(string), "***PM: %s To %s: %s", pName(playerid), pName(player1), params[strlen(pid)+1]);
        print(string);
        if(IsPlayerNPC(player1))
        {
            format(string,sizeof(string), "PM from %s (ID:%d): Hello %s, I'm a bot and I won't answer you.", pName(player1),player1, pName(playerid));
            SendClientMessage(playerid,0xFFDC18FF,string);
            print(string);
            GetPlayerPos(playerid, X,Y,Z);
            PlayerPlaySound(playerid, 1058, X, Y, Z);
        }
    }
    else return SendClientMessage(playerid,red,"ERROR: This player is not connected.");
    return 1;
}
Have fun!

Greetings,
Jeffry
doesn't works :SSS
Reply


Messages In This Thread
/pm for DCMD - by DannySnoopy - 11.08.2011, 17:18
Re: /pm for DCMD - by Kingunit - 11.08.2011, 17:45
Re: /pm for DCMD - by Jeffry - 11.08.2011, 17:45
Re: /pm for DCMD - by DannySnoopy - 11.08.2011, 18:00
Re: /pm for DCMD - by Jeffry - 11.08.2011, 18:14
Re: /pm for DCMD - by DannySnoopy - 11.08.2011, 18:24
Re: /pm for DCMD - by Scenario - 11.08.2011, 18:28
Re: /pm for DCMD - by PrawkC - 11.08.2011, 18:39
Re: /pm for DCMD - by Kingunit - 11.08.2011, 18:55
Re: /pm for DCMD - by DannySnoopy - 11.08.2011, 18:59

Forum Jump:


Users browsing this thread: 3 Guest(s)