#1

i can't find a /ask
For Admin
Player Can do /ask
the admin's can help them.
Reply
#2

Using zcmd, and sscanf
pawn Код:
CMD:ask(playerid, params[])
{
    new string[128], pname[24];
    if(!sscanf(params,"s[128]",string))
    {
        GetPlayerName(playerid, pname, 24);
        format(string,128,"[ASK] %s is asking: %s",pname,string);
        for(new i=0;i<MAX_PLAYERS;i++)
        {
            if(IsPlayerAdmin(i)) SendClientMessage(i, -1, string);
        }
    }
    else SendClientMessage(playerid, 0xFF0000AA, "Usage: /ASK [Message]");
}
Reply
#3

The command don't wanna work.
Reply
#4

pawn Код:
if(IsPlayerAdmin(i))
This will send it to any RCON admins. (which means you must be logged in RCON)

Edit:

You can change it, using what your script sets for admin.

i.e., on my server it would be like this

pawn Код:
if(pInfo[i][pAdmin] >= 1)
Reply
#5

PHP код:
if(PlayerInfo[i][pAdmin] >= || IsPlayerAdmin(i)) 
Reply
#6

Quote:
Originally Posted by ThePhenix
Посмотреть сообщение
PHP код:
if(PlayerInfo[i][pAdmin] >= || IsPlayerAdmin(i)) 
This would also make it work for RCON admins AND normal admins.
Reply
#7

PHP код:
CMD:ask(playeridparams[])
{
    new 
text[128]; //Variable text
    
new string[256];
    new 
Name[MAX_PLAYER_NAME];
    
GetPlayerName(playeridNamesizeof(Name));
        
//You need sscanf2 include, sscanf plugin.
    
if(sscanf(params"s[128]"text)) return SendClientMessage(playerid, -1"USAGE: /ask [text]");
    for(new 
i=0;i<MAX_PLAYERS;i++)
        {
        if(
PlayerInfo[i][pAdmin] >= || IsPlayerAdmin(i))
        {
        
format(stringsizeof(string),"Player %s asks %s"Nametext);
        
SendClientMessage(i, -1string);
        }
    }
    return 
1;

Reply
#8

It work ,i'm going to test it.i hope dis do.
Thanks everone .


Edit"
Can i change the color's of the text?
Reply
#9

the -1 in SendClientMessage is where you can put the color.

pawn Код:
//With your defines
#define COL_YEL 0xFFFF0000 // Color Yellow
SendClientMessage(i, COL_YEL, string);
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)