/pm /r +REP
#6

pawn Код:
new PMCheck[MAX_PLAYERS];

COMMAND:pm(playerid, params[])
{
    new string[128], pname[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], id, message[92];
    if(sscanf(params, "us[92]", id, message)) return SendClientMessage(playerid, -1, "USAGE: /pm [playerid] [text]");
    if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "Invalid Player ID or not connected!");
    GetPlayerName(playerid, pname, sizeof(pname));
    GetPlayerName(id, name, sizeof(name));
    if(PMCheck[id]) return SendClientMessage(playerid, -1, "Use (/r) according to PM, you have last PM MSG to this player!");
    PMCheck[id]++;
    PlayerPlaySound(id, 1085, 0.0, 0.0, 0.0);
    format(string, sizeof(string), "PM Sent to %s(%d): %s", name, id, message);
    SendClientMessage(playerid, COLOR_YELLOW, string);
    format(string, sizeof(string), "PM From %s(%d): %s", pname, playerid, message);
    SendClientMessage(id, COLOR_YELLOW, string);
    return 1;
}

COMMAND:r(playerid, params[])
{
    new string[128], pname[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], id, message[92];
    if(sscanf(params, "us[92]", id, message)) return SendClientMessage(playerid, -1, "USAGE: /r [playerid] [text]");
    if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "Invalid Player ID or not connected!");
    GetPlayerName(playerid, pname, sizeof(pname));
    GetPlayerName(id, name, sizeof(name));
    if(!PMCheck[id]) return SendClientMessage(playerid, -1, "You do not have last PM MSG to this player according to PM!");
    PlayerPlaySound(id, 1085, 0.0, 0.0, 0.0);
    format(string, sizeof(string), "You reply %s(%d)'s last PM: %s", name, id, message);
    SendClientMessage(playerid, COLOR_YELLOW, string);
    format(string, sizeof(string), "PM From %s(%d): %s", pname, playerid, message);
    SendClientMessage(id, COLOR_YELLOW, string);
    return 1;
}
Reply


Messages In This Thread
/pm /r +REP - by TheMightyEddy - 09.04.2012, 04:00
Re: /pm /r +REP - by Reklez - 09.04.2012, 04:06
Re: /pm /r +REP - by TheMightyEddy - 09.04.2012, 04:18
Re: /pm /r +REP - by Reklez - 09.04.2012, 04:20
Re: /pm /r +REP - by TheMightyEddy - 09.04.2012, 04:21
Re: /pm /r +REP - by Reklez - 09.04.2012, 04:30
Re: /pm /r +REP - by Shetch - 09.04.2012, 04:33
Re: /pm /r +REP - by TheMightyEddy - 09.04.2012, 04:40
Re: /pm /r +REP - by Reklez - 09.04.2012, 04:44
Re: /pm /r +REP - by TheMightyEddy - 09.04.2012, 04:46

Forum Jump:


Users browsing this thread: 1 Guest(s)