/asay not working
#1

i made /asay cmd but when i type any message it doesn't work, it only show me Usage: /asay [message]




CODE :
PHP код:
COMMAND:asay(playeridparams[])
{
    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playeridCOLOR_RED"You're not allowed to use this command");
    {
        new 
input[100], message[250];
        if(
sscanf(params"s[100]"input)) return SendClientMessage(playeridCOLOR_WHITE"{FF6600}Usage: {FFFFFF}/asay [message]");
        else
        {
            
format(messagesizeof(message), "{3604FF}[ADMIN] {FFFFFF}%s"input);
            
SendClientMessageToAll(COLOR_WHITEmessage);        
        }
    }
    return 
1;

Reply
#2

Update your sscanf, and learn how to write quality code, I can see tons of useless brackets, and that else is useless since if you cant fit for the requirements, the command will return.

Make the input string 128 characters long, and the message string 144 characters long.
Reply
#3

Код:
COMMAND:asay(playerid, params[]) 
{ 
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You're not allowed to use this command"); 
    new input[100], message[250]; 
    if(sscanf(params, "s[100]", input)) return SendClientMessage(playerid, COLOR_WHITE, "{FF6600}Usage: {FFFFFF}/asay [message]"); 
    format(message, sizeof(message), "{3604FF}[ADMIN] {FFFFFF}%s", input); 
    SendClientMessageToAll(COLOR_WHITE, message);         
    return 1; 
}
Try this
Reply
#4

where i can find updated sscanf?

EDITED:

i #include <sscanf2> and removed <sscanf>
Reply
#5

FIXED! thanks all it was just about sscanf2 i was including sscanf before
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)