SA-MP Forums Archive
Question/Problem 2x+rep - 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: Question/Problem 2x+rep (/showthread.php?tid=333651)



Question/Problem 2x+rep - doreto - 12.04.2012

PROBLEM FIXED



Re: Question/Problem 2x+rep - emokidx - 12.04.2012

1st,
use this one
pawn Код:
stock SendMessageToAdmins1(color, msg[])
{
  for(new i=0; i<GetMaxPlayers(); i++)
  {
    if(IsPlayerConnected(i))
    {
        if(player_admin(i) || player_moderator(i)) // it should be "||" aka Or
        {
            SendClientMessage(i, color, msg);
        }
    }
  }
  return 1;
}
SendMessageToAdmins(-1, "%s has type "RED"/money",PlayerName(playerid));
so, the arguments are color and msg so you have to use "format" and just to make it clear to you
pawn Код:
SendMessageToAdmins(-1, "Someone has type "RED"/money");
it will be like this and works like "SendClientMessageToAll"


2nd.
pawn Код:
if(player_admin(playerid) || player_moderator(playerid) || player_junior(playerid))
use "||" as the one that you have is using "&&" aka And so you will have to be player_admin,moderator and junior at the same time.
meaning
you will have to be "player_admin" *and* "player_mod" *and* "player_junior" not
"player_admin" *or* "player_mod" *or* "player_junior" < this makes you use the command if you are any "1" of the three


Re: Question/Problem 2x+rep - doreto - 12.04.2012

Quote:
Originally Posted by emokidx111
Посмотреть сообщение
pawn Код:
SendMessageToAdmins(-1, "Someone has type "RED"/money");
hmm my point is too see who type command but if posible to be something like #define /money,/admin ect.. becose i dont wonna to spamm on chat(admin chat)


Re: Question/Problem 2x+rep - emokidx - 12.04.2012

Quote:
Originally Posted by doreto
Посмотреть сообщение
hmm my point is too see who type command
use format

pawn Код:
new string[128];
format(string, sizeof(string), "%s has type "RED"/money",PlayerName(playerid));
SendClientMessageToAdmins(-1, string);
Quote:
Originally Posted by doreto
Посмотреть сообщение
but if posible to be something like #define /money,/admin ect.. becose i dont wonna to spamm on chat(admin chat)
i don't get it, please explain.


Re: Question/Problem 2x+rep - doreto - 12.04.2012

Quote:
Originally Posted by emokidx111
Посмотреть сообщение
use format

pawn Код:
new string[128];
format(string, sizeof(string), "%s has type "RED"/money",PlayerName(playerid));
SendClientMessageToAdmins(-1, string);

i don't get it, please explain.
You know most admin fs show all commands that player type,but i wont only that command that i wont for example i dont wont to say SendMessageToAdmins1 player type /kill or ect i wonna commands that i wonna to know did player type that command for example /admin-to know he check for online admins


Re: Question/Problem 2x+rep - emokidx - 12.04.2012

so just put it under the command that you want to see simple.

eg: (using zcmd for this eg, and this is not to be used)
pawn Код:
CMD:kill(payerid, params[])
{
SetPlayerHealth(playerid, 0);
//not sending anything
}

CMD:admin(blah)
{
new string[128];
format(string, sizeof(string), "%s has used "RED"/admin",PlayerName(playerid));
SendClientMessageToAdmins(-1, string);
//send the message to admins

for loop here
if conencted
if admin
SendClientMessage
}



Re: Question/Problem 2x+rep - Sphex - 12.04.2012

Do you mean you want to send all the commands to the admins?
Then Add this right after "public OnPlayerCommandText":
PHP код:
new sstr[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playeridpnamesizeof(pname));
format(sstrsizeof(sstr), "%s has used the command {FF0000}%s"pnamecmdtext);
SendMessageToAdmin(-1sstr);