help fast please!
#1

Hello.
When i use /asay, It shows: [ADMIN] y, But it should show what i typed, Not "y"
And i think the problem is from the "if(sscanf(params,"u",params))" line ..

PHP Code:
CMD:asay(playerid,params[])
{
    new 
string[128];
    if(
AdminLevel[playerid] < 1) return SCM(playerid,COLOR_WHITE,"{AFAFAF}[Error]: {FFFFFF}You do not have the correct admin level for this command.");
    if(
sscanf(params,"u",params))
    {
        
SendClientMessage(playerid,COLOR_WHITE""COL_USAGE"[SYNTAX] {FFFFFF}/asay [MESSAGE]");
        return 
1;
    }
     
format(string,sizeof(string),""COL_ADMIN"[ADMIN] {FFFFFF}%s",params);
      
SendClientMessageToAll(COLOR_WHITE,string);
       
format(string,sizeof(string),"%s(%d) has used /asay",PlayerName(playerid),playerid);
     
SendALogMessage(string);
      return 
1;

Reply
#2

Sorry for Bump, but help me fast!
Reply
#3

Try this:
PHP Code:
CMD:asay(playerid,params[]) 

    new 
string[128], message[128]; 
    if(
AdminLevel[playerid] < 1) return SCM(playerid,COLOR_WHITE,"{AFAFAF}[Error]: {FFFFFF}You do not have the correct admin level for this command."); 
    if(
sscanf(params,"s[128]",id,message)) 
    { 
        
SendClientMessage(playerid,COLOR_WHITE""COL_USAGE"[SYNTAX] {FFFFFF}/asay [MESSAGE]"); 
        return 
1
    } 
     
format(string,sizeof(string),""COL_ADMIN"[ADMIN] {FFFFFF}%s",message); 
      
SendClientMessageToAll(COLOR_WHITE,string); 
       
format(string,sizeof(string),"%s(%d) has used /asay",PlayerName(playerid),playerid); 
     
SendALogMessage(string); 
      return 
1

Reply
#4

Try This(self correction):
pawn Code:
CMD:asay(playerid, params[])
{
    new str[128];
    if(pInfo[playerid][Admin] >= 1)
    {
        if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid,COLOR_WHITE, ""COL_USAGE"[SYNTAX] {FFFFFF}/asay [MESSAGE]");
        format(str, sizeof(str), ""COL_ADMIN"[ADMIN] {FFFFFF}%s", GetName(playerid), params);
        SendClientMessageToAll(COL_WHITE, str);
        format(str, sizeof(str), "%s(%d) has used /asay", params);
        SendALogMessage(string);
    }
    else return SCM(playerid,COLOR_WHITE,"{AFAFAF}[Error]: {FFFFFF}You do not have the correct admin level for this command.");
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)