/a help
#1

well, if i do /a ingame you see the message from /a [text] but if you write somting, you dont see it anymore, Example: /a hey how are you

onplayercommandtext
Quote:

dcmd(a, 1, cmdtext);

the dcmd
Quote:

dcmd_a(playerid, cmdtext[]) {
#pragma unused cmdtext
new sendername[MAX_PLAYER_NAME];
new string[256], idx;
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /a <message>");
return 1;
}
format(string, sizeof(string), "[AdminChat]%s: %s", sendername, result);
SendAdminMessage(COLOR_WHITE,string);
return 1;
}

What do i need to add or change to make it work
Reply
#2

Can someone helpme?:P
Reply
#3

Please elaborate?
If I did [/a Hello!], what would happen?
Reply
#4

Quote:
Originally Posted by Padevex
Посмотреть сообщение
Please elaborate?
If I did [/a Hello!], what would happen?
Well, its a admin chat, so you need to see it in a chat.
Reply
#5

Ok, that I understand.
But I need you to tell me what happens.

Does the player who wrote the command see it?
Does only one admin see it?
Does nobody see it? Etc.

What happens when you do [t/a Hello!]?
What happens when you do [t/a]?
Reply
#6

If you do /a you will see the message from Server: /a Message
If you do /a test, its not working you wont see somting.
Reply
#7

You are very unclear on your conflict please be more explanatory.
Reply
#8

pawn Код:
// Enum:
enum pInfo
{
    AdminLevel
}

new PlayerData [] [pInfo];
CMD:a(playerid, params[])
{
    new p2[128], Pna[32];
    if(PlayerData [playerid] [AdminLevel] < 1) return 0;
    if( isnull (params)) return SendClientMessage(playerid, COLOR_RED, "/a [msg]");
    GetPlayerName(playerid, Pna, 32);
    if (PlayerData [playerid] [ALevel] >= 1 || IsPlayerAdmin(playerid))
    {
        for(new i = 0; i<MAX_PLAYERS; i++)
        {
            if (IsPlayerConnected(i))
            {
                if(PlayerData[i] [AdminLevel] >= 1)
                {
                    format(p2, 128, "Admin %s (%d): %s", Pna, playerid, params);
                    SendClientMessage(i , -1, p2);
                }
            }
        }
    }  
    return 1;
}
Reply
#9

http://www.youtube.com/watch?v=vQFSF...ature=*********
Reply
#10

pawn Код:
dcmd_a(playerid, params[]) {
    new string[128], str[128], sendername[MAX_PLAYER_NAME];
    if(sscanf(params, "s", str)) return SendClientMessage(playerid, -1,"USAGE: /a <message>");
    //if(YourAdminVariable[playerid] == 0) you are not admin bla ba
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "[AdminChat]%s: %s", sendername, str);
    SendAdminMessage(COLOR_WHITE,string);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)