Clears whole chat
#1

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) == 0 || strcmp(cmd, "/ahelp", true) == 0)
    {
          if(!
strlen(cmdtext[8])) return SendClientMessage(playerid, 0xFF0000AA, "Use /ahelp [message]");
          new 
str[128];
          if((
gettime()-LastReport[playerid]) < 30)
        {
            
format(str, 128, "You have to wait %d seconds before you can send a new help message!", (30-(gettime()-LastReport[playerid])));
            
SendClientMessage(playerid, 0xFF0000AA, str); return 1;
          }
         
format(str, 128, "[ASKADMIN] Sender ID: %d. Message: %s", playerid, cmdtext[8]);
        for(new 
i; i<MAX_PLAYERS; i++){
          
AdministratorMessage(COLOR_ADMINCMD, string,1);
        
SendClientMessage(i, 0x00FFFFAA, str);
         }
          
SendClientMessage(playerid, 0x00FF00AA, "Help send to online admins!");
          
LastReport[playerid] = gettime();
          return 
1;
} 
Reply
#2

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.
Reply
#3

Oh gosh i feel so ashamed send sent..

Thx
Reply
#4

So maybe someone should quote and paste what is right...
Reply
#5

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?
Reply
#6

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

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) == 0 || strcmp(cmd, "/ahelp", true) == 0)
    {
          if(!
strlen(cmdtext[8])) return SendClientMessage(playerid, 0xFF0000AA, "Use /ahelp [message]");
          new 
str[128];
          if((
gettime()-LastReport[playerid]) < 30)
        {
            
format(str, 128, "You have to wait %d seconds before you can send a new help message!", (30-(gettime()-LastReport[playerid])));
            
SendClientMessage(playerid, 0xFF0000AA, str); return 1;
          }
         
format(str, 128, "[ASKADMIN] Sender ID: %d. Message: %s", playerid, cmdtext[8]);
          
AdministratorMessage(COLOR_ADMINCMD, string,1);
         }
          
SendClientMessage(playerid, 0x00FF00AA, "Help send to online admins!");
          
LastReport[playerid] = gettime();
          return 
1;
} 
Reply
#8

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


Forum Jump:


Users browsing this thread: 1 Guest(s)