Company Advertisement for Admins
#1

When I type /admincad it says:


Код HTML:
CMD:admincad(playerid, params[])
{
    if(pInfo[playerid][pAdmin] >= 3)
	{
	new string[258], result;
    if(!sscanf(params, "u",result))
	{
	format(string, sizeof(string), "[Company Advertisement] %s", (result));
	SendClientMessageToAll(COLOR_GREEN, string);
	}
	else
	{
	    SendClientMessage(playerid, COLOR_WHITE, "USAGE: /admincad [params]");
		}
	}
	return 1;
}
Reply
#2

Try this:

pawn Код:
CMD:admincad(playerid, params[])
{
    if(pInfo[playerid][pAdmin] >= 3)
    {
        new string[128], _message[128];
        if(sscanf(params, "s[128]", _message)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /admincad [message]");
        format(string, sizeof(string), "[Company Advertisement] %s", _message);
        SendClientMessageToAll(COLOR_GREEN, string);
    }
    else SendClientMessage(playerid, -1, "You're not able to use this");
    return 1;
}
Reply
#3

Seems like you're using a wrong specifier

Read this https://github.com/Y-Less/sscanf/wiki
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)