SA-MP Forums Archive
/a help - 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)
+--- Thread: /a help (/showthread.php?tid=480125)



/a help - lulo356 - 09.12.2013

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


Re: /a help - lulo356 - 09.12.2013

Can someone helpme?:P


Re: /a help - Padevex - 09.12.2013

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


Re: /a help - lulo356 - 09.12.2013

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.


Re: /a help - Padevex - 09.12.2013

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]?


Re: /a help - lulo356 - 09.12.2013

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.


Re: /a help - DavidLuango - 09.12.2013

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


Re: /a help - newbie scripter - 09.12.2013

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;
}



Re: /a help - lulo356 - 09.12.2013

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


Re: /a help - iJumbo - 09.12.2013

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;
}