Admin Chat
#1

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, 1, cmdtext);
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;
}
Reply
#2

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

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

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;
}
Reply
#5

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).
Reply
#6

Quote:
Originally Posted by DarkPhoenix
Not working, this one is even worse (not showing anything).
Tested:
Reply
#7

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

Bump (24 hours later).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)