Range of this cmd
#5

pawn Код:
CMD:w(playerid, params[]) return cmd_whisper(playerid, params);
CMD:whisper(playerid, params[])
{
    new string[128], message[128], targetid;
    if(sscanf(params, "us[128]", targetid, message)) return SendClientMessageEx(playerid, COLOR_GREY, "Usage: /w(hisper) [playerid] [message]");
    else if(!IsPlayerConnectedEx(targetid)) return SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
    else if(!IsPlayerInRangeOfPlayer(playerid, targetid) && PlayerInfo[playerid][pAdminLevel] < 2) return SendClientMessageEx(playerid, COLOR_GREY, "You must be near the specified player to use this command!");
    else if(playerid == targetid) return SendClientMessageEx(playerid, COLOR_GREY, "You cannot use this command on yourself!");
    format(string, sizeof(string), "(ID %d) %s whispers to you: %s", playerid, GetPlayerNameEx(playerid), message);
    SendClientMessageEx(targetid, COLOR_YELLOW, string);
    format(string, sizeof(string), "You whispered to (ID %d) %s: %s", targetid, GetPlayerNameEx(targetid), message);
    SendClientMessageEx(playerid, COLOR_YELLOW, string);
    return 1;
Rep if I helped.
Reply


Messages In This Thread
Range of this cmd - by Bondage - 30.10.2014, 19:09
Re: Range of this cmd - by nemesis- - 30.10.2014, 19:17
Re: Range of this cmd - by Glossy42O - 30.10.2014, 19:19
Re: Range of this cmd - by Bondage - 30.10.2014, 21:47
Re: Range of this cmd - by mkmk - 30.10.2014, 22:38
Re: Range of this cmd - by BornHuman - 30.10.2014, 23:27
Re: Range of this cmd - by Abagail - 30.10.2014, 23:43
Re: Range of this cmd - by Bondage - 31.10.2014, 07:04
Re: Range of this cmd - by DanishHaq - 31.10.2014, 07:13

Forum Jump:


Users browsing this thread: 3 Guest(s)