SOLVED! - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: SOLVED! (
/showthread.php?tid=69828)
SOLVED! -
notec100 - 21.03.2009
Summary of the Issue:
So I would like to make an /am command for admins chat so only admins would recieve messages on that chat area. I know how to set everything up, but got frustrated and took it out due to the fact that every time they would type /am they would get in chat (AM(Playername): Admins) it would only due one word unless you added _ and then it would show it all but with the _ for spaces. How can I make this so that they do not have to type _ in between the words to space them, where they just type normal?
Ex: This is what Happens:
1) Really typed /am attention all admins ------->> Recieved: AM(playerName):attention
2) Really typed /am attention_all_admins ------->> Received: AM(playerName):attention_all_admins
Ex: This is what needs to Happen:
1) Really typed /am attention all admins ------->> Receive: Am(playerName): attention all admins
Thanks in advance!
Re: A Question -
[RP]Rav - 21.03.2009
you could try something like this
pawn Код:
if (strcmp(cmdtext, "/am", true) == 0)
{
new string[128];
// strmid(destinaton, source, index start, max length)
strmid(string, cmdtext, strfind(cmdtext, " "), strlen(cmdtext));
// format your string if you need to
for (new i = 0; i < MAX_PLAYERS; i++)
// if player is admin
SendClientMessage(i, COLOUR, string);
return 1;
}
Re: A Question -
notec100 - 21.03.2009
Quote:
Originally Posted by Rav
you could try something like this
pawn Код:
if (strcmp(cmdtext, "/am", true) == 0) { new string[128]; // strmid(destinaton, source, index start, max length) strmid(string, cmdtext, strfind(cmdtext, " "), strlen(cmdtext));
// format your string if you need to
for (new i = 0; i < MAX_PLAYERS; i++) // if player is admin SendClientMessage(i, COLOUR, string); return 1; }
|
Thanks a lot Rav! You are very helpful!