Admin 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Admin Chat (
/showthread.php?tid=134329)
Admin Chat -
Andy_McKinley - 16.03.2010
Hey there,
Sorry for creating another thread about the same problem and script. The old one had 35 posts and sorry for being an ass to helpers, I've no idea why but forget about that. I am trying to get help again and being friendly this time.
First of all, here is the link (explanation and screenshots)
http://www.urbanfighterstdm.smfnew.c...php?topic=22.0
Alright, let's start! I have a problem with my admin chat command (/a). The command /a is working, I can see my own text, but noone else can see my text. Other admins are trying to chat with /a but does not see his own chat (just no ClientMessage), but I can see it. Here is my script, I have no idea what is wrong with my script, I thought it was working perfectly. Here is my script.
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] == 0) return SendClientMessage(playerid,COLOR_LIGHTYELLOW,"You are not an Administrator with the required level.");
GetPlayerName(playerid,aName,sizeof(aName));
format(string,sizeof(string),"Admin %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 -
smeti - 16.03.2010
Quote:
Originally Posted by DarkPhoenix
for(new p = 0; p <= MAX_PLAYERS; p++)
{
if(pInfo[p][pAdmin] > 0) return SendClientMessage(p,COLOR_LIGHTBLUE,string);
}
|
End for loop.
Delete return!
Re: Admin Chat -
Andy_McKinley - 16.03.2010
Quote:
Originally Posted by Phento
Quote:
Originally Posted by DarkPhoenix
for(new p = 0; p <= MAX_PLAYERS; p++)
{
if(pInfo[p][pAdmin] > 0) return SendClientMessage(p,COLOR_LIGHTBLUE,string);
}
|
End for loop.
Delete return!
|
I tried this, but without return it sends the Unknown Command Message.
Re: Admin Chat -
smeti - 16.03.2010
for(new p = 0; p <
= MAX_PLAYERS; p++)
Delete =
pawn Код:
dcmd_a(playerid, params[])
{
if(pInfo[playerid][pAdmin] == 0) return SendClientMessage(playerid, COLOR_LIGHTYELLOW, "You are not an Administrator with the required level.");
new
aText[144];
if(sscanf(params,"s",aText)) return SendClientMessage(playerid, COLOR_LIGHTYELLOW, "[USAGE] ''/a [text]''.");
new
aName[MAX_PLAYER_NAME];
GetPlayerName(playerid, aName, sizeof(aName));
format(aText, sizeof aText, "Admin %s: %s", aName, aText);
for(new i; i < MAX_PLAYERS; i++)
{
if(pInfo[i][pAdmin] > 0) SendClientMessage(i, COLOR_LIGHTBLUE, aText);
}
return 1;
}
Re: Admin Chat -
Andy_McKinley - 16.03.2010
Quote:
Originally Posted by Phento
for(new p = 0; p < = MAX_PLAYERS; p++)
Delete =
pawn Код:
dcmd_a(playerid, params[]) { if(pInfo[playerid][pAdmin] == 0) return SendClientMessage(playerid, COLOR_LIGHTYELLOW, "You are not an Administrator with the required level."); new aText[144]; if(sscanf(params,"s",aText)) return SendClientMessage(playerid, COLOR_LIGHTYELLOW, "[USAGE] ''/a [text]''."); new aName[MAX_PLAYER_NAME]; GetPlayerName(playerid, aName, sizeof(aName));
format(aText, sizeof aText, "Admin %s: %s", aName, aText);
for(new i; i < MAX_PLAYERS; i++) { if(pInfo[i][pAdmin] > 0) SendClientMessage(i, COLOR_LIGHTBLUE, aText); } return 1; }
|
Not working, this one is even worse (not showing anything).
Re: Admin Chat -
smeti - 16.03.2010
Quote:
Originally Posted by DarkPhoenix
Not working, this one is even worse (not showing anything).
|
Tested:
Re: Admin Chat -
Andy_McKinley - 16.03.2010
Quote:
Originally Posted by Phento
Quote:
Originally Posted by DarkPhoenix
Not working, this one is even worse (not showing anything).
|
Tested:

|
Weird, it ain't working for me. I just copied your script code.
Re: Admin Chat -
Andy_McKinley - 17.03.2010
Bump (24 hours later).