SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 13/03/2010, 10:39 AM   #1
Andy_McKinley
Gangsta
 
Andy_McKinley's Avatar
 
Join Date: Jun 2009
Posts: 959
Reputation: 0
Default Admin Chat < Admins can't see chat or my text, but I can see their chat

This is the command I'm talking about. I can see my own text, but no other admin can see it. And when other admins are trying to talk in /a, they cannot see their own chat but I can see it. What's wrong with this cmd?

pawn Code:
dcmd_a(playerid, params[])
{
    new aText[128],aName[MAX_PLAYER_NAME],string[128];
    if(sscanf(params,"s",aText)) return SendClientMessage(playerid,COLOR_LIGHTYELLOW,"[USAGE] ''/a [text]''.");
    if(pInfo[playerid][pAdmin] == 0) return SendClientMessage(playerid,COLOR_LIGHTYELLOW,"You are not an Administrator with the required level.");
    GetPlayerName(playerid,aName,sizeof(aName));
    format(string,sizeof(string),"[AdminChat]%s: %s",aName,aText);
    for(new i=0;i<=MAX_PLAYERS;i++)
    {
        if(pInfo[i][pAdmin] > 0) return SendClientMessage(i,COLOR_LIGHTBLUE,string);
    }
    return 1;
}
Andy_McKinley is offline  
Old 13/03/2010, 10:49 AM   #2
bogeymanEST
Huge Clucker
 
Join Date: Sep 2007
Posts: 229
Reputation: 1
Default Re: Admin chat ain't working

pawn Code:
if(!sscanf(params,"s",aText))
should be
pawn Code:
if(sscanf(params,"s",aText))
bogeymanEST is offline  
Old 13/03/2010, 11:07 AM   #3
Andy_McKinley
Gangsta
 
Andy_McKinley's Avatar
 
Join Date: Jun 2009
Posts: 959
Reputation: 0
Default Re: Admin chat ain't working

Quote:
Originally Posted by bogeyman_EST
pawn Code:
if(!sscanf(params,"s",aText))
should be
pawn Code:
if(sscanf(params,"s",aText))
Already tried, isn't working.
Andy_McKinley is offline  
Old 13/03/2010, 11:09 AM   #4
WackoX
Guest
 
Posts: n/a
Default Re: Admin chat ain't working

Try this:

pawn Code:
dcmd_a(playerid,params[])
{
    new aName[MAX_PLAYER_NAME],string[128];
    if(pInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,COLOR_LIGHTYELLOW,"You are not an Administrator with the required level.");
    if(!strlen(params)) return SendClientMessage(playerid,COLOR_LIGHTYELLOW,"[USAGE] ''/a [text]''.");
   
    GetPlayerName(playerid,aName,sizeof(aName));
    format(string,sizeof(string),"[AdminChat]%s: %s",aName,params);
   
    for(new i=0;i<=MAX_PLAYERS<i++;)
    {
      if(pInfo[i][pAdmin] > 0)
        SendClientMessage(i,COLOR_LIGHTBLUE,string);
    }
    return 1;
}
 
Old 13/03/2010, 11:19 AM   #5
Andy_McKinley
Gangsta
 
Andy_McKinley's Avatar
 
Join Date: Jun 2009
Posts: 959
Reputation: 0
Default Re: Admin chat ain't working

Quote:
Originally Posted by WackoX
Try this:

pawn Code:
dcmd_a(playerid,params[])
{
    new aName[MAX_PLAYER_NAME],string[128];
    if(pInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,COLOR_LIGHTYELLOW,"You are not an Administrator with the required level.");
    if(!strlen(params)) return SendClientMessage(playerid,COLOR_LIGHTYELLOW,"[USAGE] ''/a [text]''.");
   
    GetPlayerName(playerid,aName,sizeof(aName));
    format(string,sizeof(string),"[AdminChat]%s: %s",aName,params);
   
    for(new i=0;i<=MAX_PLAYERS<i++;)
    {
      if(pInfo[i][pAdmin] > 0)
        SendClientMessage(i,COLOR_LIGHTBLUE,string);
    }
    return 1;
}
Not working, same as my command. Only showing the usage, nothing else.
Andy_McKinley is offline  
Old 13/03/2010, 12:17 PM   #6
bogeymanEST
Huge Clucker
 
Join Date: Sep 2007
Posts: 229
Reputation: 1
Default Re: Admin chat ain't working

Try this
pawn Code:
dcmd_a(playerid,params[])
{
    new aText[128],aName[MAX_PLAYER_NAME],string[128];
    if(pInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,COLOR_LIGHTYELLOW,"You are not an Administrator with the required level.");
    if(sscanf(params,"s",aText)) return SendClientMessage(playerid,COLOR_LIGHTYELLOW,"[USAGE] ''/a [text]''.");
   
    GetPlayerName(playerid,aName,sizeof(aName));
    format(string,sizeof(string),"[AdminChat]%s: %s",aName,aText);
   
    for(new i=0;i<=MAX_PLAYERS;i++)
    {
      if(pInfo[i][pAdmin] > 0)
        SendClientMessage(i,COLOR_LIGHTBLUE,string);
    }
    return 1;
}
bogeymanEST is offline  
Old 13/03/2010, 12:21 PM   #7
Razvann
Huge Clucker
 
Join Date: Jul 2009
Posts: 303
Reputation: 1
Default Re: Admin chat ain't working

pawn Code:
{
new aText[128],aName[MAX_PLAYER_NAME],string[128];
if(pInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,COLOR_LIGHTYELLOW,"You are not an Administrator with the required level.");
if(!sscanf(params,"s",aText)) return SendClientMessage(playerid,COLOR_LIGHTYELLOW,"[USAGE] ''/a [text]''.");

GetPlayerName(playerid,aName,sizeof(aName));
format(string,sizeof(string),"[AdminChat]%s: %s",aName,aText);

for(new i=0;i<=MAX_PLAYERS;i++)
{
  if(pInfo[i][pAdmin] > 0)
    SendClientMessage(i,COLOR_LIGHTBLUE,string);
}
return 1;
}
Razvann is offline  
Old 13/03/2010, 01:21 PM   #8
Andy_McKinley
Gangsta
 
Andy_McKinley's Avatar
 
Join Date: Jun 2009
Posts: 959
Reputation: 0
Default Re: Admin chat ain't working

Quote:
Originally Posted by Razvann
pawn Code:
{
new aText[128],aName[MAX_PLAYER_NAME],string[128];
if(pInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,COLOR_LIGHTYELLOW,"You are not an Administrator with the required level.");
if(!sscanf(params,"s",aText)) return SendClientMessage(playerid,COLOR_LIGHTYELLOW,"[USAGE] ''/a [text]''.");

GetPlayerName(playerid,aName,sizeof(aName));
format(string,sizeof(string),"[AdminChat]%s: %s",aName,aText);

for(new i=0;i<=MAX_PLAYERS;i++)
{
  if(pInfo[i][pAdmin] > 0)
    SendClientMessage(i,COLOR_LIGHTBLUE,string);
}
return 1;
}
Not working.

Quote:
Originally Posted by Razvann
pawn Code:
{
new aText[128],aName[MAX_PLAYER_NAME],string[128];
if(pInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,COLOR_LIGHTYELLOW,"You are not an Administrator with the required level.");
if(!sscanf(params,"s",aText)) return SendClientMessage(playerid,COLOR_LIGHTYELLOW,"[USAGE] ''/a [text]''.");

GetPlayerName(playerid,aName,sizeof(aName));
format(string,sizeof(string),"[AdminChat]%s: %s",aName,aText);

for(new i=0;i<=MAX_PLAYERS;i++)
{
  if(pInfo[i][pAdmin] > 0)
    SendClientMessage(i,COLOR_LIGHTBLUE,string);
}
return 1;
}
THIS ONE WORKS!!!
There is only 1 little thing:
When I type for example ''/a test''
it shows;
(AdminChat)[UF]DarkPhoenix: test
SERVER: Unknown Command (while it IS working).
Andy_McKinley is offline  
Old 13/03/2010, 02:05 PM   #9
KnackeBrod
Little Clucker
 
Join Date: Mar 2010
Posts: 7
Reputation: 0
Default Re: Admin chat < Shows unknown command while it is owrking.

Code:
return 0;
instead of
Quote:
return 1;
?

just a suggestion, im not a super good scripter
KnackeBrod is offline  
Old 13/03/2010, 02:37 PM   #10
Andy_McKinley
Gangsta
 
Andy_McKinley's Avatar
 
Join Date: Jun 2009
Posts: 959
Reputation: 0
Default Re: Admin chat < Shows unknown command while it is owrking.

Quote:
Originally Posted by KnackeBrod
Code:
return 0;
instead of
Quote:
return 1;
?
Doesn't change anything at all.
Andy_McKinley is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why is my chat text so big? funkydrumkid Client Support 2 28/10/2009 09:18 AM
/irc chat to message admins Striker_Moe Help Archive 4 31/08/2009 03:26 PM


All times are GMT. The time now is 04:18 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.