/pm help? :D
#9

Here, just for you :P, should work if I didn't fuck up somewhere...

pawn Код:
public OnPlayerConnect(playerid)
{
    SetPVarInt(playerid, "LastPM", -1);
    return 1;
}

CMD:pm(playerid, params[])
{
    new target, msg[128];
    if(sscanf(params, "us", target, msg)) return SendClientMessage(playerid, 0xFAFAFAA, "USAGE: /pm <playerid/name> <text>");
    else if(target == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFAFAFAA, "ERROR: Player Not Found");

    new str[128];
    format(str, sizeof(str), "PM from %s(%d): %s", pName(playerid), playerid, msg);
    SendClientMessage(target, 0xFAFAFAA, str);
    SendClientMessage(target, 0xFAFAFAA, "Type \"/r <text>\"" to reply.");
    format(str, sizeof(str), "
PM sent to %s.", pName(target));
    SendClientMessage(playerid, 0xFAFAFAA, str);
    return 1;
}

CMD:r(playerid, params[])
{
    new msg[128];
    if(sscanf(params, "
s", msg)) return SendClientMessage(playerid, 0xFAFAFAA, "USAGE: /r <text>");
    else if(GetPVarInt(playerid, "
LastPM") == -1) return SendClientMessage(playerid, 0xFAFAFAA, "ERROR: No one has sent you a PM!");

    new str[128];
    format(str, sizeof(str), "
PM from %s(%d): %s", pName(playerid), playerid, msg);
    SendClientMessage(GetPVarInt(playerid, "
LastPM"), 0xFAFAFAA, str);
    return 1;
}
Reply


Messages In This Thread
/pm help? :D - by Kevin_Joshen - 16.08.2010, 21:12
Re: /pm help? :D - by Kevin_Joshen - 16.08.2010, 21:22
Re: /pm help? :D - by Steven82 - 16.08.2010, 21:42
Re: /pm help? :D - by Kayla.S - 16.08.2010, 21:44
Re: /pm help? :D - by Kevin_Joshen - 16.08.2010, 21:58
Re: /pm help? :D - by Mike_Peterson - 16.08.2010, 22:15
Re: /pm help? :D - by gamer931215 - 17.08.2010, 01:45
Re: /pm help? :D - by Toni - 17.08.2010, 02:02
Re: /pm help? :D - by PotH3Ad - 17.08.2010, 03:23
Re: /pm help? :D - by Kevin_Joshen - 17.08.2010, 04:02

Forum Jump:


Users browsing this thread: 2 Guest(s)