How to make a Ban/PM command..
#7

Try sscanf.

pawn Код:
dcmd_pm(playerid, params[])
{
    new
        target,
        playername[24],
        message[128],
        string[128];

    if(sscanf(params, "us", target, message))
        return SendClientMessage(playerid, COLOR_YELLOW, "Usage: /pm [Playerid/PartOfName] [Message]");

    if(!IsPlayerConnected(target))
        return SendClientMessage(playerid, COLOR_YELLOW, "Error: Invalid Playerid!");

    GetPlayerName(playerid, playername, sizeof(playername));
    format(string, sizeof(string), "(PM) %s (%d): %s", playername, playerid, message);
    SendClientMessage(target, COLOR_YELLOW, string);
    SendClientMessage(playerid, COLOR_YELLOW, "PM Sent.");
    return 1;
}
Reply


Messages In This Thread
How to make a Ban/PM command.. - by CSMajor - 16.08.2010, 05:38
Re: How to make a Ban/PM command.. - by Mike Garber - 16.08.2010, 07:01
Re: How to make a Ban/PM command.. - by gamer931215 - 16.08.2010, 10:08
Re: How to make a Ban/PM command.. - by akis_tze - 16.08.2010, 10:15
Re: How to make a Ban/PM command.. - by rbN. - 16.08.2010, 10:41
Re: How to make a Ban/PM command.. - by xZacharias - 16.08.2010, 18:59
Re: How to make a Ban/PM command.. - by Vince - 16.08.2010, 19:07
Re: How to make a Ban/PM command.. - by xZacharias - 16.08.2010, 21:11
Re: How to make a Ban/PM command.. - by bigcomfycouch - 16.08.2010, 21:25

Forum Jump:


Users browsing this thread: 1 Guest(s)