a little problem
#1

PHP код:
{
    new 
string[128];
       
GetPlayerName(playeridsendernamesizeof(sendername));
    
format(stringsizeof(string), "%s (%d) typed: %s"sendername,playerid,cmdtext);
    for(new 
0MAX_PLAYERSi++)
     
SendClientMessageToAdmins(GREYstring ,i);

the above text send this message to all the admins online ! like if some player types /hello it says that someone typed /hello !

SendClientMessageToAdmins is defined and it works good for all the other things!

but the problem is that it tell every thing 5 times !

like it tells

someone typed /hello !

someone typed /hello !

someone typed /hello !

someone typed /hello !

someone typed /hello !

it says 5 times instead of 1 time ! Can any one help with this ... ! waiting for a good reply !
Reply
#2

pawn Код:
{
    new string[128];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "%s (%d) typed: %s", sendername,playerid,cmdtext);
    SendClientMessageToAdmins(GREY, string);
}
I don't think you need a loop since it would appear that your function "SendClientMessageToAdmins" would do it for you.
Reply
#3

SendClientMessageToAdmins(GREY, string); changed to SendClientMessageToAdmins(GREY, string ,1);

it works but it says unknown command along with it !
how to remove that unknown command ?
Reply
#4

Quote:
Originally Posted by James124
Посмотреть сообщение
SendClientMessageToAdmins(GREY, string); changed to SendClientMessageToAdmins(GREY, string ,1);

it works but it says unknown command along with it !
how to remove that unknown command ?
It's probably supposed to be

pawn Код:
SendClientMessageToAdmins(GREY, string ,playerid);
And if it still returns Unknown Command, also add in a return 1;

pawn Код:
{
    new string[128];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "%s (%d) typed: %s", sendername,playerid,cmdtext);
    SendClientMessageToAdmins(GREY, string,playerid);
    return 1;
}
Reply
#5

nvm about that XD It works thank u lol !
Reply
#6

i just found a thing ! it shows even the ppls pass like when they do /login and /register

is there a way to prevent it ?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)