SA-MP Forums Archive
a little problem - 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: a little problem (/showthread.php?tid=173946)



a little problem - James124 - 04.09.2010

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 !


Re: a little problem - JaTochNietDan - 04.09.2010

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.


Re: a little problem - James124 - 04.09.2010

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 ?


Re: a little problem - JaTochNietDan - 04.09.2010

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;
}



Re: a little problem - James124 - 04.09.2010

nvm about that XD It works thank u lol !


Re: a little problem - James124 - 04.09.2010

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 ?