SA-MP Forums Archive
Give another player a Message - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Give another player a Message (/showthread.php?tid=314167)



Give another player a Message - BleverCastard - 28.01.2012

Hello,
I'm trying to make a "/rights" Command where if you /rights [PlayerID] it reads them their rights. I have no idea on how to do this, can someone help me out?


Re: Give another player a Message - =WoR=Varth - 28.01.2012

https://sampwiki.blast.hk/wiki/SendClientMessage
Inside the command


Re: Give another player a Message - Mosslah - 28.01.2012

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.


Re: Give another player a Message - BleverCastard - 28.01.2012

thanks.