SA-MP Forums Archive
Clears whole chat - 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: Clears whole chat (/showthread.php?tid=300890)



Clears whole chat - remyguys - 02.12.2011

When i use this command, the whole chat gets cleared..

Why?

Thx in Advance

Dont mention the not in order lines, its not like that in the GM

PHP код:
    if(strcmp(cmd"/askadmin"true) == || strcmp(cmd"/ahelp"true) == 0)
    {
          if(!
strlen(cmdtext[8])) return SendClientMessage(playerid0xFF0000AA"Use /ahelp [message]");
          new 
str[128];
          if((
gettime()-LastReport[playerid]) < 30)
        {
            
format(str128"You have to wait %d seconds before you can send a new help message!", (30-(gettime()-LastReport[playerid])));
            
SendClientMessage(playerid0xFF0000AAstr); return 1;
          }
         
format(str128"[ASKADMIN] Sender ID: %d. Message: %s"playeridcmdtext[8]);
        for(new 
ii<MAX_PLAYERSi++){
          
AdministratorMessage(COLOR_ADMINCMDstring,1);
        
SendClientMessage(i0x00FFFFAAstr);
         }
          
SendClientMessage(playerid0x00FF00AA"Help send to online admins!");
          
LastReport[playerid] = gettime();
          return 
1;




Re: Clears whole chat - Mikkel_Pedersen - 02.12.2011

Remove your loop, as you already have a function to send the message to all admins (AdministratorMessage?).

Also in case you care about the grammar in your messages: "Help send to online admins!" --> sent*

Edit: Oh yea, also remove the SendClientMessage that is below the AdministratorMessage.


Re: Clears whole chat - remyguys - 02.12.2011

Oh gosh i feel so ashamed send sent..

Thx


Re: Clears whole chat - FabianoC - 02.12.2011

So maybe someone should quote and paste what is right...


Re: Clears whole chat - remyguys - 02.12.2011

Quote:
Originally Posted by Mikkel_Pedersen
Посмотреть сообщение
Remove your loop, as you already have a function to send the message to all admins (AdministratorMessage?).

Also in case you care about the grammar in your messages: "Help send to online admins!" --> sent*

Edit: Oh yea, also remove the SendClientMessage that is below the AdministratorMessage.
I don't understand what you mean with remove your loop?


Re: Clears whole chat - Falco-Ger - 02.12.2011

loop:
for(new i; i<MAX_PLAYERS; i++){ [...] }


Re: Clears whole chat - remyguys - 02.12.2011

Quote:
Originally Posted by Mikkel_Pedersen
Посмотреть сообщение
Remove your loop, as you already have a function to send the message to all admins (AdministratorMessage?).

Also in case you care about the grammar in your messages: "Help send to online admins!" --> sent*

Edit: Oh yea, also remove the SendClientMessage that is below the AdministratorMessage.
If i just delete it, it gives me more errors?
PHP код:
 if(strcmp(cmd"/askadmin"true) == || strcmp(cmd"/ahelp"true) == 0)
    {
          if(!
strlen(cmdtext[8])) return SendClientMessage(playerid0xFF0000AA"Use /ahelp [message]");
          new 
str[128];
          if((
gettime()-LastReport[playerid]) < 30)
        {
            
format(str128"You have to wait %d seconds before you can send a new help message!", (30-(gettime()-LastReport[playerid])));
            
SendClientMessage(playerid0xFF0000AAstr); return 1;
          }
         
format(str128"[ASKADMIN] Sender ID: %d. Message: %s"playeridcmdtext[8]);
          
AdministratorMessage(COLOR_ADMINCMDstring,1);
         }
          
SendClientMessage(playerid0x00FF00AA"Help send to online admins!");
          
LastReport[playerid] = gettime();
          return 
1;




Re: Clears whole chat - Kingunit - 02.12.2011

After the loop you can just add return 1; That will work in this case I guess.