Admin Chat < Admins can't see chat or my text, but I can see their chat -
Andy_McKinley - 13.03.2010
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;
}
Re: Admin chat ain't working -
bogeymanEST - 13.03.2010
pawn Code:
if(!sscanf(params,"s",aText))
should be
pawn Code:
if(sscanf(params,"s",aText))
Re: Admin chat ain't working -
Andy_McKinley - 13.03.2010
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.
Re: Admin chat ain't working - WackoX - 13.03.2010
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;
}
Re: Admin chat ain't working -
Andy_McKinley - 13.03.2010
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.
Re: Admin chat ain't working -
bogeymanEST - 13.03.2010
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;
}
Re: Admin chat ain't working -
Razvann - 13.03.2010
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;
}
Re: Admin chat ain't working -
Andy_McKinley - 13.03.2010
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).
Re: Admin chat < Shows unknown command while it is owrking. -
KnackeBrod - 13.03.2010
instead of
?
just a suggestion, im not a super good scripter
Re: Admin chat < Shows unknown command while it is owrking. -
Andy_McKinley - 13.03.2010
Quote:
Originally Posted by KnackeBrod
|
Doesn't change anything at all.
Re: Admin chat < Shows unknown command while it is owrking. -
SloProKiller - 13.03.2010
pawn Код:
{
new aText[128],aName[MAX_PLAYER_NAME],string[128];
if(pInfo[playerid][pAdmin] < 1) { SendClientMessage(playerid,COLOR_LIGHTYELLOW,"You are not an Administrator with the required level."); return 1; }
if(!sscanf(params,"s",aText)) { SendClientMessage(playerid,COLOR_LIGHTYELLOW,"[USAGE] ''/a [text]''."); return 1; }
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;
}
Should work, but I wrote it off my mind.
Re: Admin chat < Shows unknown command while it is owrking. - [03]Garsino - 13.03.2010
pawn Код:
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] < 1) 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)
SendClientMessage(i,COLOR_LIGHTBLUE,string);
}
return 1;
}
sscanf should be before pInfo
Re: Admin chat < Shows unknown command while it is owrking. -
Andy_McKinley - 13.03.2010
Quote:
Originally Posted by [03
Garsino ]
pawn Код:
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] < 1) 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) SendClientMessage(i,COLOR_LIGHTBLUE,string); } return 1; }
sscanf should be before pInfo
|
Not working. Seriously, noone knows! :P
Re: Admin chat < Shows unknown command while it is owrking. - [03]Garsino - 13.03.2010
Take a look at mine, it's working perfect.
pawn Код:
dcmd_adminmessage(playerid, params[])
{
if(PlayerInfo[playerid][Level] >= 1 || IsPlayerAdmin(playerid))
{
new msg[128], string[128];
if(sscanf(params, "s", msg)) return SendClientMessage(playerid, COLOUR_SYSTEM, "Usage: /adminmessage (message)");
if(strlen(msg) < 1) return SendClientMessage(playerid, COLOUR_SYSTEM, "Your Message Must Contain At Least 1 Character.");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][Level] >= 1)
{
format(string, sizeof(string), "Admin Message (%s): %s", pNick(playerid), msg);
SendClientMessage(i, 0x33FF33AA, string);
}
}
return 1;
}
else return SendErrorMessage(playerid, 0); // Unknown command error message
}
stock pNick(playerid) // You will need this one, it's a very handy custom function instead of using GetPlayerName all the time.
{
new nick[MAX_PLAYER_NAME];
GetPlayerName(playerid, nick, MAX_PLAYER_NAME);
return nick;
}
Re: Admin chat < Shows unknown command while it is owrking. -
Andy_McKinley - 13.03.2010
Quote:
Originally Posted by [03
Garsino ]
Take a look at mine, it's working perfect.
pawn Код:
dcmd_adminmessage(playerid, params[]) { if(PlayerInfo[playerid][Level] >= 1 || IsPlayerAdmin(playerid)) { new msg[128], string[128]; if(sscanf(params, "s", msg)) return SendClientMessage(playerid, COLOUR_SYSTEM, "Usage: /adminmessage (message)"); if(strlen(msg) < 1) return SendClientMessage(playerid, COLOUR_SYSTEM, "Your Message Must Contain At Least 1 Character."); for(new i = 0; i < MAX_PLAYERS; i++) { if(PlayerInfo[i][Level] >= 1) { format(string, sizeof(string), "Admin Message (%s): %s", pNick(playerid), msg); SendClientMessage(i, 0x33FF33AA, string); } } return 1; } else return SendErrorMessage(playerid, 0); // Unknown command error message }
stock pNick(playerid) // You will need this one, it's a very handy custom function instead of using GetPlayerName all the time. { new nick[MAX_PLAYER_NAME]; GetPlayerName(playerid, nick, MAX_PLAYER_NAME); return nick; }
|
No, I want to use my own but MY command isn't working that's why I asked help.
Re: Admin chat < Shows unknown command while it is owrking. - [03]Garsino - 13.03.2010
Look at mine and see how I made it
...
Re: Admin chat < Shows unknown command while it is owrking. -
Andy_McKinley - 13.03.2010
Quote:
Originally Posted by [03
Garsino ]
Look at mine and see how I made it
...
|
I told you, it ain't working.
Re: Admin chat < Shows unknown command while it is owrking. - [03]Garsino - 13.03.2010
Then you have screwed something up, srsly. It works fine for me.
Re: Admin chat < Shows unknown command while it is owrking. -
Scenario - 13.03.2010
Quote:
Originally Posted by [03
Garsino ]
Then you have screwed something up, srsly. It works fine for me.
|
This code works for me. You must have screwed something up, like stated above.
Re: Admin chat < Shows unknown command while it is owrking. - [03]Garsino - 13.03.2010
make sure you have the correct lengt with
dcmd(commandhere, commandlenght(without /), cmdtext);
like