Command of Roll numbers
#4

Example:
pawn Код:
CMD:rollnumbers(playerid, params[])
{
    new min, max;
    if(sscanf(params, "ii", min, max)) return SendClientMessage(playerid, -1, "USAGE: /random [from] [to]");
    if(min > max) new var = min, min = max, max = var;
    new str[65];
    format(str, sizeof(str), "Number Rolled Between %d and %d: %d", min, max, (random(max - min + 1) + min));
    SendClientMessage(playerid, 0xFFFF00FF, str);
    return 1;
}
The above would also work, but you shouldn't use the "uu" sscanf parameters like Ralfie suggested.
Reply


Messages In This Thread
Command of Roll numbers - by Clad - 28.05.2014, 15:54
Re: Command of Roll numbers - by Clad - 28.05.2014, 16:10
Re : Command of Roll numbers - by S4t3K - 28.05.2014, 16:23
Re: Command of Roll numbers - by Threshold - 28.05.2014, 22:58

Forum Jump:


Users browsing this thread: 1 Guest(s)