/asay command [REP+]
#1

Please anyone create for me one /a command ( Admin) maybe look this pink name Admin FoREveR Say .........
evryone know this please create one for level 1 and command /a (admin) not /asay Who create for me and work i giving him REP+
Reply
#2

PHP Code:
CMD:asay(playeridparams[]){
     new 
pname[MAX_PLAYER_NAME], strings[128];
    if(
APlayerData[playerid][PlayerLevel] < 0) return 0;
        
GetPlayerName(playeridpnamesizeof(pname));
    
format(stringssizeof(strings), "Admin %s: %s"pnameparams);
    
SendClientMessageToAll(0x1874CDAAstrings);
    return 
1;

Problem solved.
Reply
#3

pawn Code:
COMMAND:a(playerid,params[])
{
    if(PlayerAcc[playerid][AdminLevel] >= 1) //replace THIS WITH YOUR own admin variable of your enum
    {
       
            new Announce[50];
            if(sscanf(params, "s[50]",Announce)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /asay [message]");

                new pname[MAX_PLAYER_NAME];
                GetPlayerName(playerid,pname,sizeof(pname));
                new astring[256];
                format(astring,sizeof(astring),"* Admin %s(%d): %s",pname,playerid,Announce);
                SendClientMessageToAll(ANNOUNCEMENT,astring);
           
    }
    else SendClientMessage(playerid,red,"ERROR: You must be an Admin level 1 or higher to perform this command!");
    return 1;
}
If your IQ is above 20, then everything should work...
Reply
#4

1.st i test bogdan command wait
pawn Code:
C:\Documents and Settings\rado\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1500) : error 021: symbol already defined: "cmd_asay"
C:\Documents and Settings\rado\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1502) : warning 217: loose indentation
C:\Documents and Settings\rado\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1502) : error 017: undefined symbol "PlayerInfo"
C:\Documents and Settings\rado\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1502) : warning 215: expression has no effect
C:\Documents and Settings\rado\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1502) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\rado\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1502) : error 029: invalid expression, assumed zero
C:\Documents and Settings\rado\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1502) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.
.... of bogdan i test insane
Reply
#5

pawn Code:
CMD:a(playerid, params[]){
    if(PlayerInfo[playerid][pAdmin] < 1) return 0;
    if(sscanf(params,"u", strings)) return SendClientMessage(playerid,COLOR_LIGHTBLUE, "USAGE: {FFFFFF}/a [text]");
    new Name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Name, sizeof(Name));
    format(strings, sizeof(strings), "Admin %s: %s", params, name);
    SendClientMessageToAll(0x1874CDAA, strings);
    return 1;
}
^^ version with name

EDIT: NVM u all too fast.
Reply
#6

^ _ ^
Reply
#7

pawn Code:
C:\Documents and Settings\rado\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1502) : error 017: undefined symbol "PlayerAcc"
C:\Documents and Settings\rado\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1502) : warning 215: expression has no effect
C:\Documents and Settings\rado\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1502) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\rado\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1502) : error 029: invalid expression, assumed zero
C:\Documents and Settings\rado\Desktop\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(1502) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
of insane command
Reply
#8

Quote:
Originally Posted by Bogdan1992
View Post
PHP Code:
CMD:a(playeridparams[]){
     new 
pname[MAX_PLAYER_NAME];
    if(
PlayerInfo[playerid][pAdmin] < 1) return 0;
    if(
sscanf(params,"u"strings)) return SendClientMessage(playerid,COLOR_LIGHTBLUE"USAGE: {FFFFFF}/a [text]");
GetPlayerName(playeridpnamesizeof(pname));
    
format(stringssizeof(strings), "Admin %s: %s"pname,params);
    
SendClientMessageToAll(0x1874CDAAstrings);
    return 
1;

LOL, man, param "u" is for user/bot, "s" is for string in sscanf.

Code:
CMD:a( playerid, params[ ] )
{
    if ( PlayerInfo[ playerid ][ Level ] < 1 ) return SendClientMessage( playerid, 0xFF0000FF, "ERROR: You need to be admin level 1, to use this command!" );
    new lsAnn[ 128 ];
    if ( sscanf( params, "s[128]", lsAnn ) ) return SendClientMessage( playerid, 0xFF0000FF, "USAGE: /a [Text]" );

    new string[ 129 ];
    format( string, sizeof( string ), "Admin %s: %s", PlayerName( playerid ), lsAnn );
    SendClientMessageToAll( COLOR, string );
    return 1;
}
Reply
#9

Quote:
Originally Posted by Bogdan1992
View Post
PHP Code:
CMD:a(playeridparams[]){
    if(
PlayerInfo[playerid][pAdmin] < 1) return 0;
    if(
sscanf(params,"u"strings)) return SendClientMessage(playerid,COLOR_LIGHTBLUE"USAGE: {FFFFFF}/a [text]");
    
format(stringssizeof(strings), "Admin: %s"params);
    
SendClientMessageToAll(0x1874CDAAstrings);
    return 
1;

He want the name of the admin by whom the command is types.

So the correct code according to the OP requested is
pawn Code:
CMD:asay ( playerid , params [] )
{
    if ( !IsPlayerAdmin ( playerid ) ) return SendClientMessage ( playerid , -1 , "Your not admin" ) ;
    new pName [ MAX_PLAYER_NAME ] , Str [ 128 ] ;
    GetPlayerName ( playerid , pName , MAX_PLAYER_NAME ) ;
    format ( Str , 128 , "%s says : %s" , pName , params ) ;
    SendClientMessageToAll ( -1 , Str ) ;
    return 1;
}
Reply
#10

Quote:
Originally Posted by Twisted_Insane
View Post
pawn Code:
COMMAND:a(playerid,params[])
{
    if(PlayerAcc[playerid][AdminLevel] >= 1) //replace THIS WITH YOUR own admin variable of your enum
    {
       
            new Announce[50];
            if(sscanf(params, "s[50]",Announce)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /asay [message]");

                new pname[MAX_PLAYER_NAME];
                GetPlayerName(playerid,pname,sizeof(pname));
                new astring[256];
                format(astring,sizeof(astring),"* Admin %s(%d): %s",pname,playerid,Announce);
                SendClientMessageToAll(ANNOUNCEMENT,astring);
           
    }
    else SendClientMessage(playerid,red,"ERROR: You must be an Admin level 1 or higher to perform this command!");
    return 1;
}
If your IQ is above 20, then everything should work...
lel 20.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)