A /pm Command please
#3

this is directly taken from my own script:

pawn Код:
//OnPlayerCommand
dcmd(pm,2,cmdtext);

//somewhere in ur script outside a callback
dcmd_pm(playerid,params[])
{
    new str[254],id,pnamer[24],pnames[24];
    if(sscanf(params, "ds[192]", id, params)) SendClientMessage(playerid, 0xFF0000FF, "{FFFF00}Usage: {855E42}/pm {FFFF00}[ID] [Message]");
    if(id == INVALID_PLAYER_ID)return SendClientMessage(playerid, 0xFF0000FF, "{FFFF00}Invalid Player{855E42}ID!");
    if(playerid == id)return SendClientMessage(playerid, 0xFF0000FF, "{FFFF00}You cannot {855E42}PM {FFFF00}yourself!");

    GetPlayerName(id, pnamer, 24);
    format(str, sizeof(str), "{855E42}PM {FFFF00}to {3F9E4D}%s(%d): {FFFF00}%s", pnamer, id, params);
    SendClientMessage(playerid, 0xFF0000FF, str);
    GetPlayerName(playerid, pnames, 24);
    format(str, sizeof(str), "{855E42}PM {FFFF00}from {3F9E4D}%s(%d): {FFFF00}%s", pnames, playerid, params);
    SendClientMessage(id, 0xFF0000FF, str);
    PlayerPlaySound(id,1147,0, 0, 0);

    foreach(Player,i)//u need foreach or change it to the custom loop
    {
    if(Spieler[i][AdminLevel] > 2)//adjust this to ur variable
    {
    format(str, sizeof(str), "{FF00FF}PM Spoofed: {FFFF00}From {3F9E4D}%s to %s: {FFFF00}%s", pnames, pnamer , params);
    SendClientMessage(i, 0xFF0000FF, str);
    }
    }

    return 1;
}
@dokins: Come on dude ...
Reply


Messages In This Thread
A /pm Command please - by seanny - 03.09.2011, 19:48
Re: A /pm Command please - by Dokins - 03.09.2011, 19:50
Re: A /pm Command please - by BlackWolf120 - 03.09.2011, 19:52
Re: A /pm Command please - by seanny - 03.09.2011, 19:52
AW: A /pm Command please - by Joshua_Turnerz - 03.09.2011, 19:53
Re: A /pm Command please - by BlackWolf120 - 03.09.2011, 19:55

Forum Jump:


Users browsing this thread: 1 Guest(s)