Give another player a Message
#3

Use sscanf, it's pretty simple really.

pawn Код:
COMMAND:rights(playerid, params[])
{
    new TargetID;
    if(sscanf(params, "u", TargetID)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /rights [playerid]");
   
    if(TargetID == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Invalid player ID!");
   
    SendClientMessage(TargetID, COLOR_WHITE, "rights"); // Rights :P
    return 1;
}
A really basic example of how you could do it, but obviously you'd have to change it so that only certain people could do it, etc. If you wanted it to come out in local chat (usually default chat in RP servers), then it'd be pretty easy to implement it into that. But if you just want to send it to the target, then use that.
Reply


Messages In This Thread
Give another player a Message - by BleverCastard - 28.01.2012, 21:12
Re: Give another player a Message - by =WoR=Varth - 28.01.2012, 21:19
Re: Give another player a Message - by Mosslah - 28.01.2012, 21:29
Re: Give another player a Message - by BleverCastard - 28.01.2012, 21:46

Forum Jump:


Users browsing this thread: 1 Guest(s)